UPPAAL and Optimal Scheduling

Download Report

Transcript UPPAAL and Optimal Scheduling

Tools and Application of
Timed Automata
UPPAAL & Optimal Scheduling
Kim G. Larsen
[email protected]
UCb
Contributors
UPPAAL
 Gerd Behrmann
 Wang Yi
 Paul Pettersson
 Johan Bengtsson
 Fredrik Larsson
 Alexandre David
 Leonid Mokrushin
 Brian Nielsen
CUPPAAL
 Thomas Hune
 Jakob I Rasmussen
 Ansgar Fehnker
 Judi Romijn
 Frits Vaandrager
 Ed Brinksma
 Patricia Bouyer
CASE STUDIES




Thomas Hune
Gerd Behrmann
Arne Skou
Anders Brødløs
UCb
CUPPAAL & KRONOS
www.uppaal.com
UCb
CUPPAAL
www.uppaal.com
UCb
Scheduling Problem
 Scheduling/Planning Domain =
 A number of objects
 instances of different object types
 individual states  global state
 A number of actions on objects
 required precondition on objects
(= state condition)
 resulting effect
(= state transformation)
 duration / cost
(= time / energy / money / ..)
 Problem:
 compute an (optimal) plan/schedule
that “solves” the problem.
UCb
Rush Hour
Your CAR
OBJECTIVE:
Get your
CAR out
EXIT
UCb
Rush Hour
UCb
Rush Hour
UCb
Jobshop Scheduling
[TACAS’2001]
Sport
Economy
Local News
Comic Stip
Kim
2.
5 min
4.
1 min
3.
3 min
1.
10 min
Jüri
1.
10 min
2.
20 min
3.
1 min
4.
1 min
Jan
4.
1 min
1.
13 min
3.
11 min
2.
11 min
Wang
1.
1 min
2.
1 min
3.
1 min
4.
1 min
Problem: compute the minimal MAKESPAN
NP-hard
Simulated annealing
Shiffted bottleneck
UCb
Branch-and-Bound
Gentic Algorithms
Jobshop in UPPAAL
Sport
5 min
Economy
4.
Local News
Comic Stip
1 min
3.
3 min
1. 10 min
1 min
4.
Kim
2.
Jüri
1. 10 min
2. 20 min
3.
Jan
4.
1 min
1. 13 min
3. 11 min
2. 11 min
Wang
1.
1 min
2.
3.
4.
1 min
1 min
1 min
UCb
1 min
B-&-B algorithm running
for 60 sec.
j=15
j=10
j=15
m=10
j=20
m=5
j=10
Experiments
Lawrence Job Shop Problems
UCb
Task Graph Scheduling
Optimal Static Task Scheduling




Task P={P1,.., Pm}
Machines M={M1,..,Mn}
Duration D : (P£M) ! N1
< : p.o. on P (pred.)
 A task can be executed
only if all predecessors
have completed
 Each machine can process
at most one task at a time
 Task cannot be preempted.
16,10
2,3
P2
2,3
6,6
P6
2,2
P7
P1
P3
8,2
10,16
P4
P5
M = {M1,M2}
UCb
Task Graph Scheduling
Optimal Static Task Scheduling




Task P={P1,.., Pm}
Machines M={M1,..,Mn}
Duration D : (P£M) ! N1
< : p.o. on P (pred.)
16,10
2,3
P2
2,3
6,6
P6
2,2
P7
P1
P3
8,2
10,16
P4
P5
M = {M1,M2}
UCb
Experimental Results
Abdeddaïm, Kerbaa, Maler
UCb
Task Graph Scheduling
Power-Optimal Static Task Scheduling





Task P={P1,.., Pm}
Machines M={M1,..,Mn}
Duration D : (P£M) ! N1
< : p.o. on P (pred.)
Energy: C : M ! N
16,10
P2
2,3
P1
0
2,3
P6
6,6
P3
10,16
P4
4
2,2
P7
8,2
P5
C(M1)=4; C(M2)=3 UCb
Priced Timed Automata
Optimal Scheduling
Behrmann, Fehnker, et all (HSCC’01)
cost’=1
x<3
Alur, Torre, Pappas (HSCC’01)
cost’=2
cost+=4
cost’=0
x<3
y>2, x<2
a
x:=0
c
b
 Timed Automata + Costs on transitions and locations.
 Cost of performing transition:
Transition cost.
 Cost of performing delay d:
( d x Location cost).
•Trace:
(a,x=y=0)
4
(b,x=y=0)
(2.5)
2.5 x 2
(b,x=y=2.5)
0
(a,x=0,y=2.5)
• Cost of Execution Trace: Sum of costs: 4 + 5 + 0 = 9
UCb
Example: Aircraft Landing
cost
d+l*(t-T)
e*(T-t)
E
T
L
t
E
T
L
e
l
d
earliest landing time
target time
latest time
cost rate for being early
cost rate for being late
fixed cost for being late
Planes have to keep separation
distance to avoid turbulences
caused by preceding planes
Runway
UCb
Example: Aircraft Landing
x <= 5
x >= 4
x=5
land!
cost+=2
x <= 5
x <= 9
cost’=3
cost’=1
x=5
land!
4
5
9
3
1
2
earliest landing time
target time
latest time
cost rate for being early
cost rate for being late
fixed cost for being late
Planes have to keep separation
distance to avoid turbulences
caused by preceding planes
Runway
UCb
Zones
Operations
y
Z
x
UCb
Priced Zone
CAV’01
y
Z
2
D4
-1
x
Cost( x, y )  2y  x  2
UCb
Symbolic B&B Algorithm
CAV’01
UCb
Symbolic B&B Algorithm
CAV’01
Linear Programming
Problems
UCb
Aircraft Landing
CAV’01
Source of examples:
Baesley et al’2000
UCb
Aircraft Landing
Using MCF/Netsimplex
J.I. Rasmussen et al
similar for
Priced Task Graph
UCb
Case-Studies: Controllers








Gearbox Controller [TACAS’98]
Bang & Olufsen Power Controller [RTPS’99,FTRTFT’2k]
SIDMAR Steel Production Plant [RTCSA’99, DSVV’2k]
Real-Time RCX Control-Programs [ECRTS’2k]
Experimental Batch Plant (2000)
RCX Production Cell (2000)
Terma, Memory Management for Radar (2002)
Analog Devices, Dynamic Voltage Scaling
Strategies (2003)
UCb
Case Studies: Protocols











Philips Audio Protocol [HS’95, CAV’95, RTSS’95, CAV’96]
Collision-Avoidance Protocol [SPIN’95]
Bounded Retransmission Protocol [TACAS’97]
Bang & Olufsen Audio/Video Protocol [RTSS’97]
TDMA Protocol [PRFTS’97]
Lip-Synchronization Protocol [FMICS’97]
Multimedia Streams [DSVIS’98]
ATM ABR Protocol [CAV’99]
ABB Fieldbus Protocol [ECRTS’2k]
IEEE 1394 Firewire Root Contention (2000)
Leader Election Algorithm in Ad-Hoc Network [posed by Leslie
Lamport 2003]
UCb
Conclusion
www.uppaal.com
UCb
Steel Production Plant





A. Fehnker
Machine 1
Hune, Larsen, Pettersson
Case study of Esprit-LTR
Machine 4
project 26270 VHS
Physical plant of SIDMAR
located in Gent, Belgium.
Part between blast furnace and
hot rolling mill.
Crane A
Machine 2
Machine 3
Machine 5
Lane 1
Lane 2
Buffer
Objective: model the plant, obtain
schedule and control program for
plant.
Crane B
Storage Place
Continuos
Casting Machine
UCb
Steel Production Plant
Crane A
Input: sequence of steel
loads (“pigs”).
Machine 1
Machine 4
Load follows Recipe to
become certain quality,
e.g:
start; T1@10; T2@20;
T3@10; T2@10;
end within 120.
Machine 2
Machine 3
Machine 5
Lane 1
Lane 2
Buffer
Crane B
Output: sequence of
higher quality
steel.
Storage Place
Continuos
Casting Machine
UCb
Steel Production Plant
Crane A
Input: sequence of steel
loads (“pigs”).
Machine 2
Machine 1
@10
2
2
Machine 4
@20
Machine 3
2
Machine 5
@10
Lane 1
5
@10
Load follows Recipe to
become certain quality,
e.g:
start; T1@10; T2@20;
T3@10; T2@10;
end within 120.
Lane 2
6
Buffer
Crane B
=107
Output: sequence of
higher quality
steel.
Storage Place
@40
Continuos
Casting Machine
UCb
Steel Production Plant
Crane A
Input: sequence of steel
loads (“pigs”).
@10
2
2
Machine 4
Load follows Recipe to
obtain certain quality, e.g:
start; T1@10; T2@20;
T3@10; T2@10;
end within 120.
Machine 2
Machine 1
15
@20
Machine 3
2
Machine 5
@10
Lane 1
@10
Lane 2
16
Buffer
Crane B
=127
Output: sequence of
higher quality
steel.
Storage Place
@40
Continuos
Casting Machine
UCb
A single load
(part of)
Crane B
UCb
Experiment
n
A l l Gu i d e s
BFS
DFS
BSH
s MB s MB s MB
S o me Gu i d e s
BFS
DFS
BSH
s MB s MB s MB
No Gu i d e s
BFS
DFS
BSH
s MB s MB s MB
1
0,1
0,9
0,1
0,9
0,1
0,9
0,1
0,9
0,1
0,9
0,1
0,9
3,2
6,1
0,8
2,2
3.9
3.3
2
18,4
36,4
0,1
1
0,1
1,1
-
-
4,4
7,8
7,8
1,2
-
-
19,5
36,1
-
-
3
-
-
3,2
6,5
3,4
1,4
-
-
72,4
92,1
901
3,4
-
-
-
-
-
-
4
-
-
4
8,2
4,6
1,8
-
-
-
-
-
-
-
-
-
-
-
-
5
-
-
5
10,2
5,5
2,2
-
-
-
-
-
-
-
-
-
-
-
-
10
-
-
13,3
25,3
16,1
9,3
-
-
-
-
-
-
-
-
-
-
-
-
15
-
-
31,6
51,2
48,1
22,2
-
-
-
-
-
-
-
-
-
-
-
-
20
-
-
61,8
89,6
332
46,1
-
-
-
-
-
-
-
-
-
-
-
-
25
-
-
104
144
87,2
83,3
-
-
-
-
-
-
-
-
-
-
-
-
30
-
-
166
216
124,2 136
-
-
-
-
-
-
-
-
-
-
-
-
209
250
-
-
-
-
-
-
-
-
-
-
-
-
35
-
-
• BFS = breadth-first search, DFS = depth-first search, BSH = bit-state hashing,
•“-” = requires >2h (on 450MHz Pentium III), >256 MB, or suitable hash-table size was not found.
• System size: 2n+5 automata and 3n+3 clocks, if n=35: 75 automata and 108 clocks.
• Schedule generated for n=60 on Sun Ultra with 2x300MHz with 1024MB in 2257s .
UCb
LEGO Plant Model
crane a
 LEGO RCX
Mindstorms.
 Local
controllers with
control
programs.
 IR protocol for
remote
invocation of
programs.
 Central
controller.
m1
m4
m2
m3
m5
crane b
buffer
storage
casting
central
controller
UCb
Synthesis
LEGO Plant Model
Belt/Machine Unit.
UCb