SNS College of Engineering Department of Computer Science and Engineering AI Planning Presented By S.Yamuna AP/CSE 7/29/2017 AI 1 General-Purpose Planning: State & Goals Initial state A C B A B Goals C • Initial state: (on A Table) (on C A) (on B Table) (clear B) (clear C) • Goals: (on C Table) (on B C) (on A B) (clear A) 7/29/2017 AI 2 General-Purpose Planning: Operators No block on top of ?x No block on top of ?y nor ?x ?x ?y ?y … transformation Operator: (Unstack ?x) • Preconditions: (on ?x ?y) (clear ?x) • Effects: – Add: (on ?x table) (clear ?y) 7/29/2017 AI – Delete: (on ?x ?y) … ?x On table 3 Planning: Search Space A C B B C A C A B C A B B A C A B C A B C A A B C B C A B C C A B 7/29/2017 C B A B A C AI 4 Some Examples Which of the following problems can be modeled as AI planning problems? • Route search: Find a route between Lehigh University and the Naval Research Laboratory • Project management: Construct a project plan for organizing an event (e.g., the Musikfest) • Military operations: Develop an air campaign • Information gathering: Find and reserve an airline ticket to travel from Newark to Miami • Game playing: plan the behavior of a computer controlled player • Resources control: Plan the stops of several of elevators in a skyscraper building. Answer: ALL! 7/29/2017 AI 5 Planning Operators FSM vs AI Planning FSM: Monster In Sight Patrol Fight No Monster •Patrol Preconditions: No Monster Effects: patrolled •Fight Preconditions: Monster in sight Effects: No Monster A resulting plan: Monster in sight Fight 7/29/2017 No Monster patrolled Patrol AI Neither is more powerful than the other one6 But Planning Gives More Flexibility • “Separates implementation from data” --- Orkin Planning Operators reasoning •Patrol Preconditions: No Monster Effects: patrolled •Fight Preconditions: Monster in sight Effects: No Monster … 7/29/2017 knowledge Many potential plans: Fight Fight Fight Fight Fight Patrol Patrol Patrol Patrol Patrol … If conditions in the state change making the current plan unfeasible: replan! AI 7 But… Does Classical Planning Work for Games? F.E.A.R. not! 7/29/2017 AI 8 General Purpose vs. Domain-Specific Planning: find a sequence of actions to achieve a goal General purpose: symbolic descriptions of the problems and the domain. The plan generation algorithm the same Advantage: - opportunity to have clear semantics Disadvantage: - symbolic description requirement Domain Specific: The plan generation algorithm depends on the particular domain Advantage: - can be very efficient Disadvantage: - lack of clear semantics - knowledge-engineering for plan generation 7/29/2017 AI 9 Classes of General-Purpose Planners General purpose planners can be classified according to the space where the search is performed: • state • plan We are going to discuss these forms • Hierarchical • Disjunctive plans • SAT 7/29/2017 AI 10 State- and Plan-Space Planning • State-space planners transform the state of the world. These planners search for a sequence of transformations linking the starting state and a final state State of the world (total order) • Plan-space planners transform the plans. These planners search for a a plan satisfying certain conditions (partial-order, least-commitment) 7/29/2017 AI 11 Why Plan-Space Planning? • 1. Motivation: “Sussman Anomaly” – Two subgoals to achieve: (on A B) (on B C) A C A 7/29/2017 B B C AI 12 Why Plan-Space Planning? • Problem of state-space search: – Try (on A B) first: • put C on the Table, then put A on B A C A B C A B B C • Accidentally wind up with A on B when B is still on the Table • We can not get B on C without taking A off B • Try to solve the first subgoal first appears to be mistaken 7/29/2017 AI 13 Hierarchical (HTN) Planning Principle: Complex tasks are decomposed into simpler tasks. The goal is to decompose all the tasks into primitive tasks, which define actions that change the world. Travel from UMD to Lehigh University alternative methods Travel by car Travel by plane Enough money for air fare available Enough money for gasoline Seats available Roads are passable 7/29/2017 AI Travel(UMD, Lehigh) Travel(UMD,National) Taxi(UMD,UMD-Metro) Metro(UMD-Metro,National) Fly(National, L.V. International) Travel(L.V. Int’nal,Lehigh) Taxi(L.V. Int’nal,Lehigh) 14 Application to Computer Bridge • Chess: better than all but the best humans • Bridge: worse than many good players • Why bridge is difficult for computers – It is an imperfect information game – Don’t know what cards the others have (except the dummy) – Many possible card distributions, so many possible moves • If we encode the additional moves as additional branches in the game tree, this increases the number of nodes exponentially – worst case: about 6x1044 leaf nodes 24 leaf nodes – Not average case: about 10 enough time to search the game tree 7/29/2017 AI 15 How to Reduce the Size of the Game Tree? • Bridge is a game of planning – Declarer plans how to play the hand by combining various strategies (ruffing, finessing, etc.) – If a move doesn’t fit into a sensible strategy, then it probably doesn’t need to be considered • HTN approach for declarer play – Use HTN planning to generate a game tree in which each move corresponds to a different strategy, not a different card • Reduces average game-tree size to about 26,000 leaf nodes • Bridge Baron: implements HTN planning – Won the 1997 World Bridge Computer Challenge – All commercial versions of Bridge Baron since 1997 have 7/29/2017 include an HTN planner (hasAIsold many thousands of copies) 16 Universal Classical Planning (UCP) (Khambampati, 1997) partially instantiated steps, plus constraints • Loop: – If the current partial plan is a solution, then exit – Nondeterministically choose a way to refine the plan add steps & constraints • Some of the possible refinements – Forward & backward state-space refinement State-space – Plan-space refinement – Hierarchical refinements Plan-space 7/29/2017 AI 17 Abstract Example Initial plan: Plan-space refinement Initial state final state State-space refinement Plan-space refinement 7/29/2017 State-space refinement AI 18 Why “Classical”? • Classical planning makes a number of assumptions: – Symbolic information (i.e., non numerical) – Actions always succeed – The “Strips” assumption: only changes that takes place are those indicated by the operators • Despite these (admittedly unrealistic) assumptions some work-around can be made (and have been made!) to apply the principles of classical planning to games • Neoclassical planning removes some of these assumptions 7/29/2017 AI 19 THANK Y OU 7/29/2017 AI 20
© Copyright 2025 Paperzz