//****************************************************************************//
//****************** Planning (cont.) - October 9th, 2019 *******************//
//**************************************************************************//

- Okay - we're discussing planning, so here's the planning scene from Ocean's 11!
    - First, they're talking about the goal and the requirements they need - what casinos they want to rob!
        - Then, they're specifying the operators they need and their constraints: getting past the locked doors, slipping into the elevator, etc.
            - The objects themselves are the constraints (e.g. the 6-digit code-locked door), while the acts we do on 
        - They also talk about unavailable operators that won't work: tunneling, forcing way past the guard, etc.
    - Now, these multiple goals could be OPPORTUNISTIC (i.e. one goal's plan helps to achieve the other) or CONFLICTING (i.e. one goal's plan prevents/hurts us from achieving the other)
        - For the former, if you leave your house to get milk and pick up a newspaper on the way, you've accomplished 2 goals just by trying to get the milk!
        - For the latter, getting the newspaper from your front lawn and reading it would conflict with going out to get milk!
            - Negative examples like this are much harder to deal with
--------------------------------------------------------------------------------

- So, we're talking about PARTIAL-ORDER PLANNING - how is that different from something like A*?
    - Well, A* only gets us to 1 goal, while partial-order planning tries to accomplish multiple goals
    - All of these methods also require some kind of knowledge to work
        - For A*, you need a graph with distances and a heuristic estimate of how far we are from the goal, but it guarantees an optimal solution!
            - So, if we don't have a single goal
        - For means-end analysis, we can have multiple interacting goals, but we need a (simple) distance heuristic and clearly-defined states, and its solutions are greedy and not guaranteed to be optimal OR completely correct
        - For partial-order planning, there can be multiple interacting goals, but we need operators with explicit pre/post-conditions, and it generates correct (but not necessarily optimal) solutions
    - "Hopefully you can also see where we're going with meta-cognition; we'll have all these planning methods in store, try to see what knowledge we have available, and pick the best method"

- Also, a quick correction from last lecture: in STRIPS notation, it's the PRE-CONDITION that never has any negative conditions, rather than the post-condition
    - You can get the same results using either one, but this is the STRIPS convention

- Now, the difficulty in partial-order planning is detecting conflicts between our different goals
    - To do this, we first generate a plan for each goal
    - We then look at the post-conditions of the current plan and check if they conflict with any of the pre-conditions of the operators in the other plans
        - If there is such a conflict, we swap the order of our operators, check for conflicts again, then add any operators to connect our different goals together

- Now, whenever you're building a theory of intelligence, you're making some commitments to the knowledge, algorithm, and architecture
    - The architecture in this planning algorithm is that we have a BUNCH of small agents working simultaneously
        - This implies we should use some type of BLACKBOARD ARCHITECTURE, where all the agents write all of their data (problems/solutions/etc.) on a shared "blackboard" memory, and each agent just does its job on the blackboard without directly talking to the other agents (instead interacting by altering what the other agents have written)
    - Which one is right? Should we go with our production system architecture? This society of mind, blackboard style? There's no agreement among AI researchers!
        - The general consensus now is that we'll probably find that different architectures are best for different levels of thinking, but that's still just speculation

- Alright, we'll stop here for today - ciao!