Beruflich Dokumente
Kultur Dokumente
Outline
Time and resources Optimal and satiscing plans Scheduling actions PDDL 2.1 Integrating planning and scheduling
Time
In classical planning we assumed that actions are instantaneous Action preconditions must hold before the action is executed and the eects of the action persist indenitely Many planning domains are more complex: actions take time to executehow long an action takes to execute may depend on the preconditions preconditions may need to hold when the action begins, or throughout the execution of the action eects may not be true immediately and their eects may persist for only a limited timean action can have multiple eects on a uent at dierent times
Examples
Example: if I need a laptop in order to write a lecture, I need to continue to have the laptop while I am writing the lecture (I cant lend it to a friend) Example: if I push the lift button, the lift may take time to arrive, and when it does the door will remain open for only a limited time In some cases, actions have to be performed concurrently Example: if a fuse blows, I have to strike a match and walk to the fusebox while the match is burning When planning with time, we usually want a goal to be true at or before a given time, or over a given interval
Resources
Time is a particular instance of a resource A resource is any quantity or (set of) object(s) whose value or availability determines whether an action can be executed Examples: money, electrical power, equipment, vehicles, etc. Resources may be consumable (examples: money, fuel) or reusable (example: a car which becomes available again after a trip) In some cases, actions may produce resources (examples: refueling, hiring more sta etc) When planning with resources, a solution is dened as a plan that achieves the goals while allocating resources to actions so that all resource constraints are satised Many planners (and PDDL) treat time as a special case
Scheduling actions
One approach is to plan rst and schedule later Split the overall problem into: a planning phase in which actions are selected and partially ordered to achieve the goal(s); and a scheduling phase in which temporal information is added to the plan to ensure it meets resource and deadline constraints Assumes that plans have minimal ordering constraints required for correctness (e.g., as produced by partial order planning)
Temporal constraints
To minimise the plan duration, we must nd the earliest start times for all actions consistent with the ordering constraints in the plan We can use the critical path method to nd the possible start and end times for each action A path through a partially ordered plan is a linearly ordered sequence of actions beginning with Start and ending with F inish The critical path is the path with the longest total duration Actions not on the critical path have a window of time in which the can be executed: LS ES is known as the slack for the action (ES earliest possible start time, LS latest possible start time) Together the ES and LS times for all the actions constitute a schedule for the problem
10
11
[0, 0] AddEngine2 60
12
AddWheels1
AddEngine1
Inspect1
AddEngine2
Inspect2
AddWheels2
10
20
30
40
50
60
70
80
90
13
Resource constraints
Critical path problems are easy to solve because they are dened by a conjunction of linear inequalities on start and end times Any action can be executed in parallel with any other unless this is prohibited by the partial order specied in the plan Resource constraints impose additional restrictions on the ordering of actions not explicitly present in the original planactions which require the same resources cant be executed at the same time Problem is now dened by a disjunction of linear inequalities Scheduling with resource constraints is NP-hard
14
EngineHoists(1)
AddEngine1
AddEngine2
WheelStations(1)
AddWheels1
AddWheels2
Inspectors(2)
Inspect1
Inspect2
10
20
30
40
50
60
70
80
90
100
110
120
15
16
17
PDDL domain le
Domain les look like this: (define (domain <domain name>) <PDDL code for predicates> <PDDL code for first action> [...] <PDDL code for last action> )
18
PDDL problem le
(define (problem <problem name>) (:domain <domain name>) <PDDL code for objects> <PDDL code for initial state> <PDDL code for goal specification> )
19
PDDL 2.1
Extends simple PDDL with time and resources Actions Can have xed or variable duration Preconditions can be at start or over all (throughout the duration) Eects can be at start or at end and can update resources either at the start or end of the action, or continuously during the execution of the action Goals Achievement goals are specied by a list pi, ti where ti is the time by which pi should hold Persist goals are specied by a condition and an interval over which it should hold
20
21
22
23
24
Translation...
An action of pouring from jug1 into jug2: P our(j1, j2): Precond: Effect: Capacity(j2) Amount(j2) Amount(j1) Amount(j1) = 0 Amount(j2) = Amount(j2) + Amount(j1)
25
26
27
28
29
30
31
32
33
Next lecture
Hierarchical planning Russell and Norvig 3rd edition Section 11.2 Russell and Norvig 2nd edition Section 12.2
34