1 / 40

Planning

Planning. Russell and Norvig: Chapter 11 Russell and Norvig: Chapter 11 CS121 – Winter 2003. sensors. environment. ?. agent. actuators. A1. A2. A3. Planning Agent. Goal of Planning. Suppose that the goal is HAVE(MILK).

Download Presentation

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. Planning Russell and Norvig: Chapter 11 Russell and Norvig: Chapter 11 CS121 – Winter 2003

  2. sensors environment ? agent actuators A1 A2 A3 Planning Agent

  3. Goal of Planning • Suppose that the goal is HAVE(MILK). • From some initial state where HAVE(MILK) is not satisfied, the successor function must be repeatedly applied to eventually generate a state where HAVE(MILK) is satisfied. • An explicit representation of the possible actions and their effects would help the problem solver select the relevant actions • Choose actions to achieve a certain goal • But isn’t it exactly the same goal as for problem solving? • Some difficulties with problem solving: • The successor function is a black box: it must be “applied” to a state to know which actions are possible in that state and what are the effects of each one Otherwise, in the real world an agent would be overwhelmed by irrelevant actions

  4. Goal of Planning Suppose that the goal is HAVE(MILK)HAVE(BOOK) Without an explicit representation of the goal, theproblem solver cannot know that a state whereHAVE(MILK) is already achieved is more promisingthan a state where neither HAVE(MILK) norHAVE(BOOK) is achieved • Choose actions to achieve a certain goal • But isn’t it exactly the same goal as for problem solving? • Some difficulties with problem solving: • The goal test is another black-box function, states are domain-specific data structures, and heuristics must be supplied for each new problem

  5. Goal of Planning • Choose actions to achieve a certain goal • But isn’t it exactly the same goal as for problem solving? • Some difficulties with problem solving: • The goal may consist of several nearly independent subgoals, but there is no way for the problem solver to know it HAVE(MILK)and HAVE(BOOK) may be achieved bytwo nearly independent sequences of actions

  6. Problem solving Logic representation Planning Representations in Planning Planning opens up the black-boxes by using logic to represent: • Actions • States • Goals One possible language: STRIPS

  7. C TABLE A B State Representation Conjunction of propositions: BLOCK(A), BLOCK(B), BLOCK(C), ON(A,TABLE), ON(B,TABLE), ON(C,A), CLEAR(B), CLEAR(C), HANDEMPTY

  8. C B A Goal Representation Conjunction of propositions: ON(A,TABLE), ON(B,A), ON(C,B) The goal G is achieved in a state S if all the propositions in G are also in S

  9. Effect: list of literals Precondition: conjunction of propositions Means: Add HOLDING(x) to state Means: Remove HANDEMPTY from state Action Representation • Unstack(x,y) • P =HANDEMPTY, BLOCK(x), BLOCK(y), CLEAR(x), ON(x,y) • E =HANDEMPTY, CLEAR(x), HOLDING(x),ON(x,y), CLEAR(y)

  10. C A B Example BLOCK(A), BLOCK(B), BLOCK(C), ON(A,TABLE), ON(B,TABLE), ON(C,A), CLEAR(B), CLEAR(C), HANDEMPTY • Unstack(C,A) • P =HANDEMPTY, BLOCK(C), BLOCK(A), CLEAR(C), ON(C,A) • E =HANDEMPTY, CLEAR(C), HOLDING(C),ON(C,A), CLEAR(A)

  11. Example C BLOCK(A), BLOCK(B), BLOCK(C), ON(A,TABLE), ON(B,TABLE), ON(C,A), CLEAR(B), CLEAR(C), HANDEMPTY, HOLDING(C), CLEAR(A) A B • Unstack(C,A) • P =HANDEMPTY, BLOCK(C), BLOCK(A), CLEAR(C), ON(C,A) • E =HANDEMPTY, CLEAR(C), HOLDING(C),ON(C,A), CLEAR(A)

  12. Action Representation • Unstack(x,y) • P = HANDEMPTY, BLOCK(x), BLOCK(y), CLEAR(x), ON(x,y) • E = HANDEMPTY, CLEAR(x), HOLDING(x),  ON(x,y), CLEAR(y) • Stack(x,y) • P = HOLDING(x), BLOCK(x), BLOCK(y), CLEAR(y) • E = ON(x,y), CLEAR(y), HOLDING(x), CLEAR(x), HANDEMPTY • Pickup(x) • P = HANDEMPTY, BLOCK(x), CLEAR(x), ON(x,TABLE) • E = HANDEMPTY, CLEAR(x), HOLDING(x), ON(x,TABLE) • PutDown(x) • P = HOLDING(x) • E = ON(x,TABLE), HOLDING(x), CLEAR(x), HANDEMPTY

  13. B C Pickup(B) C B C B A A A Unstack(C,A)) B C C A A C B C A B A B B C A A B C Forward Planning Forward planning searches a space of word states In general, many actions are applicableto a state  huge branching factor

  14. Relevant Action • An action is relevant to a goal if one of its effects matched a goal proposition • Stack(B,A) • P = HOLDING(B), BLOCK(A), CLEAR(A) • E = ON(B,A), CLEAR(A), HOLDING(B), CLEAR(B), HANDEMPTY is relevant to ON(B,A), ON(C,B)

  15. Regression of a Goal • The regression of a goal G through an • action A is the weakest precondition • R[G,A] such that: • If a state S satisfies R[G,A] then: • The precondition of A is satisfied in S • Applying A to S yields a state that satisfies G

  16. Example • G = ON(B,A), ON(C,B) • Stack(C,B) • P = HOLDING(C), BLOCK(C), BLOCK(B), CLEAR(B) • E = ON(C,B), CLEAR(B), HOLDING(C), CLEAR(C), HANDEMPTY • R[G,Stack(C,B)] =ON(B,A),HOLDING(C), BLOCK(C), BLOCK(B), CLEAR(B)

  17. Example • G = CLEAR(B), ON(C,B) • Stack(C,B) • P = HOLDING(C), BLOCK(C), BLOCK(B), CLEAR(B) • E = ON(C,B), CLEAR(B), HOLDING(C), CLEAR(C), HANDEMPTY • R[G,Stack(C,B)] = False

  18. Computation of R[G,A] • If any element of G is deleted by A then return False • G’  Precondition of A • For every element SG of G do If SG is not added by A then add SG to G’ • Return G’

  19. also called state constraints impossible Inconsistent Regression Inconsistency rules: HOLDING(x) ON(y,x)  False HOLDING(x)  ON(x,y)  False HOLDING(x)  HOLDING(y)  False Etc… • G = ON(B,A), ON(C,B) • Stack(B,A) • P = HOLDING(B), BLOCK(A), CLEAR(A) • E = ON(B,A), CLEAR(A), HOLDING(B), CLEAR(B), HANDEMPTY • R[G,Stack(B,A)] =HOLDING(B), BLOCK(A), CLEAR(A),ON(C,B)

  20. Computation of R[G,A] • If any element of G is deleted by A then return False • G’  Precondition of A • For every element SG of G do If SG is not added by A then add SG to G’ • If an inconsistency rule applies to G’ then return False • Return G’

  21. C A B Backward Chaining ON(B,A), ON(C,B) Stack(C,B) ON(B,A), HOLDING(C), CLEAR(B) In general, there are much fewer actions relevant to a goal than there are actions applicable to a state  smaller branching factor than with forward planning

  22. Pickup(C) ON(B,A), CLEAR(B), HANDEMPTY, CLEAR(C), ON(C,TABLE) Stack(B,A) C CLEAR(C), ON(C,TABLE), HOLDING(B), CLEAR(A) A B Pickup(B) CLEAR(C), ON(C,TABLE), CLEAR(A), HANDEMPTY, CLEAR(B), ON(B,TABLE) Putdown(C) CLEAR(A), CLEAR(B), ON(B,TABLE), HOLDING(C) Unstack(C,A) CLEAR(B), ON(B,TABLE), CLEAR(C), HANDEMPTY, ON(C,A) Backward Chaining ON(B,A), ON(C,B) Stack(C,B) ON(B,A), HOLDING(C), CLEAR(B) Backward planning searches a space of goals

  23. Form of least commitment Nonlinear Planning • Both forward and backward planning methods commit to a total ordering on the selected actions • Drawback: They do not take advantage of possible (near) independence among subgoals • Nonlinear planning: No unnecessary ordering among subgoals

  24. Nonlinear Planning P: -: +: ON(A,TABLE) ON(B,TABLE) ON(C,A) CLEAR(B) CLEAR(C) HANDEMPTY P: ON(B,A) ON(C,B) -: +:

  25. Open preconditions The plan is incomplete P: HOLDING(B) CLEAR(A) -: CLEAR(A) HOLDING(B) +: ON(B,A) CLEAR(B) HANDEMPTY Stack(B,A) P: -: +: ON(A,TABLE) ON(B,TABLE) ON(C,A) CLEAR(B) CLEAR(C) HANDEMPTY P: ON(B,A) ON(C,B) -: +:

  26. P: HOLDING(B) CLEAR(A) -: CLEAR(A) HOLDING(B) +: ON(B,A) CLEAR(B) HANDEMPTY Stack(B,A) Stack(C,B) P: -: +: ON(A,TABLE) ON(B,TABLE) ON(C,A) CLEAR(B) CLEAR(C) HANDEMPTY P: ON(B,A) ON(C,B) -: +: P: HOLDING(C) CLEAR(B) -: CLEAR(B) HOLDING(C) +: ON(C,B) CLEAR(C) HANDEMPTY

  27. Stack(B,A) Nonlinear planning searches a plan space Stack(C,B) P: -: +: ON(A,TABLE) ON(B,TABLE) ON(C,A) CLEAR(B) CLEAR(C) HANDEMPTY P: ON(B,A) ON(C,B) -: +: Pickup(C)

  28. Other possibleachiever Achievers Threat Pickup(B) Stack(B,A) Stack(C,B) P: -: +: ON(A,TABLE) ON(B,TABLE) ON(C,A) CLEAR(B) CLEAR(C) HANDEMPTY P: ON(B,A) ON(C,B) -: +: P: CLEAR(B) Pickup(C)

  29. Pickup(B) P: CLEAR(B) Stack(B,A) Stack(C,B) P: -: +: ON(A,TABLE) ON(B,TABLE) ON(C,A) CLEAR(B) CLEAR(C) HANDEMPTY P: ON(B,A) ON(C,B) -: +: P: CLEAR(B) Pickup(C)

  30. Pickup(B) A consistent plan is one in whichthere is no cycle and no conflictbetween achievers and threats A conflict can be eliminatedby constraining the orderingamong the actions or by adding new actions Stack(B,A) Stack(C,B) P: -: +: ON(A,TABLE) ON(B,TABLE) ON(C,A) CLEAR(B) CLEAR(C) HANDEMPTY P: ON(B,A) ON(C,B) -: +: Note the similarity withconstraint propagation Pickup(C)

  31. Pickup(B) P: HANDEMPTY Stack(B,A) Stack(C,B) P: -: +: ON(A,TABLE) ON(B,TABLE) ON(C,A) CLEAR(B) CLEAR(C) HANDEMPTY P: ON(B,A) ON(C,B) -: +: Pickup(C)

  32. Pickup(B) P: HANDEMPTY Stack(B,A) Stack(C,B) P: -: +: ON(A,TABLE) ON(B,TABLE) ON(C,A) CLEAR(B) CLEAR(C) HANDEMPTY P: ON(B,A) ON(C,B) -: +: Pickup(C) P: HANDEMPTY

  33. ~ Most-constrained-variableheuristic in CSP choose the unachieved precondition that can be satisfied in the fewest number of ways  ON(C,TABLE) Pickup(B) P: HANDEMPTYCLEAR(B)ON(B,TABLE) Stack(B,A) P: HOLDING(B) CLEAR(A) Stack(C,B) P: -: +: ON(A,TABLE) ON(B,TABLE) ON(C,A) CLEAR(B) CLEAR(C) HANDEMPTY P: ON(B,A) ON(C,B) -: +: P: HOLDING(C) CLEAR(B) Pickup(C) P: HANDEMPTYCLEAR(C)ON(C,TABLE)

  34. Pickup(B) Stack(B,A) Stack(C,B) P: -: +: ON(A,TABLE) ON(B,TABLE) ON(C,A) CLEAR(B) CLEAR(C) HANDEMPTY P: ON(B,A) ON(C,B) -: +: Pickup(C) Putdown(C)

  35. Pickup(B) Stack(B,A) Stack(C,B) P: -: +: ON(A,TABLE) ON(B,TABLE) ON(C,A) CLEAR(B) CLEAR(C) HANDEMPTY P: ON(B,A) ON(C,B) -: +: Unstack(C,A) Pickup(C) Putdown(C)

  36. Pickup(B) P: HANDEMPTY Stack(B,A) Stack(C,B) P: -: +: ON(A,TABLE) ON(B,TABLE) ON(C,A) CLEAR(B) CLEAR(C) HANDEMPTY P: ON(B,A) ON(C,B) -: +: Unstack(C,A) Pickup(C) Putdown(C)

  37. Pickup(B) Stack(B,A) Stack(C,B) P: -: +: ON(A,TABLE) ON(B,TABLE) ON(C,A) CLEAR(B) CLEAR(C) HANDEMPTY P: ON(B,A) ON(C,B) -: +: Unstack(C,A) Pickup(C) Putdown(C)

  38. Pickup(B) P: HANDEMPTYCLEAR(B)ON(B,TABLE) The plan is complete because every precondition of every step is addedby some previous step, and no intermediate step deletes it Stack(B,A) P: HOLDING(B) CLEAR(A) P: HANDEMPTY CLEAR(C) ON(C,A) Stack(C,B) P: -: +: ON(A,TABLE) ON(B,TABLE) ON(C,A) CLEAR(B) CLEAR(C) HANDEMPTY P: ON(B,A) ON(C,B) -: +: Unstack(C,A) P: HOLDING(C) CLEAR(B) Pickup(C) Putdown(C) P: HANDEMPTYCLEAR(C)ON(C,TABLE) P: HOLDING(C)

  39. Applications of Planning • Military operations • Construction tasks • Machining tasks • Mechanical assembly • Design of experiments in genetics • Command sequences for satellite Most applied systems use extended representation languages, nonlinear planning techniques, and domain-specificheuristics

  40. Summary • Representations in planning • Representation of action: preconditions + effects • Forward planning • Regression of a goal • Backward planning • Nonlinear planning

More Related