partial order plan execution
DESCRIPTION
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). - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/1.jpg)
Partial Order Plan Execution
1
Brian C. Williams
16.412J/6.834J
Sept. 16th, 2002Slides with help from:Dan Weld Stuart Russell & Peter Norvig
![Page 2: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/2.jpg)
Outline• Plan execution
• Plan monitoring
![Page 3: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/3.jpg)
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 stepwhen all predecessorshave been executed.
![Page 4: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/4.jpg)
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 stepwhen all predecessorshave been executed.
![Page 5: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/5.jpg)
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 stepwhen all predecessorshave been executed.
Execution
![Page 6: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/6.jpg)
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 stepwhen all predecessorshave been executed.
Execution
![Page 7: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/7.jpg)
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 stepwhen all predecessorshave been executed.
Execution
![Page 8: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/8.jpg)
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 stepwhen all predecessorshave been executed.
Execution
![Page 9: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/9.jpg)
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 stepwhen all predecessorshave been executed.
Execution
![Page 10: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/10.jpg)
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 stepwhen all predecessorshave been executed.
Execution
![Page 11: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/11.jpg)
Plan Execution
Initialize the agenda, called Ready, with action StartMark 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.
![Page 12: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/12.jpg)
Outline• Partial order planning in a nutshell
• Plan execution
• Plan monitoring
![Page 13: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/13.jpg)
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
![Page 14: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/14.jpg)
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.
![Page 15: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/15.jpg)
Plan Execution with Action Monitoring
Initialize the agenda, called Ready, with action StartMark 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.
![Page 16: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/16.jpg)
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.)
ExecutionMonitoring• Check if precondition of remaining plan is violated.
•Check if causal link crossing current time is violated.
![Page 17: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/17.jpg)
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.)
ExecutionMonitoring• Check if precondition of remaining plan is violated.
•Check if causal link crossing current time is violated.
![Page 18: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/18.jpg)
Plan Execution with Execution Monitoring
Initialize agenda Ready with action StartInitialize agenda ActiveLinks to emptyMark 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
• …
![Page 19: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/19.jpg)
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.
![Page 20: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/20.jpg)
Outline• Plan execution
• Plan monitoring
![Page 21: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/21.jpg)
Monitors
Autonomous Agents: What is missing?
Command dispatchFault protectionAttitude control
Mission Goal Scenario
Self-commandingSelf-commandingSelf-diagnosingSelf-diagnosingSelf-repairingSelf-repairing
RECOVERY
PLA
NN
ING
EX
EC
UTIO
N
![Page 22: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/22.jpg)
Outline• Plan execution
• Plan monitoring
• Appendix: Partial order planning in a nutshell
![Page 23: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/23.jpg)
Simple Operator-based Planning• Input
– Initial state of world– Goal
• partial state
– Operators (actions)• Fn: world-stateworld-state
• Output– Sequence of actions
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
a
aa
north11 north12
W0 W2W1
![Page 24: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/24.jpg)
STRIPS Representation
• Effects specify how to change the set of propositions.
a anorth11
W0 W1
• 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
![Page 25: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/25.jpg)
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
![Page 26: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/26.jpg)
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 si < sj and sj < si.)
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.)
![Page 27: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/27.jpg)
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
![Page 28: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/28.jpg)
POP(<A,O,L>, agenda, actions)1. Termination: If agenda is empty, return plan <A,O,L>.
2. Goal Selection: select and remove open condition <p, aneed > from agenda.
3. Action Selection: Choose new or existing action aadd that can precede aneed and whose effects include p. Link and order actions.
4. Update Agenda: If aadd is new, add preconditions to agenda.
5. Threat Detection: For every action athreat that might threaten some causal link from aproduce to aconsume, choose a consistent ordering:
a) Demotion: Add athreat < aproduce
b) Promotion: Add aconsume < athreat
6. Recurse: on modified plan and agendaChoose is nondeterministic Select is deterministic
![Page 29: Partial Order Plan Execution](https://reader035.vdocuments.site/reader035/viewer/2022081502/56815b13550346895dc8bf52/html5/thumbnails/29.jpg)
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)