Time Petri Nets with Stopwatches (and more) Time Petri Nets About newly enabled transitions t 1 [0 , 6] • P 1 t 2 [0 , 3] Fire t 1 t 1 and t 2 are enabled by M − • t 1 but t 1 is the fired transition Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 17 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets About newly enabled transitions t 1 [0 , 6] •• P 1 t 2 [0 , 3] Fire t 1 t 1 and t 2 are enabled by M − • t 1 but t 1 is the fired transition t 2 remains enabled, t 1 is newly enabled Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 17 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets Time Petri Net Example: Fixed Priority Scheduling (non-preemptive) Tin 0 [2 , 5] Tin 1 [0 , 4] Tin 2 [1 , 4] P 0 P 1 P 2 T 0 [0 , 0] T 1 [0 , 0] T 2 [0 , 0] P ′ P ′ P ′ 0 1 2 T ′ T ′ T ′ 0 [1 , 2] 1 [3 , 3] 2 [4 , 6] • P e Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 18 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets TPN Example: Task Activation • P o T o [1 , 1] • • P x P 2 P x T x [3 , 3] T x [3 , 3] T x [0 , 0] P 1 P 1 P 1 T 1 [1 , 2] T 1 [1 , 2] T 1 [1 , 2] (a) (b) (c) Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 19 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets Read Arcs and Time T 1 [1 , 2] • P 0 T 0 [3 , 4] Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 20 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets Read Arcs and Time T 1 [1 , 2] • P 0 T 0 [3 , 4] Read should not be destructive: M 0 , T 0 = 0 , � � T 1 = 0 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 20 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets Read Arcs and Time T 1 [1 , 2] • P 0 T 0 [3 , 4] Read should not be destructive: � 1 . 62 M 0 , T 0 = 0 , M 0 , T 0 = 1 . 62 , � � � − − → T 1 = 0 T 1 = 1 . 62 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 20 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets Read Arcs and Time T 1 [1 , 2] • P 0 T 0 [3 , 4] Read should not be destructive: � 1 . 62 � T 0 M 0 , T 0 = 0 , M 0 , T 0 = 1 . 62 , M 0 , T 0 = 0 , � � � � − − → − → T 1 = 0 T 1 = 1 . 62 T 1 = 0 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 20 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets Read Arcs and Time T 1 [1 , 2] T 1 [1 , 2] • • P 0 P 0 � = T 0 [3 , 4] T 0 [3 , 4] Read should not be destructive: � 1 . 62 � T 0 M 0 , T 0 = 0 , M 0 , T 0 = 1 . 62 , M 0 , T 0 = 0 , � � � � − − → − → T 1 = 0 T 1 = 1 . 62 T 1 = 0 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 20 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets From Read Arcs To Activator Arcs • • P 0 P 1 T 0 [3 , 4] T 1 [1 , 2] T 2 [0 , 1] P 2 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 21 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets From Read Arcs To Activator Arcs • • P 0 P 1 T 0 [3 , 4] T 1 [1 , 2] T 2 [0 , 1] P 2 Memory / No Memory: M 0 , T 0 = 0 , � � T 1 = 0 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 21 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets From Read Arcs To Activator Arcs • • P 0 P 1 T 0 [3 , 4] T 1 [1 , 2] T 2 [0 , 1] P 2 Memory / No Memory: � 1 . 62 M 0 , T 0 = 0 , M 0 , T 0 = 1 . 62 , � � � − − → T 1 = 0 T 1 = 1 . 62 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 21 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets From Read Arcs To Activator Arcs • P 0 P 1 T 0 [3 , 4] T 1 [1 , 2] T 2 [0 , 1] • P 2 Memory / No Memory: � 1 . 62 � T 1 M 0 , T 0 = 0 , M 0 , T 0 = 1 . 62 , � � − − → − → ( M 1 , T 2 = 0) T 1 = 0 T 1 = 1 . 62 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 21 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets From Read Arcs To Activator Arcs • P 0 P 1 T 0 [3 , 4] T 1 [1 , 2] T 2 [0 , 1] • P 2 Memory / No Memory: � 1 . 62 � T 1 M 0 , T 0 = 0 , M 0 , T 0 = 1 . 62 , � � − − → − → ( M 1 , T 2 = 0) T 1 = 0 T 1 = 1 . 62 0 . 2 − − → ( M 1 , T 2 = 0 . 2) Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 21 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets From Read Arcs To Activator Arcs • • P 0 P 1 T 0 [3 , 4] T 1 [1 , 2] T 2 [0 , 1] P 2 Memory / No Memory: � 1 . 62 � T 1 M 0 , T 0 = 0 , M 0 , T 0 = 1 . 62 , � � − − → − → ( M 1 , T 2 = 0) T 1 = 0 T 1 = 1 . 62 M 0 , T 0 = 0 , 0 . 2 � � → ( M 1 , T 2 = 0 . 2) T 2 − − − → T 1 = 0 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 21 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets From Read Arcs To Activator Arcs • P 0 P 1 T 0 [3 , 4] T 1 [1 , 2] T 2 [0 , 1] • P 2 Memory / No Memory: � 1 . 62 � T 1 M 0 , T 0 = 0 , M 0 , T 0 = 1 . 62 , M 1 , T 0 = 1 . 62 , � � � � − − → − → T 1 = 0 T 1 = 1 . 62 T 2 = 0 � 0 . 31 M 0 , T 0 = 0 , M 0 , T 0 = 0 . 31 , 0 . 2 � � � → ( M 1 , T 2 = 0 . 2) T 2 − − − → − − → T 1 = 0 T 1 = 0 . 31 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 21 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets From Read Arcs To Activator Arcs • P 0 P 1 T 0 [3 , 4] T 1 [1 , 2] T 2 [0 , 1] • P 2 Memory / No Memory: � 1 . 62 � T 1 M 0 , T 0 = 0 , M 0 , T 0 = 1 . 62 , M 1 , T 0 = 1 . 62 , � � � � − − → − → T 1 = 0 T 1 = 1 . 62 T 2 = 0 � 0 . 31 � T 2 M 1 , T 0 = 1 . 62 , M 0 , T 0 = 0 , M 0 , T 0 = 0 . 31 , 0 . 2 � � � � − − → − → − − → T 2 = 0 . 2 T 1 = 0 T 1 = 0 . 31 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 21 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets From Read Arcs To Activator Arcs • • P 0 P 1 T 0 [3 , 4] T 1 [1 , 2] T 2 [0 , 1] P 2 Memory / No Memory: � 1 . 62 � T 1 M 0 , T 0 = 0 , M 0 , T 0 = 1 . 62 , M 1 , T 0 = 1 . 62 , � � � � − − → − → T 1 = 0 T 1 = 1 . 62 T 2 = 0 � 0 . 31 � T 2 M 1 , T 0 = 1 . 62 , M 0 , T 0 = 1 . 62 , M 0 , T 0 = 0 . 31 , 0 . 2 � � � � − − → − → − − → T 2 = 0 . 2 T 1 = 0 T 1 = 0 . 31 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 21 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets From Read Arcs To Activator Arcs • • P 0 P 1 T 0 [3 , 4] T 1 [1 , 2] T 2 [0 , 1] P 2 Memory / No Memory: � 1 . 62 � T 1 M 0 , T 0 = 0 , M 0 , T 0 = 1 . 62 , M 1 , T 0 = 1 . 62 , � � � � − − → − → T 1 = 0 T 1 = 1 . 62 T 2 = 0 � 0 . 31 � T 2 M 1 , T 0 = 1 . 62 , M 0 , T 0 = 1 . 62 , M 0 , T 0 = 1 . 93 , 0 . 2 � � � � − − → − → − − → T 2 = 0 . 2 T 1 = 0 T 1 = 0 . 31 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 21 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets TPN with Stopwatches Example: Round-Robin Scheduling Ts 1 [1 , 1] • • • P 0 P 2 P 2 P 1 T 0 [3 , 4] Ts 2 [1 , 1] T 1 [2 , 3] Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 22 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets TPN with Stopwatches Example: Round-Robin Scheduling Ts 1 [1 , 1] • • • P 0 P 2 P 2 P 1 T 0 [3 , 4] Ts 2 [1 , 1] T 1 [2 , 3] Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 22 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets TPN with Stopwatches Example: Round-Robin Scheduling Ts 1 [1 , 1] • • • P 0 P 2 P 2 P 1 T 0 [3 , 4] Ts 2 [1 , 1] T 1 [2 , 3] Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 22 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets Time Inhibitor Arcs: Fixed Priority Scheduling (Preemptive) Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] • P 0 P 1 P 2 T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] T 0 =? T 1 = 0 T 2 =? Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 23 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets Time Inhibitor Arcs: Fixed Priority Scheduling (Preemptive) Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] • P 0 P 1 P 2 T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] T 0 =? T 1 = 0 . 22 T 2 =? Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 23 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets Time Inhibitor Arcs: Fixed Priority Scheduling (Preemptive) Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] • • P 0 P 1 P 2 T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] T 0 =? T 1 = 0 . 22 T 2 = 0 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 23 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets Time Inhibitor Arcs: Fixed Priority Scheduling (Preemptive) Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] • • P 0 P 1 P 2 T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] T 0 =? T 1 = 1 . 6 T 2 = 0 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 23 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets Time Inhibitor Arcs: Fixed Priority Scheduling (Preemptive) Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] • • • P 0 P 1 P 2 T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] T 0 = 0 T 1 = 1 . 6 T 2 = 0 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 23 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets Time Inhibitor Arcs: Fixed Priority Scheduling (Preemptive) Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] • • • P 0 P 1 P 2 T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] T 0 = 1 . 5 T 1 = 1 . 6 T 2 = 0 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 23 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets Time Inhibitor Arcs: Fixed Priority Scheduling (Preemptive) Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] • • P 0 P 1 P 2 T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] T 0 =? T 1 = 1 . 6 T 2 = 0 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 23 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets Time Inhibitor Arcs: Fixed Priority Scheduling (Preemptive) Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] • • P 0 P 1 P 2 T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] T 0 =? T 1 = 1 . 8 T 2 = 0 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 23 / 48
Time Petri Nets with Stopwatches (and more) Time Petri Nets The price of expressiveness The reachability problem: General case Bounded Petri Nets decidable decidable Petri Nets w/ Inhibitor undecidable[8] decidable Time Petri Nets undecidable [9] decidable [1] Stopwatch Time Petri Nets undecidable [2] undecidable[2] Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 24 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Scheduling Time Petri Nets ◮ A model in the class of Time Petri Nets w/ Stopwatches ; Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 25 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Scheduling Time Petri Nets ◮ A model in the class of Time Petri Nets w/ Stopwatches ; ◮ Dedicated to the modelling of preemptive scheduling policies; Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 25 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Scheduling Time Petri Nets ◮ A model in the class of Time Petri Nets w/ Stopwatches ; ◮ Dedicated to the modelling of preemptive scheduling policies; ◮ Places and transitions are associated with tasks ; Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 25 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Scheduling Time Petri Nets ◮ A model in the class of Time Petri Nets w/ Stopwatches ; ◮ Dedicated to the modelling of preemptive scheduling policies; ◮ Places and transitions are associated with tasks ; ◮ Tasks are given a processor and priority (or deadline or . . . ); Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 25 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Scheduling Time Petri Nets ◮ A model in the class of Time Petri Nets w/ Stopwatches ; ◮ Dedicated to the modelling of preemptive scheduling policies; ◮ Places and transitions are associated with tasks ; ◮ Tasks are given a processor and priority (or deadline or . . . ); ◮ Processors are given a scheduling policy . Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 25 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Scheduling Time Petri Nets ◮ A model in the class of Time Petri Nets w/ Stopwatches ; ◮ Dedicated to the modelling of preemptive scheduling policies; ◮ Places and transitions are associated with tasks ; ◮ Tasks are given a processor and priority (or deadline or . . . ); ◮ Processors are given a scheduling policy . ◮ With the state of the net of progress rate for each transition is computed at each change of marking. Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 25 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Example: Fixed Priority Scehduling (Preemptive) Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] P 0 , γ = τ 1 • P 1 , γ = τ 2 • P 2 , γ = τ 3 • T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] Proc ( τ 1 ) = 1 Proc ( τ 2 ) = 1 Proc ( τ 3 ) = 1 Prio ( τ 1 ) = 3 Prio ( τ 2 ) = 2 Prio ( τ 3 ) = 1 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 26 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Example: Fixed Priority Scehduling (Preemptive) Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] P 0 , γ = τ 1 • P 1 , γ = τ 2 • P 2 , γ = τ 3 • T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] Proc ( τ 1 ) = 1 Proc ( τ 2 ) = 1 Proc ( τ 3 ) = 1 Prio ( τ 1 ) = 3 Prio ( τ 2 ) = 2 Prio ( τ 3 ) = 1 Flow ( T 0 ) = 1 , Flow ( T 1 ) = 0 , Flow ( T 2 ) = 0 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 26 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Example: Fixed Priority Scehduling (Preemptive) Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] P 0 , γ = τ 1 P 1 , γ = τ 2 • P 2 , γ = τ 3 • T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] Proc ( τ 1 ) = 1 Proc ( τ 2 ) = 1 Proc ( τ 3 ) = 1 Prio ( τ 1 ) = 3 Prio ( τ 2 ) = 2 Prio ( τ 3 ) = 1 Flow ( T 0 ) =? , Flow ( T 1 ) = 1 , Flow ( T 2 ) = 0 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 26 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Example: Fixed Priority Scehduling (Preemptive) Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] P 0 , γ = τ 1 P 1 , γ = τ 2 P 2 , γ = τ 3 • T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] Proc ( τ 1 ) = 1 Proc ( τ 2 ) = 1 Proc ( τ 3 ) = 1 Prio ( τ 1 ) = 3 Prio ( τ 2 ) = 2 Prio ( τ 3 ) = 1 Flow ( T 0 ) =? , Flow ( T 1 ) =? , Flow ( T 2 ) = 1 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 26 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Example: Round-Robin Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] P 0 , γ = τ 1 • P 1 , γ = τ 2 • P 2 , γ = τ 3 • T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] Proc ( τ 1 ) = 1 Proc ( τ 2 ) = 1 Proc ( τ 3 ) = 1 Prio ( τ 1 ) = 1 Prio ( τ 2 ) = 1 Prio ( τ 3 ) = 1 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 27 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Example: Round-Robin Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] P 0 , γ = τ 1 • P 1 , γ = τ 2 • P 2 , γ = τ 3 • T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] Proc ( τ 1 ) = 1 Proc ( τ 2 ) = 1 Proc ( τ 3 ) = 1 Prio ( τ 1 ) = 1 Prio ( τ 2 ) = 1 Prio ( τ 3 ) = 1 Flow ( T 0 ) = 1 3 , Flow ( T 1 ) = 1 3 , Flow ( T 2 ) = 1 3 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 27 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Example: Round-Robin Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] P 0 , γ = τ 1 P 1 , γ = τ 2 • P 2 , γ = τ 3 • T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] Proc ( τ 1 ) = 1 Proc ( τ 2 ) = 1 Proc ( τ 3 ) = 1 Prio ( τ 1 ) = 1 Prio ( τ 2 ) = 1 Prio ( τ 3 ) = 1 Flow ( T 0 ) =? , Flow ( T 1 ) = 1 2 , Flow ( T 2 ) = 1 2 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 27 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Example: Round-Robin Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] P 0 , γ = τ 1 P 1 , γ = τ 2 P 2 , γ = τ 3 • T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] Proc ( τ 1 ) = 1 Proc ( τ 2 ) = 1 Proc ( τ 3 ) = 1 Prio ( τ 1 ) = 1 Prio ( τ 2 ) = 1 Prio ( τ 3 ) = 1 Flow ( T 0 ) =? , Flow ( T 1 ) =? , Flow ( T 2 ) = 1 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 27 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Example: Round-Robin Tin 0 [1 , 3] Tin 1 [0 , 2] Tin 2 [0 , 1] P 0 , γ = τ 1 P 1 , γ = τ 2 P 2 , γ = τ 3 • T 0 [1 , 3] T 1 [4 , 10] T 2 [2 , 3] Proc ( τ 1 ) = 1 Proc ( τ 2 ) = 1 Proc ( τ 3 ) = 1 Prio ( τ 1 ) = 1 Prio ( τ 2 ) = 1 Prio ( τ 3 ) = 1 A fluid approach: minimize the number of discrete changes. Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 27 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Example: Earliest Deadline First p 4 γ = τ 2 • p 1 γ = φ t 1 [10 , 10] t 4 [2 , 2] Proc ( τ 2 ) = 1 • p 2 γ = τ 1 Deadline ( τ 2 ) = 8 B ( τ 2 ) = { t 2 } t 2 [1 , 3] E ( τ 2 ) = { t 4 } p 3 γ = τ 1 Proc ( τ 1 ) = 1 Deadline ( τ 1 ) = 10 t 3 [3 , 3] B ( τ 1 ) = { t 1 } , E ( τ 1 ) = { t 3 } Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 28 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Example: Earliest Deadline First p 4 γ = τ 2 • p 1 γ = φ t 1 [10 , 10] t 4 [2 , 2] Proc ( τ 2 ) = 1 • p 2 γ = τ 1 Deadline ( τ 2 ) = 8 B ( τ 2 ) = { t 2 } t 2 [1 , 3] E ( τ 2 ) = { t 4 } p 3 γ = τ 1 Proc ( τ 1 ) = 1 Deadline ( τ 1 ) = 10 t 3 [3 , 3] B ( τ 1 ) = { t 1 } , E ( τ 1 ) = { t 3 } Flow ( t 1 ) = 1 Flow ( t 2 ) = 1 Flow ( t 3 ) =? Flow ( t 4 ) =? Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 28 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Example: Earliest Deadline First • • p 4 γ = τ 2 p 1 γ = φ t 1 [10 , 10] t 4 [2 , 2] Proc ( τ 2 ) = 1 p 2 γ = τ 1 Deadline ( τ 2 ) = 8 B ( τ 2 ) = { t 2 } t 2 [1 , 3] E ( τ 2 ) = { t 4 } p 3 γ = τ 1 • Proc ( τ 1 ) = 1 Deadline ( τ 1 ) = 10 t 3 [3 , 3] B ( τ 1 ) = { t 1 } , E ( τ 1 ) = { t 3 } if t 2 was fired before 2 Flow ( t 1 ) = 1 Flow ( t 2 ) =? Flow ( t 3 ) = 0 Flow ( t 4 ) = 1 if t 2 was fired after 2 Flow ( t 1 ) = 1 Flow ( t 2 ) =? Flow ( t 3 ) = 1 Flow ( t 4 ) = 0 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 28 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Example: Earliest Deadline First • • p 4 γ = τ 2 p 1 γ = φ t 1 [10 , 10] t 4 [2 , 2] Proc ( τ 2 ) = 1 p 2 γ = τ 1 x τ 2 Deadline ( τ 2 ) = 8 B ( τ 2 ) = { t 2 } x τ 1 t 2 [1 , 3] E ( τ 2 ) = { t 4 } D τ 2 [8 , 8] p 3 γ = τ 1 D τ 1 [10 , 10] • Proc ( τ 1 ) = 1 Deadline ( τ 1 ) = 10 t 3 [3 , 3] B ( τ 1 ) = { t 1 } , E ( τ 1 ) = { t 3 } if t 2 was fired before 2 Flow ( t 1 ) = 1 Flow ( t 2 ) =? Flow ( t 3 ) = 0 Flow ( t 4 ) = 1 if t 2 was fired after 2 Flow ( t 1 ) = 1 Flow ( t 2 ) =? Flow ( t 3 ) = 1 Flow ( t 4 ) = 0 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 28 / 48
Time Petri Nets with Stopwatches (and more) Scheduling Time Petri Nets Example: Earliest Deadline First • • p 4 γ = τ 2 p 1 γ = φ t 1 [10 , 10] t 4 [2 , 2] Proc ( τ 2 ) = 1 p 2 γ = τ 1 x τ 2 Deadline ( τ 2 ) = 8 B ( τ 2 ) = { t 2 } x τ 1 t 2 [1 , 3] E ( τ 2 ) = { t 4 } D τ 2 [8 , 8] p 3 γ = τ 1 D τ 1 [10 , 10] • Proc ( τ 1 ) = 1 Deadline ( τ 1 ) = 10 t 3 [3 , 3] B ( τ 1 ) = { t 1 } , E ( τ 1 ) = { t 3 } if D τ 2 ≤ D τ 1 Flow ( t 1 ) = 1 Flow ( t 2 ) =? Flow ( t 3 ) = 0 Flow ( t 4 ) = 1 if D τ 1 < D τ 2 Flow ( t 1 ) = 1 Flow ( t 2 ) =? Flow ( t 3 ) = 1 Flow ( t 4 ) = 0 Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 28 / 48
Abstractions for Scheduling-TPNs Plan I Introduction Time Petri Nets with Stopwatches (and more) Abstractions for Scheduling-TPNs The State Class Graph Polyhedra On Demand! Verifying properties Conclusion and Future Work Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 29 / 48
Abstractions for Scheduling-TPNs Abstractions ◮ Infinite state-space ⇒ Abstractions ◮ TPNs: Zone-based simulation graph [5] ◮ TPNs: State class graph [1] ◮ TPNs w/ stopwatches (IHTPNs,. . . ): State class graph [10, 11, 3] Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 30 / 48
Abstractions for Scheduling-TPNs The State Class Graph Basic Algorithm begin Passed = ∅ Waiting = { C 0 } while Waiting � = ∅ C = pop( Waiting ) Passed = Passed ∪ C for t firable from C C ′ = AbstractSuccessor( C , t ) if C ′ �∈ Passed Waiting = Waiting ∪ C ′ end if end for end while end Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 31 / 48
Abstractions for Scheduling-TPNs The State Class Graph State Class 0 1 C = 0 , 2 1 TPNs: Zone (encoded by a Difference Bound Matrix (DBM) [ d ij ] i , j ∈ [0 .. n ] ): � − d 0 i ≤ θ i − 0 ≤ d i 0 , θ i − θ j ≤ d ij Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 32 / 48
Abstractions for Scheduling-TPNs The State Class Graph State Class 0 1 C = 0 , 2 1 SwTPNs: General polyhedron: A ¯ Θ ≤ B Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 32 / 48
Abstractions for Scheduling-TPNs The State Class Graph Over-approximation 0 1 C = 0 , 2 1 Over-approximation using the smallest englobing zone Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 33 / 48
Abstractions for Scheduling-TPNs The State Class Graph Over-approximation 0 1 C = 0 , 2 1 Over-approximation using the smallest englobing zone Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 33 / 48
Abstractions for Scheduling-TPNs The State Class Graph Computing the state class graph (normal) Let C = ( M , D ) and D = ( A . Θ ≤ B ). We fire t f . ◮ M ′ = M − • t f + t f • ◮ D ′ is computed by: ◮ for all enabled transitions t i s.t. Flow ( t i ) � = 0, constrain by θ f ≤ θ i ◮ for all enabled transitions t i s.t. Flow ( t i ) � = 0, θ ′ i = θ i − θ f ◮ eliminate variables for disabled transitions (e.g. using Fourier-Motzkin method [4]) ◮ add new variables for newly enabled transitions t i : α ( t i ) ≤ θ i ≤ β ( t i ) Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 34 / 48
Abstractions for Scheduling-TPNs The State Class Graph Computing the state class graph (round-robin) Let C = ( M , D ) and D = ( A . Θ ≤ B ). We fire t f . ◮ M ′ = M − • t f + t f • ◮ D ′ is computed by: ◮ for all enabled transitions t i s.t. Flow ( t i ) � = 0, constrain by θ f ≤ θ i i = θ i − Flow ( t j ) ◮ for all enabled transitions t i s.t. Flow ( t i ) � = 0, θ ′ Flow ( t f ) θ f ◮ eliminate variables for disabled transitions (e.g. using Fourier-Motzkin method [4]) ◮ add new variables for newly enabled transitions t i : α ( t i ) ≤ θ i ≤ β ( t i ) Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 35 / 48
Abstractions for Scheduling-TPNs The State Class Graph Computing the state class graph (earliest deadline first) Let C = ( M , D ) and D = ( A . Θ ≤ B ). We fire t f . ◮ M ′ = M − • t f + t f • ◮ D ′ is computed by: ◮ for all enabled transitions t i s.t. Flow ( t i ) � = 0, constrain by θ f ≤ θ i ◮ for all enabled transitions t i s.t. Flow ( t i ) � = 0, θ ′ i = θ i − θ f ◮ eliminate variables for disabled transitions (e.g. using Fourier-Motzkin method [4]) ◮ add new variables for newly enabled transitions t i : α ( t i ) ≤ θ i ≤ β ( t i ) ◮ partition D with D τ ≤ D τ ′ and D τ > D τ ′ Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 36 / 48
Abstractions for Scheduling-TPNs The State Class Graph Example 4 ≤ θ 1 ≤ 5 { P 1 , P 2 , P 4 } C 0 θ 2 = 1 2 ≤ θ 4 ≤ 4 • • P 1 P 2 T 2 3 ≤ θ 1 ≤ 4 { P 2 , P 3 , P 4 } C 1 1 ≤ θ 3 ≤ 2 t 1 [4 , 5] t 2 [1 , 1] 1 ≤ θ 4 ≤ 3 T 3 T 4 3 ≤ θ 1 . . . { P 1 , P 4 } C 2 { P 1 , P 3 } C 3 0 ≤ θ 3 ≤ 1 • P 4 P 3 θ 1 + θ 3 ≤ 5 T 4 T 3 . . . . . . { P 1 } { P 1 } C 4 C 5 t 4 [2 , 4] t 3 [1 , 2] T 1 T 1 . . . C 6 ∅ Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 37 / 48
Abstractions for Scheduling-TPNs Polyhedra On Demand! The Way of the Middle (1/2) For IHTPNs: ◮ The polyhedron in the initial state class is always a zone . ◮ The successor of a non-zone polyhedron might be a zone ◮ The successor of a zone might not be a zone Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 38 / 48
Abstractions for Scheduling-TPNs Polyhedra On Demand! The Way of the Middle (1/2) For IHTPNs: ◮ The polyhedron in the initial state class is always a zone . ◮ The successor of a non-zone polyhedron might be a zone ◮ The successor of a zone might not be a zone We want to start to compute with zones and fall back to general polyhedra when needed (and return to zones asap). Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 38 / 48
Abstractions for Scheduling-TPNs Polyhedra On Demand! The Way of the Middle (1/2) For IHTPNs: ◮ The polyhedron in the initial state class is always a zone . ◮ The successor of a non-zone polyhedron might be a zone ( easy to check : O ( n 2 )) ◮ The successor of a zone might not be a zone ( not so easy to check ) We want to start to compute with zones and fall back to general polyhedra when needed (and return to zones asap). Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 38 / 48
Abstractions for Scheduling-TPNs Polyhedra On Demand! Abstractions: The Way of the Middle (2/2) D = [ d ij ] i , j ∈ [0 .. n ] and ( M ′ , D ′ ) = AbstractSuccessor (( M , D ) , t f ). D ′ is not a zone iff there are at least three enabled transitions t i , t j , t k in D such that: 1. t i , t j , t k are not disabled when firing t f ; 2. Flow ( t i ) � = 0 and Flow ( t k ) � = 0; 3. Flow ( t j ) = 0; 4. d j 0 + d ki > d k 0 + d ji or d 0 j − d ik < d 0 k − d ij Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 39 / 48
Abstractions for Scheduling-TPNs Polyhedra On Demand! Abstractions: The Way of the Middle (2/2) D = [ d ij ] i , j ∈ [0 .. n ] and ( M ′ , D ′ ) = AbstractSuccessor (( M , D ) , t f ). D ′ is not a zone iff there are at least three enabled transitions t i , t j , t k in D such that: 1. t i , t j , t k are not disabled when firing t f ; 2. Flow ( t i ) � = 0 and Flow ( t k ) � = 0; 3. Flow ( t j ) = 0; 4. d j 0 + d ki > d k 0 + d ji or d 0 j − d ik < d 0 k − d ij Complexity : O ( n 3 ) Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 39 / 48
Verifying properties Plan I Introduction Time Petri Nets with Stopwatches (and more) Abstractions for Scheduling-TPNs Verifying properties Observers Model-checking Conclusion and Future Work Didier Lime (IRCCyN / ECN) ETR 2007 5 septembre 2007 40 / 48
Recommend
More recommend