Temporal Planning, Scheduling and Execution Brian C. Williams 16.412J/6.834J November 25th, 2002 1
Cassini Saturn Orbital Insertion courtesy JPL
Programming& Execution Histories(?) Goals Projective Task Expansion Temporal Planner Scheduler Flexible Sequence (Plans) Task Dispatch Plan Runner Goals Modes Model-based Programming& Execution Task-Decomposition Execution Reactive Task Expansion Observations Commands
Outline Temporal Planning Representing Time Temporal Consistency and Scheduling Execution with Dynamic Scheduling
Flexible Sequence (Plans) Histories(?) Goals Projective Task Expansion Temporal Planner Scheduler Flexible Sequence (Plans) Task Dispatch Plan Runner Goals Modes Model-based Execution (w planner) Task-Decomposition Execution Reactive Task Expansion Observations Commands
Flexible Sequence (Plans) Histories(?) Goals Projective Task Expansion Temporal Planner Scheduler Flexible Sequence (Plans) Task Dispatch Plan Runner Goals Modes Model-based Execution (w planner) Task-Decomposition Execution Reactive Task Expansion Observations Commands
Outline Temporal Planning Representing Time Temporal Consistency and Scheduling Execution with Dynamic Scheduling
Qualitative Temporal Constraints (Allen 83) x before y x meets y x overlaps y x during y x starts y x finishes y x equals y y after x y met-by x y overlapped-by x y contains x y started-by x y finished-by x y equals x X Y X Y X Y Y X X Y Y X Y X
Deep Space One Example: Temporal Constraints Timer Idle Max_Thrust Idle Th_Seg contained_by equals meets Start_Up Shut_Down Thr_Boundary Thrust Standby Th_Sega Idle_Seg Accum_NO_Thr Accum_Thr CP(Ips_Tvc) SEP_Segment Accum SEP Action Attitude Poke
Qualitative Temporal Constraints maybe Expressed as Inequalities (Vilain, Kautz 86) x before y X+ < Y- x meets y X+ = Y- x overlaps y (Y- < X+) & (X- < Y+) x during y (Y- < X-) & (X+ < Y+) x starts y (X- = Y-) & (X+ < Y+) x finishes y (X- < Y-) & (X+ = Y+) x equals y (X- = Y-) & (X+ = Y+)
Metric Time: Quantitative Temporal Constraint Networks (Dechter, Meiri, Pearl 91) A set of time points Xi at which events occur. Unary constraints (a0 < Xi < b0 ) or (a1 < Xi < b1 ) or . . . Binary constraints (a0 < Xj - Xi < b0 ) or (a1 < Xj - Xi < b1 ) or . . .
Visualize TCSP as Directed Constraint Graph 1 3 4 2 [10,20] [30,40] [60,inf] [20,30] [40,50] [60,70]
Simple Temporal Networks (Dechter, Meiri, Pearl 91) A set of time points Xi at which events occur. Unary constraints (a0 < Xi < b0 ) or (a1 < Xi < b1 ) or . . . Binary constraints (a0 < Xj - Xi < b0 ) or (a1 < Xj - Xi < b1 ) or . . . Sufficient to represent: most Allen relations simple metric constraints Can’t represent: Disjoint tokens
Simple Temporal Network Tij = (aij£ Xi - Xj £ bij) 1 3 4 2 [10,20] [30,40] [60,inf] [20,30] [40,50] [60,70]
A Completed Plan Forms an STN
TCSP Queries (Dechter, Meiri, Pearl, AIJ91) Is the TCSP consistent? What are the feasible times for each Xi? What are the feasible durations between each Xi and Xj? What is a consistent set of times? What are the earliest possible times? What are the latest possible times?
TCSP Queries (Dechter, Meiri, Pearl, AIJ91) Is the TCSP consistent? Planning What are the feasible times for each Xi? What are the feasible durations between each Xi and Xj? What is a consistent set of times? What are the earliest possible times? Execution What are the latest possible times?
Outline Temporal Planning Representing Time Temporal Consistency and Scheduling Execution with Dynamic Scheduling
To Query STN Map to Distance Graph Gd = < V,Ed > Edge encodes an upper bound on distance to target from source. Xj - Xi £ bij Xi - Xj £ - aij Tij = (aij£ Xj - Xi £ bij) 1 3 4 2 [10,20] [30,40] [40,50] [60,70] 70 1 3 4 2 20 50 -10 40 -30 -40 -60
Induced Constraints for Gd Path constraint: i0 =i, i1 = . . ., ik = j Intersected path constraints: where dij is the shortest path from i to j
Compute Intersected Paths by All Pairs Shortest Path (e. g Compute Intersected Paths by All Pairs Shortest Path (e.g., Floyd-Warshall’s algorithm ) 1. for i := 1 to n do dii 0; 2. for i, j := 1 to n do dij aij; 3. for k := 1 to n do 4. for i, j := 1 to n do 5. dij min{dij, dik + dkj}; k i j
Shortest Paths of Gd 70 1 2 4 3 20 50 -10 40 -30 -40 -60 d-graph
STN Minimum Network d-graph STN minimum network
Test Consistency: No Negative Cycles 70 1 2 4 3 20 50 -10 40 -30 -40 -60 d-graph
Latest Solution 20 40 1 2 -10 -30 -10 20 50 3 4 -40 -60 70 d-graph Node 0 is the reference. 20 40 1 2 -10 -30 -10 20 50 3 4 -40 -60 70 d-graph
Earliest Solution 20 40 1 2 -10 -30 -10 20 50 3 4 -40 -60 70 d-graph Node 0 is the reference. 20 40 1 2 -10 -30 -10 20 50 3 4 -40 -60 70 d-graph
Feasible Values X1 in [10, 20] X2 in [40, 50] X3 in [20, 30] d-graph
Solution by Decomposition Select value for 1 15 [10,20] d-graph
Solution by Decomposition Select value for 1 15 Select value for 2, consistent with 1 45 [40,50], 15+[30,40] d-graph
Solution by Decomposition Select value for 1 15 Select value for 2, consistent with 1 45 Select value for 3, consistent with 1 & 2 30 [20,30], 15+[10,20],45+[-20,-10] d-graph
Solution by Decomposition Select value for 1 15 Select value for 2, consistent with 1 45 Select value for 3, consistent with 1 & 2 30 d-graph Select value for 4, consistent with 1,2 & 3 O(N2)
Outline Temporal Planning Representing Time Temporal Consistency and Scheduling Execution with Dynamic Scheduling