Presentation is loading. Please wait.

Presentation is loading. Please wait.

ULB, November 2004 As cheap as possible: Linearly Priced Timed Automata Gerd Behrmann, Ed Brinksma, Ansgar Fehnker, Thomas Hune, Kim Larsen, Paul Pettersson,

Similar presentations


Presentation on theme: "ULB, November 2004 As cheap as possible: Linearly Priced Timed Automata Gerd Behrmann, Ed Brinksma, Ansgar Fehnker, Thomas Hune, Kim Larsen, Paul Pettersson,"— Presentation transcript:

1 ULB, November 2004 As cheap as possible: Linearly Priced Timed Automata Gerd Behrmann, Ed Brinksma, Ansgar Fehnker, Thomas Hune, Kim Larsen, Paul Pettersson, Judi Romijn, Frits Vaandrager Brics Aalborg, Nijmegen, Twente, Uppsala, CMU, TERMA, TUE

2 ULB, November 2004 Observation (VHS project) Many scheduling problems can be phrased in a natural way as reachability problems for timed automata. Unsafe Safe 25min20min10min5min Can they make it within 60 minutes ? Motivation

3 ULB, November 2004 unsafe L==0 take! y:=0 y>=25 release! L==1 take! y:=0 y>=25 release! safe Unsafe Safe 25min20min10min5min Can they make it within 60 minutes ? What is the fastest schedule? unsafe L==0 take! y:=0 y>=20 release! L==1 take! y:=0 y>=25 release! safe unsafe L==0 take! y:=0 y>=5 release! L==1 take! y:=0 y>=25 release! safe unsafe L==0 take! y:=0 y>=10 release! L==1 take! y:=0 y>=25 release! safe take? release? take? release? Motivation What schedule minmizes unsafe time? What schedule minimizes bridge crossings?

4 ULB, November 2004 Outline Timed Automata (A review) Linearly Priced Timed Automata –A basic Algorithm –Efficient Data Structures Uniformly Priced Timed Automata –More efficient Data Structures Improved State-Space Exploration –Minimum-Cost Order Search, Estimates of Remaining Cost, Heuristics Results –Bridge Problem –Job-Shop Problems –Aircraft Landing –others Conclusion

5 ULB, November 2004 Network of Automata –Synchronization (CCS-like) a!a? Timed Automata (UPPAAL)

6 ULB, November 2004 a? y = 4 y:=0 a! 3 < x < 7 x < 7 Timed Automata (UPPAAL) Network of Automata –Synchronization (CCS-like) Clocks in description –Time passes uniformly –Guard/reset on action -Invariants on location Infinitely many states!

7 ULB, November 2004 Regions (review) An equivalence class (i.e. a region). In fact there is only a finite number of regions!! x y 12 3 1 2 Alur & Dill x<3 y>2 a b c 3 x y 3 1 2 x 3 1 2 y 123 123 {x:=0} x<3

8 ULB, November 2004 x 3 1 2 Regions (review) Transitions with and w/o reset and delay can be considered as transitions on regions! y 12 Alur & Dill x<3 y>2 a b c 3 x 3 1 2 y x 3 1 2 y 123 123 x<3 {x:=0}

9 ULB, November 2004 Data Structures like DBMs, CDDs  efficiency! x 3 1 2 Zones (review) Convex unions of regions are called zones. Delay, reset, transition in terms of zones y 12 x<3 y>2 x<3 a b c 3 x 3 1 2 y x 3 1 2 y 123 123 {x:=0}

10 ULB, November 2004 Problem: Finding the minimum cost of reaching location c Linearly Priced Timed Automata Timed Automata + Costs on transitions and locations –Cost of performing transition: Transition cost –Cost of performing delay d: ( d x location cost ) (a,x=y=0)(b,x=y=0)(b,x=y=2.5)  (2.5) (a,x=0,y=2.5) 42.5 x 20 Cost of Execution Trace: Sum of costs: 4 + 5 + 0 = 9 Trace: b x<3 y>2 x<3 {x:=0} a c cost’=1 cost+=4 cost’=0 cost’=2

11 ULB, November 2004 Example: Aircraft Landing cost t E LT 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 e*(T-t) d+l*(t-T) Planes have to keep separation distance to avoid turbulences caused by preceding planes

12 ULB, November 2004 Example: Aircraft Landing Planes have to keep separation distance to avoid turbulences caused by preceding planes land! x >= 4 x=5 x <= 5 x=5 x <= 5 land! x <= 9 cost+=2 cost’=3cost’=1 4 earliest landing time 5 target time 9 latest time 3 cost rate for being early 1 cost rate for being late 2 fixed cost for being late

13 ULB, November 2004 Priced Regions cost 1 2 3 4 5

14 ULB, November 2004 Priced Regions cost 1 2 3 4 5

15 ULB, November 2004 x y 123 1 2 costs 5 2 3 Priced Regions cost 1 2 3 4 5

16 ULB, November 2004 An Algorithm State-Space Exploration + Use of global variable Cost Updated Cost whenever goal state with min( C ) < Cost is found: Terminates when entire state-space is explored 80 Cost=80 60 Cost=60 Cost= 

17 ULB, November 2004 An Algorithm Cost:= , Pass := {}, Wait := {(l 0,C 0 )}, Goal=  while Wait  {} do select (l,C) from Wait if (l,C) =  and mincost(C)<Cost then Cost:=mincost(C) if forall (l,C’) in Pass: C’ C then add (l,C) to Pass forall (m,D) such that (l,C) (m,D): add (m,D) to Wait Return Cost

18 ULB, November 2004 An Algorithm Performs: symbolic operations Delay, Conjun- ction, and Reset of clocks. Cost:= , Pass := {}, Wait := {(l 0,C 0 )}, Goal=  while Wait  {} do select (l,C) from Wait if (l,C) =  and mincost(C)<Cost then Cost:=mincost(C) if forall (l’,C’) in Pass: C’ C then add (l,C) to Pass forall (m,D) such that (l,C) (m,D): add (m,D) to Wait Return Cost

19 ULB, November 2004 Cost:= , Pass := {}, Wait := {(l 0,C 0 )}, Goal=  while Wait  {} do select (l,C) from Wait if (l,C) =  and mincost(C)<Cost then Cost:=mincost(C) if forall (l’,C’) in Pass: C’ C then add (l,C) to Pass forall (m,D) such that (l,C) (m,D): add (m,D) to Wait Return Cost : preorder that defines “better” cost zones. An Algorithm 3 2 5 4 3 5 3 2 6

20 ULB, November 2004 An Algorithm Cost:= , Pass := {}, Wait := {(l 0,C 0 )}, Goal=  while Wait  {} do select (l,C) from Wait if (l,C) =  and mincost(C)<Cost then Cost:=mincost(C) if forall (l’,C’) in Pass: C’ C then add (l,C) to Pass forall (m,D) such that (l,C) (m,D): add (m,D) to Wait Return Cost

21 ULB, November 2004 An Algorithm Theorem When the algorithm terminates, the value of COST equals mincost(  ) Theorem The algorithm terminates Can it be done efficiently?

22 ULB, November 2004 Outline Timed Automata. (A review} Linearly Priced Timed Automata –A basic Algorithm –Efficient Data Structures Uniformly Priced timed Automata –More efficient Data Structures Improved State-Space Exploration –Minimum-Cost Order Search, Estimates of Remaining Cost, Heuristics Results –Bridge Problem –Job-Shop Problems –Aircraft Landing –others Conclusion

23 ULB, November 2004 Priced Zones Basic idea: Define a linear cost function on zones cost=c+a x + a y xy x y BUT: Priced zones are not closed under delay, transitions, resets

24 ULB, November 2004 Priced Zones Basic idea: Define a linear cost function on zones cost=c+2 x – 1 y x<3 y>2 x<3 {x:=0} a c cost’=1 cost+=4 cost’=0 cost’=2 b x y BUT: Priced zones are not closed under delay, transitions, resets cost=c’+2 x – 0 y cost=c’’+3 x – 1 y

25 ULB, November 2004 Priced Zones Basic idea: Define a linear cost function on zones cost=c+2 x – 1 y x<3 y>2 x<3 {x:=0} a c cost’=1 cost+=4 cost’=0 cost’=2 b x y BUT: Priced zones are not closed under delay, transitions, resets

26 ULB, November 2004 Priced Zones Basic idea: Define a linear cost function on zones cost=c’+2 x – 2 y x<3 y>2 x<3 {x:=0} a c cost’=1 cost+=4 cost’=0 cost’=2 b x y BUT: Priced zones are not closed under delay, transitions, resets cost=c’’+1 x – 1 y

27 ULB, November 2004 Priced Zones Basic idea: Define a linear cost function on zones x y BUT: Priced zones are not closed under delay, transitions, resets cost=c+2 x – 1 y x<3 y>2 x<3 {x:=0} a c cost’=1 cost+=4 cost’=0 cost’=2 b cost=c’ – 1 y cost=c’’ + 1 y

28 ULB, November 2004 Outline Timed Automata. (A review} Linearly Priced Timed Automata –A basic Algorithm –Efficient Data Structures Uniformly Priced Timed Automata –More efficient Data Structures Improved State-Space Exploration –Minimum-Cost Order Search, Estimates of Remaining Cost, Heuristics Results –Bridge Problem –Job-Shop Problems –Aircraft Landing –others Conclusion

29 ULB, November 2004 Unsafe Safe 25min20min10min5min What is the fastest schedule ? Uniformly Priced Timed Automata UPTA are LPTA where all locations have the same rate

30 ULB, November 2004 Uniformly Priced Timed Automata UPTA are LPTA where all locations have the same rate Result A small modification of the DBM-operations for ordinary timed automata is sufficient to solve cost (time) optimality problems

31 ULB, November 2004 Outline Timed Automata. (A review} Linearly Priced Timed Automata –A basic Algorithm –Efficient Data Structures Uniformly Priced Timed Automata –More efficient Data Structures Improved State-Space Exploration –Minimum-Cost Order Search, Estimates of Remaining Cost, Heuristics Results –Bridge Problem –Job-Shop Problems –Aircraft Landing –others Conclusion

32 ULB, November 2004 Verification vs. Optimization Verification Algorithms: –Check a logical property of the entire state-space of a model –Efficient blind search Optimization Algorithms: –Find (near) optimal solutions –Use techniques to avoid non- optimal parts of the state-space (e.g. Branch and Bound) Objective: –Bridge the gap between these two –New techniques and applications in UPPAAL 80 60 Safe side reachable? Min time of reaching safe side?

33 ULB, November 2004 Minimum-Cost Order The basic algorithm finds the minimum cost trace Breadth or Depth-first search-order Problem: Searches the entire state-space Minimum-Cost Search Order: Always explore state with smallest minimum cost first

34 ULB, November 2004 Minimum-Cost Order Fact 1: First goal state found is optimal Cost grows along all paths The search can terminate when first goal state found Like Dijkstra’s shortest path algorithm Fact 2: No other search order explores fewer states Simpler algorithm: variable Cost no longer needed

35 ULB, November 2004 Estimates of Remaining Cost Often a conservative estimate of the remaining cost can be found R EM ( l, C ) = conservative estimate of remaining cost Bridge example: R EM ( l, C ) = time of slowest person on Unsafe side At least 25 mins needed to complete schedule

36 ULB, November 2004 Estimates of Remaining Cost Basic Algorithm + Estimate of remaining cost: Only states with (min(C) + R EM (l, C)) < Cost are further explored Cost=80 + R EM ( l, C )  80 min( C )

37 ULB, November 2004 Estimates of Remaining Cost Minimum Cost + Estimate of remaining cost: Explore states with smallest ( min(C) + R EM ( l, C ) ) first Cost=80 + R EM ( l, C )  80 min( C ) Basic Algorithm + Estimate of remaining cost: Only states with (min(C) + R EM (l, C)) < Cost are further explored

38 ULB, November 2004 Using Heuristics Allows the users to control the search order according to heuristics Symbolic states extended to (l, C, h), where h is the priority of a state Transitions are annotated with assignments to h Flexible! Basic Algorithm + Heuristics: State with highest h is explored first

39 ULB, November 2004 Using Heuristics Try to schedule planes in the order of their preferred landing times

40 ULB, November 2004 Outline Timed Automata. (A review} Linearly Priced Timed Automata –A basic Algorithm –Efficient Data Structures Uniformly Priced Timed Automata –More efficient Data Structures Improved State-Space Exploration –Minimum-Cost Order Search, Estimates of Remaining Cost, Heuristics Results –Bridge Problem –Sidmar –Aircraft Landing –others Conclusion

41 ULB, November 2004 Example: Bridge Problem Number of symbolic states generated with cost- extended version of UPPAAL Minimum Cost Order + Estimate of Remaining cost <10% of Breadth-First Search BF = Breadth-First, DF = Depth-First, MC = Minimum Cost Order, MC+ = MC + REM What is the fastest schedule?

42 ULB, November 2004 Machine 1 Machine 2Machine 3 Machine 4Machine 5 Buffer Continuos Casting Machine Storage Place Crane B Crane A A. Fehnker [RTCSA99], T. Hune, K. G. Larsen, P. Pettersson [DSV00] Case study of Esprit-LTR project 26270 VHS Physical plant of SIDMAR located in Gent, Belgium Part between blast furnace and hot rolling mill Objective: model the plant, obtain schedule and control program for plant Lane 1 Lane 2 SIDMAR Steel Production Plant

43 ULB, November 2004 Machine 1 Machine 2Machine 3 Machine 4Machine 5 Buffer Continuos Casting Machine Storage Place Crane B Crane A Input: sequence of steel loads (“pigs”) @10 @20@10 @40 Load follows Recipe to obtain certain quality, e.g: start; T1@10; T2@20; T3@10; T2@10; end within 120 Output: sequence of higher quality steel. Lane 1 Lane 2 22 2 15 16  =127 SIDMAR Steel Production Plant Optimal schedules for ten batches using guiding with priorities. Only for two batches without

44 ULB, November 2004 Aircraft Landing Problem runways Benchmark by Beasley et al 2000

45 ULB, November 2004 Advantages Easy and flexible modeling of systems Whole range of verification techniques becomes available Controller/Program synthesis Disadvantages Existing scheduling approaches (still) perform somewhat better Our goal See how far we get Integrate model checking and scheduling theory New discipline of Timing Technology? EU IST project Ametist Conclusion

46 ULB, November 2004 Conclusion Papers: –Efficient Guiding Towards Cost-Optimality in UPPAAL [TACAS’01] –Minimum Cost-Reachability for Priced Timed Automata [HSCC’01] –As Cheap as Possible: Efficient Cost-Optimal Reachability for Priced Timed Automata [CAV’01] –Citius, Vilius, Melius: Guiding and Cost-Optimality in Model Checking of Timed and Hybrid Systems, PhD Thesis Ansgar Fehnker, University of Nijmegen, April 2002 Tool : –UPPAAL CORA!!

47 ULB, November 2004 End of slide show

48 ULB, November 2004 THE END


Download ppt "ULB, November 2004 As cheap as possible: Linearly Priced Timed Automata Gerd Behrmann, Ed Brinksma, Ansgar Fehnker, Thomas Hune, Kim Larsen, Paul Pettersson,"

Similar presentations


Ads by Google