770 likes | 944 Views
Temporal Plan Execution: Dynamic Scheduling and Simple Temporal Networks. Brian C. Williams 16.412J/6.834J December 2 nd , 2002. 1. Model-based Programming& Execution. Task-Decomposition Execution. Goals and Environment Constraints. Projective Task Expansion. Temporal
E N D
Temporal Plan Execution: Dynamic Scheduling and Simple Temporal Networks Brian C. Williams 16.412J/6.834J December 2nd, 2002 1
Model-based Programming& Execution Task-Decomposition Execution Goals and Environment Constraints Projective Task Expansion Temporal NetworkSolver Temporal Planner Temporal Plan Task Dispatch Dynamic Scheduling and Task Dispatch Goals Modes Reactive Task Expansion Commands Observations
Model-based Programming& Execution Task-Decomposition Execution Goals and Environment Constraints Projective Task Expansion Temporal NetworkSolver Temporal Planner Temporal Plan Task Dispatch Dynamic Scheduling and Task Dispatch Goals Modes Reactive Task Expansion Commands Observations
Outline • Temporal Representation • Qualitative temporal relations • Metric constraints • Temporal Constraint Networks • Temporal Plans • Temporal Reasoning forPlanning and Scheduling • Flexible Execution throughDynamic 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) Example: Deep Space One Remote Agent Experiment 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+) Inequalities may be expressed as binary interval relations: X+ - Y-< [-inf, 0]
Metric Constraints • Going to the store takes at least 10 minutes and at most 30 minutes. • 10 < [T+(store) – T-(store)] < 30 • Bread should be eaten within a day of baking. • 0 < [T+(baking) – T-(eating)] < 1 day • Inequalities, X+ < Y- , may be expressed as binary interval relations: • - inf < [X+ - Y-] < 0
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] TCSP Are Visualized UsingDirected Constraint Graphs
Simple Temporal Networks(Dechter, Meiri, Pearl 91) Simple Temporal Networks: • 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
Outline • Temporal Representation • Temporal Reasoning forPlanning and Scheduling • TCSP Queries • Induced Constraints • Plan Consistency • Static Scheduling • Flexible Execution throughDynamic Scheduling
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?Scheduling • What are the earliest possible times? Scheduling • What are the latest possible times?
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 an STN Map to aDistance 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)
Gd Induces Constraints • Path constraint: i0 =i, i1 = . . ., ik = j • Conjoined path constraints result in the shortest path as bound: where dij is the shortest path from i to 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
Conjoined Paths are Computed using 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 Testing Plan Consistency No negative cycles: -5 > TA– TA = 0 d-graph
Scheduling:Feasible Values Latest Times • X1 in [10, 20] • X2 in [40, 50] • X3 in [20, 30] • X4 in [60, 70] Earliest Times d-graph
Scheduling without Search: Solution by Decomposition • Select value for 1 • 15 [10,20] d-graph
Scheduling without Search: 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[45,50] d-graph
Solution by Decomposition • Select value for 1 • 15 • Select value for 2, consistent with 1 • 45[45,50] 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[25,30] 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[25,30] 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 Representation • Temporal Reasoning forPlanning and Scheduling • Flexible Execution throughDynamic Scheduling
Model-based Programming& Execution Task-Decomposition Execution Goals and Environment Constraints Projective Task Expansion Temporal NetworkSolver Temporal Planner Temporal Plan Task Dispatch Dynamic Scheduling and Task Dispatch Goals Modes Reactive Task Expansion Commands Observations
EXECUTIVE CONTROLLED SYSTEM Executing Flexible Temporal Plans[Muscettola, Morris, Pell et al.] • Handling delays and fluctuations in task duration: • Least commitment temporal plans leave room to adapt • flexible execution adapts through dynamic scheduling • Assigns time to event when executed.
Issues in Flexible Execution • How do we minimize execution latency? • How do we schedule at execution time?
Time Propagation Can Be Costly EXECUTIVE CONTROLLED SYSTEM
Time Propagation Can Be Costly EXECUTIVE CONTROLLED SYSTEM
Time Propagation Can Be Costly EXECUTIVE CONTROLLED SYSTEM
Time Propagation Can Be Costly EXECUTIVE CONTROLLED SYSTEM
Time Propagation Can Be Costly EXECUTIVE CONTROLLED SYSTEM
Time Propagation Can Be Costly EXECUTIVE CONTROLLED SYSTEM
Issues in Flexible Execution • How do we minimize execution latency? • Propagate through a small set of neighboring constraints. • How do we schedule at execution time?
Compile to Efficient Network EXECUTIVE CONTROLLED SYSTEM
Compile to Efficient Network EXECUTIVE CONTROLLED SYSTEM
Compile to Efficient Network EXECUTIVE CONTROLLED SYSTEM
Issues in Flexible Execution • How do we minimize execution latency? • Propagate through a small set of neighboring constraints. • How do we schedule at execution time?
Issues in Flexible Execution • How do we minimize execution latency? • Propagate through a small set of neighboring constraints. • How do we schedule at execution time? • Through decomposition?
[0,10] [-1,1] 10 -1 A D D A B C B C 0 1 [0,10] [-2,2] 0 -2 Equivalent Distance Graph Representation 2 10 Dynamic Scheduling by Decomposition Simple Example
11 10 -1 0 10 1 -1 -1 1 A D D A C B C B 0 -2 0 1 Equivalent All Pairs Shortest Paths (APSP) Representation 2 0 -2 10 -2 2 10 Dynamic Scheduling by Decomposition • Compute APSP graph • Decomposition enables assignment without search Equivalent Distance Graph Representation