320 likes | 500 Views
Temporal Planning, Scheduling and Execution. Brian C. Williams 16.412J/6.834J November 25 th , 2002. 1. Cassini Saturn Orbital Insertion. courtesy JPL. Model-based Programming& Execution. Task-Decomposition Execution. Histories(?). Goals. Projective Task Expansion. Scheduler.
E N D
Temporal Planning,Scheduling and Execution Brian C. Williams 16.412J/6.834J November 25th, 2002 1
Cassini Saturn Orbital Insertion courtesy JPL
Model-based Programming& Execution Task-Decomposition Execution Histories(?) Goals Projective Task Expansion Scheduler Temporal Planner Flexible Sequence (Plans) Task Dispatch Plan Runner Goals Modes Reactive Task Expansion Commands Observations
Outline • Temporal Planning • Representing Time • Temporal Consistency and Scheduling • Execution with Dynamic Scheduling
Model-based Execution (w planner) Task-Decomposition Execution Histories(?) Goals Projective Task Expansion Scheduler Temporal Planner Flexible Sequence (Plans) Task Dispatch Plan Runner Goals Modes Reactive Task Expansion Commands Observations
Model-based Execution (w planner) Task-Decomposition Execution Histories(?) Goals Projective Task Expansion Scheduler Temporal Planner Flexible Sequence (Plans) Task Dispatch Plan Runner Goals Modes Reactive Task Expansion Commands Observations
Outline • Temporal Planning • Representing Time • Temporal Consistency and Scheduling • Execution with Dynamic Scheduling
Qualitative Temporal Constraints(Allen 83) • 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 before y • x meets y • x overlaps y • x during y • x starts y • x finishes y • x equals y X Y X Y X Y Y X Y X Y X Y X
contained_by Idle_Seg Th_Sega Th_Seg Th_Seg Idle_Seg Th_Seg Th_Seg contained_by contained_by Accum_Thr Accum_Thr Accum_Thr Thr_Boundary Accum_NO_Thr Thr_Boundary equals equals meets meets Thrust Thrust Standby Thrust Thrust Standby Standby Start_Up Start_Up contained_by Shut_Down Shut_Down CP(Ips_Tvc) CP(Ips_Tvc) CP(Ips_Tvc) Deep Space One Example:Temporal Constraints Timer Max_Thrust Idle Idle SEP_Segment Accum SEP Action Attitude Poke
Qualitative Temporal Constraintsmaybe 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 . . .
[30,40] [10,20] [60,inf] 0 1 3 [10,20] 2 4 [20,30] [40,50] [60,70] Visualize TCSP asDirected Constraint Graph
Simple Temporal Networks(Dechter, Meiri, Pearl 91) Simple Temporal Network: • 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
[30,40] [10,20] [60,inf] 0 1 3 [10,20] 2 4 [20,30] [40,50] [60,70] Simple Temporal Network • Tij = (aij£ Xi - Xj£ bij)
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
20 40 0 1 3 -10 [10,20] -30 [30,40] 0 1 3 -10 20 [10,20] 50 2 4 -40 2 4 -60 [40,50] 70 [60,70] To Query STN Map toDistance 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)
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 Pathsby 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
20 40 0 1 2 -10 -30 -10 20 50 3 4 -40 -60 70 d-graph Shortest Paths of Gd
STN Minimum Network d-graph STN minimum network
20 40 0 1 2 -10 -30 -10 20 50 3 4 -40 -60 70 Test Consistency: No Negative Cycles d-graph
Latest Solution Node 0 is the reference. 20 40 0 1 2 -10 -30 -10 20 50 3 4 -40 -60 70 d-graph
Earliest Solution Node 0 is the reference. 20 40 0 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] • X4 in [60, 70] 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
O(N2) 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
Outline • Temporal Planning • Representing Time • Temporal Consistency and Scheduling • Execution with Dynamic Scheduling