1 / 22

Chapter 4 - Planning

Part II: Methods of AI. Chapter 4 - Planning. 4.1 State Space Planning. 4.2 Partial Order Planning. 4.3 Planning in the Real World. Partial Order Planning (POP). See: Russell, Norvig, AI; chapter 11. a. b. c. c. a. b. Partial Plans.

Download Presentation

Chapter 4 - Planning

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Part II: Methods of AI Chapter 4 - Planning 4.1 State Space Planning 4.2 Partial Order Planning 4.3 Planning in the Real World

  2. Partial Order Planning (POP) See: Russell, Norvig, AI; chapter 11

  3. a b c c a b Partial Plans ► Partial plan: a partially ordered set of operator instances The partial order gives only some constraints on the order in which the operations have to be performed ► Start a dummy operator ► Finish another dummy operator putdown(?y) pickup(a) unstack(?x, a) Start stack(a, b) Finish pickup(b) stack(b, c)

  4. Partial Plans ?x = ?y, ?y = c putdown(?y) pickup(a) unstack(?x, a) clear(a) Start stack(a,b) Finish pickup(b) stack(b, c) ► Partial plans can also contain the following information: ?x = ?y, ?y = c ♦ variable binding constraints pickup(a) ♦ causal links unstack(?x, a) clear(a) often called protected conditions

  5. Transform Partial Order Plan into Total-order Plan: Start Start Start Start Start Start Start RightSock RightSock LeftSock LeftSock RightSock LeftSock LeftSock RightSock LeftSock LeftSock RightSock RightSock RightShoe LeftShoe LeftSockOn RightSockOn LeftShoe RightShoe RightShoe LeftShoe LeftSock RightSock LeftShoe RightShoe RightShoe LeftShoe LeftShoe RightShoe Left Shoe RightShoe LeftShoeOn, RightShoeOn Finish Finish Finish Finish Finish Finish Finish

  6. The Poplan Algorithm A - actions O - order constraints L – links agenda - set of goals Q - preconds of A POP(<A,O,L>, agenda) 1. Termination: If agenda is empty return <A,O,L> 2. Goal selection: Let <Q,Aneed> be a pair on the agenda 3. Action selection: Let Aadd = choose an action that adds Qif no such action exists, then return failure LetL’= L  {Aadd→ Aneed}, and letO’= O  {Aadd< Aneed}. IfAadd is newly instantiated, thenA’ = A{Aadd} and O’= O  {A0< Aadd< A} (otherwise, A’ = A) 4. Updating of goal set:Letagenda’ = agenda -{<Q,Aneed>}. IfAadd is newly instantiated, then for each conjunction, Qi, of its precondition, add <Qi,Aneed> to agenda’ • 5. Causal link protection: For every action At that might threaten a causal link Ap→ Ac, add a consistentordering constraint, either • Demotion: Add At< Ap to O’ • Promotion: Add Ac< At to O’ • Inequality constraints • If neither constraint is consistent, then return failure 6. Recursive invocation: POP((<A’,O’,L’>, agenda’, )

  7. THREATS DEFINITION: Let st  be a causal link with condition c in a partial plan P. Suppose P also contains a step r with an effect q such that • consistentP (s  r ) and consistentP ( r t ) i.e., P’s ordering constraints allow putting r between s and t • Suppose q is unifiable with ~c, and P ’s variable-binding constraints do not prevent us from unifying it either Then r is a threat to the causal link st 

  8. Threats: Example r = stack( b,?z) below is a threat to the causal link clear (a) ?x = ?y ?y = c putdown(?y) pickup(a) unstack(?x,a) clear(a) Start Finish stack(b,?z) • Threats “threaten” correctness!

  9. Threat Detection and Removal (1) • Detection: for each causal link st  and for each step r, check positive and negative threats • Threat removal: • (i) demotion, (ii) promotion and (iii) separation (i) Demotion: order r before s ?x=?y, ?y=c stack(b,?z) putdown(?y) Start Finish unstack(?x,a) pickup(a) clear(a)

  10. Threat Detection and Removal ?x=?y, ?y=c • (ii) Promotion:order r after t stack(b,?z) putdown(?y) Start Finish unstack(?x,a) pickup(a) clear(a) • (iii) Separation:introduce a variable-binding constraint ?x = ?y ?y = c ?z  a putdown(?y) pickup(a) unstack(?x,a) clear(a) Start Finish stack(b,?z)

  11. POPLAN Search Space (1) on(c,a) ontable(a) clear(c) ontable(b) clear(b) handempty Start Finish on(b,c) on(a,b) clear(a) A C B A B C

  12. Poplan Search Space (2) Start Finish Start unstack(c,a) Finish Start putdown(c) Finish unstack(c,a) ... ... putdown(c) stack(b,c) Start pickup(b) unstack(c,a) Finish ... ... stack(b,c) Start putdown(c) stack(a,b) unstack(c,a) pickup(b) pickup(a) Finish

  13. Plan Space Search Move C to Table, Move B to C Move A to B Move B to C Move A to B Move A to B Move A to Table, Move A to B

  14. State-Space Search C A B C A B C Initialstate B A B A C A B C B B C A B A B C C A C A A A Goal B C B C B C A A C B

  15. Another Example SM: Super Market HS: Hardware Store • At(Home) • Sells(SM, Banana) • Sells(HS, Drill) • Have(Drill) • Have(Milk) • Have(Banana)

  16. Partial Order Planning Start At(Home) Buy(Banana) Buy(Milk) Buy(Drill) Causal links At(Home) Have(Banana) Have(Milk) Have(Drill) End

  17. Refining the Plan (1) NB: all causal linksare also ordering links At(Home) Start Ordering links At(s) Sells(s,Banana) At(s) Sells(s,Milk) At(s) Sells(s,Drill) Buy(Banana) Buy(Milk) Buy(Drill) Causal links At(Home) Have(Banana) Have(Milk) Have(Drill) End

  18. Refining the Plan (2) NB: all causal linksare also ordering links At(Home) Start At(SM) Sells(SM,Banana) At(SM) Sells(SM,Milk) At(HWS) Sells(HWS,Drill) Buy(Banana) Buy(Milk) Buy(Drill) Causal links At(Home) Have(Banana) Have(Milk) Have(Drill) End

  19. Refining the Plan (3) At(Home) Start At(s) At(s) Go(SM) Go(HWS) At(SM) Sells(SM,Banana) At(SM) Sells(SM,Milk) At(HWS) Sells(HWS,Drill) Buy(Banana) Buy(Milk) Buy(Drill) At(Home) Have(Banana) Have(Milk) Have(Drill) End

  20. Refining the Plan (4) At(Home) Start At(Home) At(Home) Go(SM) Go(HWS) At(SM) Sells(SM,Banana) At(SM) Sells(SM,Milk) At(HWS) Sells(HWS,Drill) Buy(Banana) Buy(Milk) Buy(Drill) At(Home) Have(Banana) Have(Milk) Have(Drill) End

  21. Threats to Causal Links At(Home) Start At(Home) At(Home) Go(SM) Go(HWS) At(SM) Sells(SM,Banana) At(SM) Sells(SM,Milk) At(HWS) Sells(HWS,Drill) Buy(Banana) Buy(Milk) Buy(Drill) At(Home) Have(Banana) Have(Milk) Have(Drill) End

  22. Threats to Causal Links: Demotion At(Home) Start At(HWS) At(Home) Go(SM) Go(HWS) At(SM) Sells(SM,Banana) At(SM) Sells(SM,Milk) At(HWS) Sells(HWS,Drill) Buy(Banana) Buy(Milk) Buy(Drill) At(Home) Have(Banana) Have(Milk) Have(Drill) At(SM) Go(Home) End

More Related