Priced Timed Automata Optimal Scheduling Kim G. Larsen Aalborg University it DENMARK
Overview Timed Automata Scheduling Priced Timed Automata Optimal Reachability Optimal Infinite Scheduling Multi Objectives Energy Automata CLASSIC CORA TIGA ECDAR TRON SMC ARTIST Design PhD School, Beijing, 2011 Kim Larsen [2]
Real Time Scheduling Only 1 Pass Cheat is possible (drive close to car with Pass ) UNSAFE 5 10 Pass 20 25 SAFE CAN The THEY Car & MAKE Bridge IT Problem TO SAFE WITHIN 70 MINUTES??? ARTIST Design PhD School, Beijing, 2011 Kim Larsen [3]
Let us play! ARTIST Design PhD School, Beijing, 2011 Kim Larsen [4]
Real Time Scheduling Solve Scheduling Problem using UPPAAL UNSAFE 5 10 SAFE 20 25 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [5]
Resources & Tasks Resource Synchronization Task Shared variable ARTIST Design PhD School, Beijing, 2011 Kim Larsen [6]
Task Graph Scheduling Example A 1 B C D 2 Compute : (D ( C ( A B )) (( A B ) ( C D )) using 2 processors 4 3 4 C 5 D P1 6 P2 1 P1 (fast) P2 (slow) 2ps 3ps 5ps 7ps 5 10 15 20 25 2 3 5 6 4 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [7] time
Task Graph Scheduling Example A 1 B C D 2 Compute : (D ( C ( A B )) (( A B ) ( C D )) using 2 processors 3 4 C 5 D P1 P2 6 P1 (fast) P2 (slow) 2ps 3ps 5ps 7ps 5 10 15 20 25 1 3 5 4 6 2 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [8] time
Task Graph Scheduling Example A 1 B C D 2 Compute : (D ( C ( A B )) (( A B ) ( C D )) using 2 processors 3 4 C 5 D P1 P2 6 P1 (fast) P2 (slow) 2ps 3ps 5ps 7ps 5 10 15 20 25 1 3 5 4 6 2 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [9] time
Task Graph Scheduling Example A 1 B C D 2 Compute : (D ( C ( A B )) (( A B ) ( C D )) using 2 processors 3 4 C 5 D P1 P2 6 P1 (fast) P2 (slow) 2ps 3ps 5ps 7ps 5 10 15 20 25 1 3 5 4 6 2 E<> (Task1.End and and Task6.End) ARTIST Design PhD School, Beijing, 2011 Kim Larsen [10] time
Experimental Results Symbolic A Branch-&-Bound 60 sec Abdeddaïm, Kerbaa, Maler ARTIST Design PhD School, Beijing, 2011 Kim Larsen [11]
Priced Timed Automata
EXAMPLE: Optimal rescue plan for cars with different subscription rates for city driving! 5 Golf SAFE Citroen 10 9 2 20 25 BMW Datsun 3 10 OPTIMAL PLAN HAS ACCUMULATED COST=195 and TOTAL TIME=65! ARTIST Design PhD School, Beijing, 2011 Kim Larsen [13]
Experiments COST-rates G C B D SCHEDULE COST TIME #Expl #Pop d Min Time 1 1 1 1 9 2 3 10 1 2 3 4 1 2 3 10 1 20 30 40 CG> G< BD> C< CG> CG> G< BG> G< GD> GD> G< CG> G< BG> CG> G< BD> C< CG> CD> C< CB> C< CG> BD> B< CB> C< CG> 60 1762 1538 2638 55 65 252 378 195 65 149 233 140 60 232 350 170 65 263 408 975 1085 85 time<85 - - 0 0 0 0-0 - 406 447 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [14]
Task Graph Scheduling Revisited A 1 B C D 2 Compute : (D ( C ( A B )) (( A B ) ( C D )) using 2 processors 3 4 C 5 D P1 P2 6 P1 (fast) P2 (slow) Idle 2ps 3ps 1oW Idle 5ps 7ps 20W ENERGY: 5 10 In use 90W 30W 15 20 In use 25 1 3 5 4 6 2 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [15] time
Task Graph Scheduling Revisited A 1 B C D 2 Compute : (D ( C ( A B )) (( A B ) ( C D )) using 2 processors 3 4 C 5 D P1 P2 6 P1 (fast) P2 (slow) Idle 2ps 3ps 10W Idle 5ps 7ps 20W ENERGY: 5 10 In use 90W 30W 15 20 In use 25 1 3 4 2 5 6 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [16] time
Task Graph Scheduling Revisited A 1 B C D 2 Compute : (D ( C ( A B )) (( A B ) ( C D )) using 2 processors 3 4 C 5 D P1 P2 6 P1 (fast) P2 (slow) Idle 2ps 3ps 10W Idle 5ps 7ps 20W ENERGY: 5 10 In use 90W 30W 15 20 In use 25 1 3 4 2 5 6 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [17] time
A simple example ARTIST Design PhD School, Beijing, 2011 Kim Larsen [18]
A simple example Q: What is cheapest cost for reaching? ARTIST Design PhD School, Beijing, 2011 Kim Larsen [19]
Corner Point Regions THM [Behrmann, Fehnker..01] [Alur,Torre,Pappas 01] Optimal reachability is decidable for PTA THM [Bouyer, Brojaue, Briuere, Raskin 07] Optimal reachability is PSPACE-complete for PTA 3 0 3 0 0 0 0 0 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [20]
Priced Zones [CAV01] A zone Z: 1 x 2 Æ 0 y 2 Æ x - y 0 A cost function C C(x,y)= 2 x - 1 y 3 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [21]
Priced Zones Reset [CAV01] Z[x=0]: x=0 Æ 0 y 2 A zone Z: 1 x 2 Æ 0 y 2 Æ x - y 0 C = 1 y 3 C= -1 y 5 A cost function C C(x,y) = 2 x - 1 y 3 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [22]
Symbolic Branch & Bound Algorithm Z' Z Z is bigger & cheaper than Z is a well-quasi ordering which guarantees termination! ARTIST Design PhD School, Beijing, 2011 Kim Larsen [23]
Example: Aircraft Landing cost e(t-t) E dl(t-t) T L t E earliest landing time T target time L latest time e cost rate for being early l cost rate for being late d fixed cost for being late Planes have to keep separation distance to avoid turbulences caused by preceding planes ARTIST Design PhD School, Beijing, 2011 Kim Larsen [24] Runway
Example: Aircraft Landing x <= 5 x >= 4 x=5 4 earliest landing time land! cost=2 5 target time x <= 5 9 latest time x <= 9 cost =3 cost =1 3 cost rate for being early 1 cost rate for being late x=5 land! 2 fixed cost for being late Planes have to keep separation distance to avoid turbulences caused by preceding planes ARTIST Design PhD School, Beijing, 2011 Kim Larsen [25] Runway
Aircraft Landing Source of examples: Baesley et al 2000 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [26]
Symbolic Branch & Bound Algorithm Zone based Linear Programming Problems (dualize) Min Cost Flow ARTIST Design PhD School, Beijing, 2011 Kim Larsen [27]
Aircraft Landing (revisited) Using MCF/Netsimplex [TACAS04] ARTIST Design PhD School, Beijing, 2011 Kim Larsen [28]
Optimal Infinite Schedule ARTIST Design PhD School, Beijing, 2011 Kim Larsen [29]
EXAMPLE: Optimal WORK plan for cars with different subscription rates for city driving! Infor rmatio onstek knolog gi 5 10 20 25 Golf Citroen 9 2 BMW Datsun 3 10 maximal 100 min. at each location UCb
Workplan I Infor rmatio onstek knolog gi UCb Golf Citroen U U BMW Datsun U U Golf Citroen S U BMW Datsun (25) Golf Citroen U U BMW Datsun (25) 275 S S 275 (20) Golf Citroen U U BMW Datsun (25) Golf Citroen U U BMW Datsun U U (25) 300 Golf Citroen U S BMW Datsun S U 300 300 U U U S (20) 300 (25) 300 Golf Citroen U U BMW Datsun (25) Golf Citroen U S BMW Datsun U U 300 U S Value of workplan: (4 x 300) / 90 = 13.33
Workplan II Infor rmatio onstek knolog gi UCb Golf Citroen 25/125 Golf Citroen Golf Citroen Golf Citroen 5/25 20/180 BMW Datsun BMW Datsun BMW Datsun BMW Datsun Golf BMW Golf BMW Citroen Datsun 10/130 5/65 25/225 Citroen Datsun Value of workplan: 560 / 100 = 5.6 Golf Citroen BMW Datsun 25/125 Golf Citroen BMW Datsun 5/10 10/90 Golf Citroen BMW Datsun Golf Citroen Golf Citroen Golf Citroen 10/90 10/0 BMW Datsun BMW Datsun BMW Datsun 25/50 Golf Citroen BMW Datsun 5/10 10/0 Golf Citroen BMW Datsun
Optimal Infinite Scheduling Maximize throughput: i.e. maximize Reward / Time in the long run! ARTIST Design PhD School, Beijing, 2011 Kim Larsen [33]
Optimal Infinite Scheduling Minimize Energy Consumption: i.e. minimize Cost / Time in the long run ARTIST Design PhD School, Beijing, 2011 Kim Larsen [34]
Optimal Infinite Scheduling Maximize throughput: i.e. maximize Reward / Cost in the long run ARTIST Design PhD School, Beijing, 2011 Kim Larsen [35]
Mean Pay-Off Optimality Bouyer, Brinksma, Larsen: HSCC04,FMSD07 Accumulated cost c 3 c n c 1 c 2 r 3 r n r 1 r 2 BAD Accumulated reward Value of path : val( ) = lim n c n /r n Optimal Schedule : val( ) = inf val( ) ARTIST Design PhD School, Beijing, 2011 Kim Larsen [36]
Discount Optimality 1 : discounting factor Larsen, Fahrenberg: INFINITY 08 Cost of time t n ) c(t 3) c(t n ) c(t 1 ) c(t 2) t 1 t 2 t 3 t n BAD Time of step n Value of path : val( ) = Optimal Schedule : val( ) = inf val( ) ARTIST Design PhD School, Beijing, 2011 Kim Larsen [37]
Soundness of Corner Point Abstraction ARTIST Design PhD School, Beijing, 2011 Kim Larsen [38]
Application Dynamic Voltage Scaling Informationsteknologi UCb
Multiple Objective Scheduling 16,10 P 2 P 1 2,3 2,3 cost 1 ==4 cost 2 ==3 1 cost 2 6,6 10,16 P 6 P 3 P 4 Pareto Frontier P 7 P 5 2,22 8,2 4W 3W cost1 1 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [40]
Experimental Results Warehouse itunes ARTIST Design PhD School, Beijing, 2011 Kim Larsen [41]
Experimental Results ARTIST Design PhD School, Beijing, 2011 Kim Larsen [42]
Energy Automata
Managing Resources ARTIST Design PhD School, Beijing, 2011 Kim Larsen [44]
Consuming & Harvesting Energy Maximize throughput while respecting: 0 E MAX ARTIST Design PhD School, Beijing, 2011 Kim Larsen [45]
Energy Constrains Energy is not only consumed but may also be regained The aim is to continously satisfy some energy constriants ARTIST Design PhD School, Beijing, 2011 Kim Larsen [46]
Results (so far) Bouyer, Fahrenberg, Larsen, Markey, Srba: FORMATS 2008 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [47]
Discrete Updates on Edges ARTIST Design PhD School, Beijing, 2011 Kim Larsen [48]
New Approach: Energy Functions Maximize energy along paths Use this information to solve general problem ARTIST Design PhD School, Beijing, 2011 Kim Larsen [49]
Energy Function General Strategy Spend just enough time to survive the next negative update ARTIST Design PhD School, Beijing, 2011 Kim Larsen [50]
Exponential PTA General Strategy Spend just enough time to survive the next negative update so that after next negative update there is a certain positive amount! Minimal Fixpoint: ARTIST Design PhD School, Beijing, 2011 Kim Larsen [51]
Exponential PTA Thm [HSCC10]: Lower-bound problem is decidable for linear and exponential 1-clock PTAs with negative discrete Energy updates. Function ARTIST Design PhD School, Beijing, 2011 Kim Larsen [52]
Conclusion Priced Timed Automata a uniform framework for modeling and solving dynamic ressource allocation problems! Not mentioned here: Model Checking Issues (ext. of CTL and LTL). Future work: Zone-based algorithm for optimal infinite i runs. Approximate solutions for priced timed games to circumvent undecidablity issues. Open problems for Energy Automata. Approximate algorithms for optimal reachability ARTIST Design PhD School, Beijing, 2011 Kim Larsen [53]