Presentation is loading. Please wait.

Presentation is loading. Please wait.

Partial Order Plan Execution 1 Brian C. Williams 16.412J/6.834J Sept. 16 th, 2002 Slides with help from: Dan Weld Stuart Russell & Peter Norvig.

Similar presentations


Presentation on theme: "Partial Order Plan Execution 1 Brian C. Williams 16.412J/6.834J Sept. 16 th, 2002 Slides with help from: Dan Weld Stuart Russell & Peter Norvig."— Presentation transcript:

1 Partial Order Plan Execution 1 Brian C. Williams 16.412J/6.834J Sept. 16 th, 2002 Slides with help from: Dan Weld Stuart Russell & Peter Norvig

2 Outline Plan execution Plan monitoring

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

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

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

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

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

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

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

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

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 Start Go(HWS) Go(Home) Finish Buy(Drill) Buy(Milk)Buy(Ban.) Go(SM) Have(Milk) At(Home) Have(Ban.) Have(Drill) At(SM), Sells(SM,Milk) At(SM) At(SM), Sells(SM,Ban.) At(Home) At(HWS) At(HWS) Sells(HWS,Drill) At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) Fail if preconditions of ready action are not satisfied. Action Monitoring

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

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 Go(HWS) Go(Home) Finish Buy(Drill) Buy(Milk)Buy(Ban.) Go(SM) Have(Milk) At(Home) Have(Ban.) Have(Drill) At(SM), Sells(SM,Milk) At(SM) At(SM), Sells(SM,Ban.) At(Home) At(HWS) At(HWS) Sells(HWS,Drill) At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) Execution Monitoring Check if precondition of remaining plan is violated. Check if causal link crossing current time is violated.

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

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 from ActiveLinks. For each action d such that linked(a,d,p). –queue 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 Monitors Autonomous Agents: What is missing? Command dispatch Fault protection Attitude control Mission Goal Scenario Self-commandingSelf-diagnosingSelf-repairing RECOVERY PLANNING EXECUTION

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

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

24 STRIPS Representation Effects specify how to change the set of propositions. a a north11 W0W0 W1W1 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 precond: (and (agent-at 1 1) (agent-facing north)) effect: (and (agent-at 1 2) (not (agent-at 1 1))) North11

25 Action Schemata (:operator pick-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))) Instead of defining: pickup-A and pickup-B and … Define a schema: Note: strips doesn’t allow derived effects; you must be complete! } ?var denotes a free variable

26 A Solution: Complete and Consistent Plan Complete Plan Consistent Plan 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 s i < s j and s j < s i.) Start Go(HWS) Go(Home) Finish Buy(Drill) Buy(Milk)Buy(Ban.) Go(SM) Have(Milk) At(Home) Have(Ban.) Have(Drill) At(SM), Sells(SM,Milk) At(SM) At(SM), Sells(SM,Ban.) At(Home) At(HWS) At(HWS) Sells(HWS,Drill) At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)

27 POP(, agenda, actions), A partial plan to expand Agenda: A queue of open conditions still to be satisfied: Actions: A set of actions that may be introduced to meet needs. a add : an action that produces the needed condition p for a need A threat : an action that might threaten a causal link from a producer to a consumer

28 POP(, agenda, actions) 1.Termination: If agenda is empty, return plan. 2.Goal Selection: select and remove open condition from agenda. 3.Action Selection: Choose new or existing action a add that can precede a need and whose effects include p. Link and order actions. 4.Update Agenda: If a add is new, add preconditions to agenda. 5.Threat Detection: For every action a threat that might threaten some causal link from a produce to a consume, choose a consistent ordering: a)Demotion: Add a threat < a produce b)Promotion: Add a consume < a threat 6.Recurse: on modified plan and agenda Choose is nondeterministic Select is deterministic

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


Download ppt "Partial Order Plan Execution 1 Brian C. Williams 16.412J/6.834J Sept. 16 th, 2002 Slides with help from: Dan Weld Stuart Russell & Peter Norvig."

Similar presentations


Ads by Google