1 / 29

Partial Order Plan Execution

Partial Order Plan Execution. Brian C. Williams 16.412J/6.834J Sept. 16 th , 2002. Slides with help from: Dan Weld Stuart Russell & Peter Norvig. 1. Outline. Plan execution Plan monitoring. Start. At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.). At(Home). Go(HWS).

haamid
Download Presentation

Partial Order Plan Execution

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. Partial Order Plan Execution Brian C. Williams 16.412J/6.834J Sept. 16th, 2002 Slides with help from: Dan Weld Stuart Russell & Peter Norvig 1

  2. Outline • Plan execution • Plan monitoring

  3. Start At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) At(Home) Go(HWS) At(HWS) Sells(HWS,Drill) Buy(Drill) At(HWS) Go(SM) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.) Buy(Milk) Buy(Ban.) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish Execution Can perform a stepwhen all predecessorshave been executed.

  4. Execution Start At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) Can perform a stepwhen all predecessorshave been executed. At(Home) Go(HWS) At(HWS) Sells(HWS,Drill) Buy(Drill) At(HWS) Go(SM) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.) Buy(Milk) Buy(Ban.) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish

  5. Execution Start At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) Can perform a stepwhen all predecessorshave been executed. At(Home) Go(HWS) At(HWS) Sells(HWS,Drill) Buy(Drill) At(HWS) Go(SM) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.) Buy(Milk) Buy(Ban.) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish

  6. Execution Start At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) Can perform a stepwhen all predecessorshave been executed. At(Home) Go(HWS) At(HWS) Sells(HWS,Drill) Buy(Drill) At(HWS) Go(SM) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.) Buy(Milk) Buy(Ban.) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish

  7. Execution Start At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) Can perform a stepwhen all predecessorshave been executed. At(Home) Go(HWS) At(HWS) Sells(HWS,Drill) Buy(Drill) At(HWS) Go(SM) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.) Buy(Milk) Buy(Ban.) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish

  8. Execution Start At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) Can perform a stepwhen all predecessorshave been executed. At(Home) Go(HWS) At(HWS) Sells(HWS,Drill) Buy(Drill) At(HWS) Go(SM) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.) Buy(Milk) Buy(Ban.) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish

  9. Execution Start At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) Can perform a stepwhen all predecessorshave been executed. At(Home) Go(HWS) At(HWS) Sells(HWS,Drill) Buy(Drill) At(HWS) Go(SM) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.) Buy(Milk) Buy(Ban.) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish

  10. Execution Start At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) Can perform a stepwhen all predecessorshave been executed. At(Home) Go(HWS) At(HWS) Sells(HWS,Drill) Buy(Drill) At(HWS) Go(SM) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.) Buy(Milk) Buy(Ban.) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish

  11. Plan Execution Initialize the agenda, called Ready, with action Start Mark all actions as not executed. Loop • If Ready is empty then terminate. • Dequeue action a from Ready and execute • When completed, mark a as executed. • For each action b such that a < b or linked(a,b,p). • If every action c is marked executed, such that c < b or linked(c,b,p’) • Then queue b on Ready.

  12. Outline • Partial order planning in a nutshell • Plan execution • Plan monitoring

  13. Action Monitoring Start At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) Fail if preconditions of ready action are not satisfied. At(Home) Go(HWS) At(HWS) Sells(HWS,Drill) Buy(Drill) At(HWS) Go(SM) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.) Buy(Milk) Buy(Ban.) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish

  14. Action Monitoring Start At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) Fail if preconditions of ready action are not satisfied. At(Home) Go(HWS) At(HWS) Sells(HWS,Drill) Buy(Drill) At(HWS) Go(SM) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.) Buy(Milk) Buy(Ban.) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish

  15. Plan Execution with Action Monitoring Initialize the agenda, called Ready, with action Start Mark all actions as not executed. Loop • If Ready is empty then terminate. • Dequeue action a from ready • If preconditions of action are satisfied • Then execute • Else return failure • When completed, mark a as executed. • For each action b such that a < b or linked(a,b,p). • If every action c has been executed, such that c < b or linked(c,b,p’) • Then queue b on Ready.

  16. Start ExecutionMonitoring At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) • Check if precondition of remaining plan is violated. • Check if causal link crossing current time is violated. At(Home) Go(HWS) At(HWS) Sells(HWS,Drill) Buy(Drill) At(HWS) Go(SM) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.) Buy(Milk) Buy(Ban.) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish

  17. Start ExecutionMonitoring At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) • Check if precondition of remaining plan is violated. • Check if causal link crossing current time is violated. At(Home) Go(HWS) At(HWS) Sells(HWS,Drill) Buy(Drill) At(HWS) Go(SM) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.) Buy(Milk) Buy(Ban.) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish

  18. Plan Execution with Execution Monitoring Initialize agenda Ready with action Start Initialize agenda ActiveLinks to empty Mark all actions as not executed. Loop • If Ready is empty then terminate. • For each link on ActiveLinks • If the condition of link doesn’t hold, Then return failure • Dequeue action a from Ready • If preconditions of action are satisfied • Then execute • Else return failure • …

  19. Plan Execution with Execution Monitoring (cont). Loop • … • Mark a as executed. • For each action c such that linked(c,a,p). • dequeue <c,a,p> from ActiveLinks. • For each action d such that linked(a,d,p). • queue <a,d,p> on ActiveLinks. • For each action b such that a < b or linked(a,b,p). • If every action c has been executed, such that c <b or linked(c,b,p’) • Then queue b on Ready.

  20. Outline • Plan execution • Plan monitoring

  21. Autonomous Agents: What is missing? EXECUTION PLANNING RECOVERY Command dispatch Fault protection Attitude control Self-commanding Self-diagnosing Self-repairing Monitors Mission Goal Scenario

  22. Outline • Plan execution • Plan monitoring • Appendix: Partial order planning in a nutshell

  23. a north11 north12 a a W0 W1 W2 Simple Operator-based Planning • What assumptions areimplied? • Atomic time. • Agent is omniscient (no sensing necessary). • Agent is sole cause of change. • Actions have deterministic effects. • No indirect effects. • STRIPS Assumptions • Input • Initial state of world • Goal • partial state • Operators (actions) • Fn: world-stateworld-state • Output • Sequence of actions

  24. precond: (and (agent-at 1 1) (agent-facing north)) north11 North11 a a effect: (and (agent-at 1 2) (not (agent-at 1 1))) W1 W0 STRIPS Representation • Initial state: • ((block a) (block b) (block c) (on-table a) (on-table b) (clear a) (clear b) (clear c) (arm-empty)) • goal (partial state): • ((on a b) (on b c))) • Available actions • Strips operators • Effects specify how to change the set of propositions.

  25. Note: strips doesn’t allow derived effects; you must be complete! } Action Schemata • Instead of defining: pickup-A and pickup-B and … • Define a schema: ?var denotes a free variable (:operatorpick-up :parameters ((block ?ob1)) :precondition (and (clear ?ob1) (on-table ?ob1) (arm-empty)) :effect (and (not (clear ?ob1)) (not (on-table ?ob1)) (not (arm-empty)) (holding ?ob1)))

  26. A Solution: Complete and Consistent Plan Start • IFF every precondition of every step is achieved • A step’s precondition is achieved iff • its the effect of a preceding step, • no possibly intervening step undoes it. • IFF there is no contradiction in the ordering constraints(I.e., never si < sj and sj < si.) At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) • Complete Plan • Consistent Plan At(Home) Go(HWS) At(HWS) Sells(HWS,Drill) Buy(Drill) At(HWS) Go(SM) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.) Buy(Milk) Buy(Ban.) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish

  27. POP(<A,O,L>, agenda, actions) • <A,O,L>, A partial plan to expand • Agenda: A queue of open conditions still to be satisfied: <p, aneed > • Actions: A set of actions that may be introduced to meet needs. • aadd: an action that produces the needed condition p for aneed • Athreat : an action that might threaten a causal link from aproducer to aconsumer

  28. POP(<A,O,L>, agenda, actions) • Termination: If agenda is empty, return plan <A,O,L>. • Goal Selection: select and remove open condition <p, aneed > from agenda. • Action Selection: Choose new or existing action aadd that can precede aneed and whose effects include p. Link and order actions. • Update Agenda: If aadd is new, add preconditions to agenda. • Threat Detection: For every action athreat that might threaten some causal link from aproduce to aconsume, choose a consistent ordering: • Demotion: Addathreat <aproduce • Promotion: Addaconsume <athreat • Recurse: on modified plan and agenda Choose is nondeterministic Select is deterministic

  29. At(SM) Go(Home) Start At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) At(x) At(Home) Go(SM) Go(HWS) At(HWS) Sells(HWS,Drill) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.) Buy(Drill) Buy(Milk) Buy(Ban.) Have(Drill) Have(Milk) Have(Ban.) at(Home) Finish

More Related