Classic DEVS An Introduction Using PythonPDEVS Yentl Van Tendeloo, - - PowerPoint PPT Presentation

β–Ά
classic devs
SMART_READER_LITE
LIVE PREVIEW

Classic DEVS An Introduction Using PythonPDEVS Yentl Van Tendeloo, - - PowerPoint PPT Presentation

Classic DEVS An Introduction Using PythonPDEVS Yentl Van Tendeloo, Hans Vangheluwe Introduction Bernard P . Zeigler. Bernard P . Zeigler. Bernard P . Zeigler, Herbert Praehofer, Theory Of Modelling And Simulation . Multifacetted Modelling


slide-1
SLIDE 1

Classic DEVS

An Introduction Using PythonPDEVS Yentl Van Tendeloo, Hans Vangheluwe

slide-2
SLIDE 2

Introduction

slide-3
SLIDE 3

Bernard P . Zeigler. Theory Of Modelling And Simulation. 1st ed. Wiley, 1976. Bernard P . Zeigler, Herbert Praehofer, and Tag Gon Kim. Theory Of Modelling And Simulation. 2nd ed. Academic Press, 2000. Bernard P . Zeigler. Multifacetted Modelling and Discrete Event Simulation. 1st ed. Academic Press, 1984.

slide-4
SLIDE 4

Yentl Van Tendeloo and Hans Vangheluwe. An Evaluation of DEVS Simulation Tools. Simulation: Transactions of the Society for Modeling and Simulation International. 2017, 93(2): 103-121 Yentl Van Tendeloo and Hans Vangheluwe. An Overview of PythonPDEVS. In Proceedings of JournΓ©es DEVS Francophones (JDF), pages 59-66, 2016.

slide-5
SLIDE 5

Our presentation uses initialized DEVS models, which contain an initial state. The initial state was left implicit in the original DEVS specification.

slide-6
SLIDE 6

DEVS GPSS Meijin++ SimScript Sequential Discrete Event Language … = modular simulation assembly language

slide-7
SLIDE 7

Vangheluwe, Hans. DEVS as a common denominator for multi-formalism hybrid systems modelling. In proceedings of the International Symposium on Computer-Aided Control System Design, pp. 129-134. 2000.

slide-8
SLIDE 8

t t X Y 𝑦1 𝑦2 𝑧1 𝑧2

finite number of non-𝜚 events

𝜚 𝜚

in a finite time interval

slide-9
SLIDE 9

t t t X S Y 𝑦1 𝑦2 𝑧1 𝑧2 𝑑1 𝑑2 𝑑3 𝑑4 𝜚 𝜚

slide-10
SLIDE 10
slide-11
SLIDE 11

Experimentation

slide-12
SLIDE 12

Simulation

Experiment π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’ = 60𝑑 π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯ = 3𝑑 π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ = 57𝑑 π‘Ÿπ‘—π‘œπ‘—π‘’,π‘šπ‘—π‘•β„Žπ‘’1 = π‘•π‘ π‘“π‘“π‘œ, 0 π‘Ÿπ‘—π‘œπ‘—π‘’,π‘žπ‘π‘š1 = (π‘—π‘’π‘šπ‘“, 280) π‘‘π‘π‘œπ‘’π‘’π‘“π‘ π‘›π‘—π‘œπ‘π‘’π‘—π‘π‘œ = (𝑒𝑑𝑗𝑛 β‰₯ π‘’π‘“π‘œπ‘’) π‘’π‘“π‘œπ‘’ = 24β„Ž Trace Model Solver Model Simulator

slide-13
SLIDE 13

from pypdevs.simulator import Simulator from mymodel import MyModel model = MyModel(\ q_init_pol1 = (β€œidle”, 280), q_init_light1 = (β€œgreen”, 0), delay_red = 60, delay_yellow = 3, delay_green = 57 ) simulator = Simulator(model) simulator.setTerminationTime(24*60*60) simulator.setClassicDEVS() simulator.setVerbose() simulator.simulate() simple_experiment.py Concrete Syntax

slide-14
SLIDE 14

__ Current Time: 0.00 __________________________________________ INITIAL CONDITIONS in model <system.light> Initial State: green Next scheduled internal transition at time 57.00 INITIAL CONDITIONS in model <system.policeman> Initial State: idle Next scheduled internal transition at time 20.00

slide-15
SLIDE 15

__ Current Time: 20.00 __________________________________________ EXTERNAL TRANSITION in model <system.light> Input Port Configuration: port <interrupt>: toManual New State: going_manual Next scheduled internal transition at time 20.0 INTERNAL TRANSITION in model <system.policeman> New State: working Output Port Configuration: port <output>: go_to_work Next scheduled internal transition at time 3620.00

slide-16
SLIDE 16

__ Current Time: 20.00 __________________________________________ INTERNAL TRANSITION in model <system.light> Output Port Configuration: port <observer>: turn_off New State: manual Next scheduled internal transition at time inf

slide-17
SLIDE 17

__ Current Time: 3620.00 __________________________________________ EXTERNAL TRANSITION in model <system.light> Input Port Configuration: port <interrupt>: toAuto New State: going_auto Next scheduled internal transition at time 3620.00 INTERNAL TRANSITION in model <system.policeman> New State: idle Output Port Configuration: port <output>: take_break Next scheduled internal transition at time 3920.00

slide-18
SLIDE 18

Atomic Models

slide-19
SLIDE 19

t t X Y 𝑦1 𝑦2 𝑧1 𝑧2

?

𝜚 𝜚

slide-20
SLIDE 20

Modelling Discrete Event Behaviour

Finite State Automaton Timed Event Scheduling Graph

toRed toGreen toYellow

red green yellow

schedule in π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯ schedule in π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’ schedule in π‘’π‘“π‘šπ‘π‘§_π‘•π‘ π‘“π‘“π‘œ

𝑓 = 0𝑑 toRed toYellow toGreen 𝑓 = 0𝑑

red π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’ yellow π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯ green π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ

slide-21
SLIDE 21

X Y t t S t

57 60 120 177

red yellow green

red π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’ yellow π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯ green π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ

slide-22
SLIDE 22

𝑇 : set of sequential states 𝑇 = {red, yellow, green} πœ€π‘—π‘œπ‘’ : 𝑇 β†’ 𝑇 πœ€π‘—π‘œπ‘’ = {red β†’ green, green β†’ yellow, yellow β†’ red} 𝑒𝑏 : S β†’ ℝ0,+∞

+

𝑒𝑏 = {red β†’ π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’, green β†’ π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ, yellow β†’ π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯} 𝑁 = , , , 𝑇 πœ€π‘—π‘œπ‘’ 𝑒𝑏

Autonomous (no input)

red π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’ yellow π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯ green π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ

slide-23
SLIDE 23

Time Advance: corner cases

𝑒𝑏 : S β†’ ℝ0,+∞

+

𝑒𝑏 𝑑𝑗 = +∞ passive states 𝑒𝑏 𝑑𝑗 = 0 transient states

!

slide-24
SLIDE 24

Elapsed time

e t 𝑒𝑏(π‘•π‘ π‘“π‘“π‘œ) 𝑒𝑏(π‘§π‘“π‘šπ‘šπ‘π‘₯) 𝑒𝑏(𝑠𝑓𝑒)

… …

enter red enter green enter yellow

slide-25
SLIDE 25

Elapsed time

S t

red yellow green

… …

ta(𝑑𝑗) πœπ‘— 𝑓𝑗

slide-26
SLIDE 26

Initialization of Initial State

S t

red yellow green

𝑒𝑏(𝑑0) 𝑓0 𝜏0 𝑑0, 0 π‘Ÿπ‘—π‘œπ‘—π‘’ = 𝑑0, 𝑓0 𝑑0, 𝑒𝑏 𝑑0

slide-27
SLIDE 27

Elapsed time

e t 𝑒𝑏(π‘•π‘ π‘“π‘“π‘œ) 𝑒𝑏(π‘§π‘“π‘šπ‘šπ‘π‘₯) 𝑒𝑏(𝑠𝑓𝑒) 𝑓0 𝑒𝑏 𝑑0 enter red enter green enter yellow enter yellow

slide-28
SLIDE 28

𝑇 : set of sequential states 𝑇 = {red, yellow, green} πœ€π‘—π‘œπ‘’ : 𝑇 β†’ 𝑇 πœ€π‘—π‘œπ‘’ = {red β†’ green, green β†’ yellow, yellow β†’ red} 𝑒𝑏 : S β†’ ℝ0,+∞

+

𝑒𝑏 = {red β†’ π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’, green β†’ π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ, yellow β†’ π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯} 𝑁 = , , , 𝑇 πœ€π‘—π‘œπ‘’ 𝑒𝑏 π‘Ÿπ‘—π‘œπ‘—π‘’ π‘Ÿπ‘—π‘œπ‘—π‘’ : 𝑅 – set of total states 𝑅 = 𝑑, 𝑓 𝑑 ∈ 𝑇, 0 ≀ 𝑓 ≀ 𝑒𝑏(𝑑) π‘Ÿπ‘—π‘œπ‘—π‘’ = (green, 0)

Autonomous (no output)

𝑓 = 0𝑑 red π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’ yellow π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯ green π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ

slide-29
SLIDE 29

𝑇 = {red, yellow, green} πœ€π‘—π‘œπ‘’ = { red β†’ green, green β†’ yellow, yellow β†’ red} 𝑒𝑏 = {red β†’ π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’, green β†’ π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ, yellow β†’ π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯} π‘Ÿπ‘—π‘œπ‘—π‘’ = (green, 0) time = 0 current_state = initial_state last_time = -initial_elapsed while not termination_condition(): time = last_time + ta(current_state) current_state = πœ€π‘—π‘œπ‘’(current_state) last_time = time Operational Semantics

from pypdevs.DEVS import * class TrafficLightAutonomous(AtomicDEVS): def __init__(self, q_init, delay_green, delay_yellow, delay_red): AtomicDEVS.__init__(self, β€œlight”) self.state, self.elapsed = q_init self.delay_green = delay_green self.delay_yellow = delay_yellow self.delay_red = delay_red def intTransition(self): state = self.state return {β€œred”: β€œgreen”, β€œyellow”: β€œred”, β€œgreen”: β€œyellow”}[state] def timeAdvance(self): state = self.state return {β€œred”: self.delay_red, β€œyellow”: self.delay_yellow, β€œgreen”: self.delay_green}[state]

atomic_int.py Concrete Syntax Abstract Syntax

slide-30
SLIDE 30

__ Current Time: 0.00 __________________________________________ INITIAL CONDITIONS in model <light> Initial State: green Next scheduled internal transition at time 57.00 __ Current Time: 57.00 __________________________________________ INTERNAL TRANSITION in model <light> New State: yellow Output Port Configuration: Next scheduled internal transition at time 60.00 __ Current Time: 60.00 __________________________________________ INTERNAL TRANSITION in model <light> New State: red Output Port Configuration: Next scheduled internal transition at time 120.00

slide-31
SLIDE 31

!show_red !show_yellow !show_green X S Y t t t

57 60 120 177

red yellow green show_red show_yellow show_green

𝑓 = 0𝑑 red π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’ yellow π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯ green π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ

slide-32
SLIDE 32

!show_red !show_yellow !show_green X S Y t t t

57 60 120 177

red yellow green show_red show_yellow show_green

𝑓 = 0𝑑 red π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’ yellow π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯ green π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ

slide-33
SLIDE 33

!show_red !show_yellow !show_green 𝑇 = {red, yellow, green} πœ€π‘—π‘œπ‘’ = { red β†’ green, green β†’ yellow, yellow β†’ red} π‘Ÿπ‘—π‘œπ‘—π‘’ = (green, 0) 𝑒𝑏 = {red β†’ π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’, green β†’ π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ, yellow β†’ π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯} 𝑍 : set of output events 𝑍 = {β€œshow_red”, β€œshow_green”, β€œshow_yellow”} πœ‡ : 𝑇 β†’ 𝑍 βˆͺ {𝜚} πœ‡ = { green β†’ β€œshow_yellow”, yellow β†’ β€œshow_red”, red β†’ β€œshow_green”} 𝑁 = , 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, , 𝑒𝑏 𝑍 πœ‡

Autonomous (with output)

𝑓 = 0𝑑 red π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’ yellow π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯ green π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ

slide-34
SLIDE 34

𝑇 = {red, yellow, green} π‘Ÿπ‘—π‘œπ‘—π‘’ = (green, 0) πœ€π‘—π‘œπ‘’ = { red β†’ green, green β†’ yellow, yellow β†’ red} 𝑒𝑏 = {red β†’ π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’, green β†’ π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ, yellow β†’ π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯} 𝑍 = {β€œshow_red”, β€œshow_green”, β€œshow_yellow”} πœ‡ = {green β†’ β€œshow_yellow”, yellow β†’ β€œshow_red”, red β†’ β€œshow_green”} time = 0 current_state = initial_state last_time = -initial_elapsed while not termination_condition(): time = last_time + ta(current_state)

  • utput(πœ‡(current_state))

current_state = πœ€π‘—π‘œπ‘’(current_state) last_time = time

Operational Semantics from pypdevs.DEVS import * class TrafficLightWithOutput(AtomicDEVS): def __init__(self, …): AtomicDEVS.__init__(self, β€œlight”) self.observe = self.addOutPort(β€œobserver”) … … def outputFnc(self): state = self.state if state == β€œred”: return {self.observe: β€œshow_green”} elif state == β€œyellow”: return {self.observe: β€œshow_red”} elif state == β€œgreen”: return {self.observe: β€œshow_yellow”} atomic_out.py Concrete Syntax Abstract Syntax

slide-35
SLIDE 35

__ Current Time: 0.00 __________________________________________ INITIAL CONDITIONS in model <light> Initial State: green Next scheduled internal transition at time 57.00 __ Current Time: 57.00 __________________________________________ INTERNAL TRANSITION in model <light> New State: yellow Output Port Configuration: port <observer>: show_yellow Next scheduled internal transition at time 60.00 __ Current Time: 60.00 __________________________________________ INTERNAL TRANSITION in model <light> New State: red Output Port Configuration: port <observer>: show_red Next scheduled internal transition at time 120.00

slide-36
SLIDE 36

!show_red !show_yellow !show_green ?toManual ?toManual ?toManual ?toAuto X S Y t t t

red manual green show_green toManual toAuto

𝑓 = 0𝑑

yellow

red π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’ yellow π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯ green π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ manual ∞

slide-37
SLIDE 37

!show_red !show_yellow ?toManual ?toManual ?toManual ?toAuto 𝑍 = {β€œshow_red”, β€œshow_green”, β€œshow_yellow”} 𝑇 = {red, yellow, green, manual} π‘Ÿπ‘—π‘œπ‘—π‘’ = (green, 0) πœ€π‘—π‘œπ‘’ = {red β†’ green, green β†’ yellow, yellow β†’ red} πœ‡ = {green β†’ β€œshow_yellow”, yellow β†’ β€œshow_red”, red β†’ β€œshow_green”} 𝑒𝑏 = {red β†’ π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’, green β†’ π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ, yellow β†’ π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯, manual β†’ +∞} πœ€π‘“π‘¦π‘’ : Q Γ— π‘Œ β†’ 𝑇 𝑅 = 𝑑, 𝑓 𝑑 ∈ 𝑇, 0 ≀ 𝑓 ≀ 𝑒𝑏(𝑑) πœ€π‘“π‘¦π‘’ = {( (*, *), β€œtoManual”) β†’ β€œmanual”, ( (β€œmanual”, *), β€œtoAuto”) β†’ β€œred”} π‘Œ : set of input events π‘Œ = {β€œtoAuto”, β€œtoManual”} π‘Œ πœ€π‘“π‘¦π‘’ 𝑁 = , 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, , πœ‡, 𝑒𝑏

Reactive

𝑓 = 0𝑑 red π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’ yellow π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯ green π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ manual ∞ !show_green

slide-38
SLIDE 38

𝑍 = {β€œshow_red”, β€œshow_green”, β€œshow_yellow”} 𝑇 = {red, yellow, green, manual} π‘Ÿπ‘—π‘œπ‘—π‘’ = (green, 0) πœ€π‘—π‘œπ‘’ = {red β†’ green, green β†’ yellow, yellow β†’ red} πœ‡ = {green β†’ β€œshow_yellow”, yellow β†’ β€œshow_red”, red β†’ β€œshow_green”} 𝑒𝑏 = {red β†’ π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’, green β†’ π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ, yellow β†’ π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯, manual β†’ ∞} π‘Œ = {β€œtoAuto”, β€œtoManual”} πœ€π‘“π‘¦π‘’ = {( (*, *), β€œtoManual”) β†’ manual, ( (manual, *), β€œtoAuto”) β†’ red}

time = 0 current_state = initial_state last_time = -initial_elapsed while not termination_condition(): next_time = last_time + ta(current_state) if time_next_ev <= next_time: e = time_next_ev – last_time time = time_next_ev current_state = πœ€π‘“π‘¦π‘’((current_state, e), next_ev) else: time = next_time

  • utput(πœ‡(current_state))

current_state = πœ€_π‘—π‘œπ‘’(current_state) last_time = time

Operational Semantics Abstract Syntax

slide-39
SLIDE 39

from pypdevs.DEVS import * class TrafficLight(AtomicDEVS): def __init__(self, …): AtomicDEVS.__init__(self, β€œlight”) self.interrupt = self.addInPort(β€œinterrupt”) … … def extTransition(self, inputs): inp = inputs[self.interrupt] if inp == β€œtoManual”: return β€œmanual” elif inp == β€œtoAuto”: if self.state == β€œmanual”: return β€œred” atomic_ext.py Concrete Syntax 𝑍 = {β€œshow_red”, β€œshow_green”, β€œshow_yellow”} 𝑇 = {red, yellow, green, manual} π‘Ÿπ‘—π‘œπ‘—π‘’ = (green, 0) πœ€π‘—π‘œπ‘’ = {red β†’ green, green β†’ yellow, yellow β†’ red} πœ‡ = {green β†’ β€œshow_yellow”, yellow β†’ β€œshow_red”, red β†’ β€œshow_green”} 𝑒𝑏 = {red β†’ π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’, green β†’ π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ, yellow β†’ π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯, manual β†’ ∞} π‘Œ = {β€œtoAuto”, β€œtoManual”} πœ€π‘“π‘¦π‘’ = {( (*, *), β€œtoManual”) β†’ manual, ( (manual, *), β€œtoAuto”) β†’ red} Abstract Syntax

slide-40
SLIDE 40

__ Current Time: 0.00 __________________________________________ INITIAL CONDITIONS in model <light> Initial State: green Next scheduled internal transition at time 57.00 __ Current Time: 57.00 __________________________________________ INTERNAL TRANSITION in model <light> New State: yellow Output Port Configuration: port <observer>: show_yellow Next scheduled internal transition at time 60.00 __ Current Time: 60.00 __________________________________________ INTERNAL TRANSITION in model <light> New State: red Output Port Configuration: port <observer>: show_red Next scheduled internal transition at time 120.00

slide-41
SLIDE 41

𝑅 = 𝑑, 𝑓 𝑑 ∈ 𝑇, 0 ≀ 𝑓 ≀ 𝑒𝑏(𝑑) 𝑓 = 0 𝑓 = 𝑒𝑏 𝑑 0 < 𝑓 < 𝑒𝑏(𝑑)

?

slide-42
SLIDE 42

!show_red !show_yellow !show_green ?toManual/ !turn_off ?toManual/ !turn_off ?toManual/ !turn_off ?toAuto/ !show_red 𝑓 = 0𝑑 red π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’ yellow π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯ green π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ manual ∞

slide-43
SLIDE 43

!show_red !show_yellow !show_green ?toManual/ !turn_off ?toManual/ !turn_off ?toManual/ !turn_off ?toAuto/ !show_red 𝑓 = 0𝑑 X S Y t t t

red manual green show_green toManual toAuto yellow show_red turn_off

red π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’ yellow π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯ green π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ manual ∞

slide-44
SLIDE 44

!show_red !show_yellow !show_green ?toManual/ !turn_off ?toManual/ !turn_off ?toManual/ !turn_off ?toAuto/ !show_red 𝑓 = 0𝑑 X S Y t t t

red manual green show_green toManual toAuto yellow show_red turn_off

red π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’ yellow π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯ green π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ manual ∞

time = 0 current_state = initial_state last_time = -initial_elapsed while not termination_condition(): next_time = last_time + ta(current_state) if time_next_ev <= next_time: e = time_next_ev – last_time time = time_next_ev current_state = πœ€π‘“π‘¦π‘’((current_state, e), next_ev) else: time = next_time

  • utput(πœ‡(current_state))

current_state = πœ€_π‘—π‘œπ‘’(current_state) last_time = time

slide-45
SLIDE 45

!show_red !show_yellow !show_green 𝑓 = 0𝑑 !show_red !turn_off ?toAuto ?toManual ?toManual ?toManual X S Y t t t

red manual green show_green toManual toAuto going_auto show_red turn_off going_manual

red π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’ yellow π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯ green π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ manual ∞

going_manual

0𝑑

going_auto

0𝑑

slide-46
SLIDE 46

𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏 π‘Œ : set of input events 𝑍 : set of output events 𝑇 : set of sequential states π‘Ÿπ‘—π‘œπ‘—π‘’ : 𝑅 𝑅 = 𝑑, 𝑓 𝑑 ∈ 𝑇, 0 ≀ 𝑓 ≀ 𝑒𝑏(𝑑) πœ€π‘—π‘œπ‘’ : 𝑇 β†’ 𝑇 πœ€π‘“π‘¦π‘’: 𝑅 Γ— π‘Œ β†’ 𝑇 πœ‡ : 𝑇 β†’ 𝑍 βˆͺ 𝜚 𝑒𝑏 : 𝑇 β†’ ℝ0,+∞

+

Full Atomic DEVS Specification

slide-47
SLIDE 47

S t (𝑑𝑗, 0) 𝑒𝑏 𝑑𝑗 (πœ€π‘“π‘¦π‘’ 𝑑𝑗, 𝑓 , 𝑦 , 0) (πœ€π‘—π‘œπ‘’(𝑑𝑗), 0) πœ€π‘“π‘¦π‘’ πœ€π‘—π‘œπ‘’

  • utput πœ‡(𝑑𝑗)

𝑒𝑗 𝑒𝑗 + 𝑓 𝑒𝑗 + 𝑒𝑏 𝑑𝑗 𝑓

slide-48
SLIDE 48

Coupled Models

slide-49
SLIDE 49

!show_red !show_yellow !show_green 𝑓 = 0𝑑 !show_red !turn_off ?toAuto ?toManual ?toManual ?toManual red π‘’π‘“π‘šπ‘π‘§π‘ π‘“π‘’ yellow π‘’π‘“π‘šπ‘π‘§π‘§π‘“π‘šπ‘šπ‘π‘₯ green π‘’π‘“π‘šπ‘π‘§π‘•π‘ π‘“π‘“π‘œ manual ∞

going_manual

0𝑑

going_auto

0𝑑

slide-50
SLIDE 50

work 3600s idle 300s !go_to_work !take_break 𝑓 = 280𝑑

slide-51
SLIDE 51

π‘΅π’Žπ’‹π’‰π’Šπ’–πŸ π‘΅π’’π’‘π’ŽπŸ π’•π’‡π’Žπ’ˆ 𝐷 = 𝐸, 𝑁𝑇 𝑁𝑇 = 𝑁𝑗 𝑗 ∈ 𝐸 𝑁𝑗 = π‘Œπ‘—, 𝑍

𝑗, 𝑇𝑗, π‘Ÿπ‘—π‘œπ‘—π‘’,𝑗, πœ€π‘—π‘œπ‘’,𝑗, πœ€π‘“π‘¦π‘’,𝑗, πœ‡π‘—, 𝑒𝑏𝑗 , βˆ€ 𝑗 ∈ 𝐸

slide-52
SLIDE 52

𝐸 = {π‘šπ‘—π‘•β„Žπ‘’1, π‘žπ‘π‘š1} π‘΅π’Žπ’‹π’‰π’Šπ’–πŸ π‘΅π’’π’‘π’ŽπŸ π’•π’‡π’Žπ’ˆ 𝐷 = 𝐸, 𝑁𝑇 𝑁𝑇 = 𝑁𝑗 𝑗 ∈ 𝐸 𝑁𝑗 = π‘Œπ‘—, 𝑍

𝑗, 𝑇𝑗, π‘Ÿπ‘—π‘œπ‘—π‘’,𝑗, πœ€π‘—π‘œπ‘’,𝑗, πœ€π‘“π‘¦π‘’,𝑗, πœ‡π‘—, 𝑒𝑏𝑗 , βˆ€ 𝑗 ∈ 𝐸

slide-53
SLIDE 53

π‘΅π’Žπ’‹π’‰π’Šπ’–πŸ π‘΅π’’π’‘π’ŽπŸ π’•π’‡π’Žπ’ˆ 𝐷 = π‘Œπ‘‘π‘“π‘šπ‘”, 𝑍

π‘‘π‘“π‘šπ‘”, 𝐸, 𝑁𝑇

𝑁𝑇 = 𝑁𝑗 𝑗 ∈ 𝐸 𝑁𝑗 = π‘Œπ‘—, 𝑍

𝑗, 𝑇𝑗, π‘Ÿπ‘—π‘œπ‘—π‘’,𝑗, πœ€π‘—π‘œπ‘’,𝑗, πœ€π‘“π‘¦π‘’,𝑗, πœ‡π‘—, 𝑒𝑏𝑗 , βˆ€ 𝑗 ∈ 𝐸

slide-54
SLIDE 54

𝐽𝑗 :Influencees of 𝑗 π‘΅π’Žπ’‹π’‰π’Šπ’–πŸ π‘΅π’’π’‘π’ŽπŸ π’•π’‡π’Žπ’ˆ 𝐷 = π‘Œπ‘‘π‘“π‘šπ‘”, 𝑍

π‘‘π‘“π‘šπ‘”, 𝐸, 𝑁𝑇, 𝐽𝑇

𝐽𝑇 = 𝐽𝑗 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝐽𝑗 βŠ† 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝑗 βˆ‰ 𝐽𝑗 𝑁𝑇 = 𝑁𝑗 𝑗 ∈ 𝐸 𝑁𝑗 = π‘Œπ‘—, 𝑍

𝑗, 𝑇𝑗, π‘Ÿπ‘—π‘œπ‘—π‘’,𝑗, πœ€π‘—π‘œπ‘’,𝑗, πœ€π‘“π‘¦π‘’,𝑗, πœ‡π‘—, 𝑒𝑏𝑗 , βˆ€ 𝑗 ∈ 𝐸

slide-55
SLIDE 55

𝐽𝑗 :Influencees of 𝑗 π‘΅π’Žπ’‹π’‰π’Šπ’–πŸ π‘΅π’’π’‘π’ŽπŸ π’•π’‡π’Žπ’ˆ π½π‘šπ‘—π‘•β„Žπ‘’1 = {π‘‘π‘“π‘šπ‘”} π½π‘žπ‘π‘š1 = {π‘šπ‘—π‘•β„Žπ‘’1} π½π‘‘π‘“π‘šπ‘” = {π‘šπ‘—π‘•β„Žπ‘’1} 𝐷 = π‘Œπ‘‘π‘“π‘šπ‘”, 𝑍

π‘‘π‘“π‘šπ‘”, 𝐸, 𝑁𝑇, 𝐽𝑇

𝐽𝑇 = 𝐽𝑗 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝐽𝑗 βŠ† 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝑗 βˆ‰ 𝐽𝑗 𝑁𝑇 = 𝑁𝑗 𝑗 ∈ 𝐸 𝑁𝑗 = π‘Œπ‘—, 𝑍

𝑗, 𝑇𝑗, π‘Ÿπ‘—π‘œπ‘—π‘’,𝑗, πœ€π‘—π‘œπ‘’,𝑗, πœ€π‘“π‘¦π‘’,𝑗, πœ‡π‘—, 𝑒𝑏𝑗 , βˆ€ 𝑗 ∈ 𝐸

slide-56
SLIDE 56

π‘΅π’Žπ’‹π’‰π’Šπ’–πŸ π‘΅π’’π’‘π’ŽπŸ π’•π’‡π’Žπ’ˆ

𝑍

π‘žπ‘π‘š1 = {𝑕𝑝_𝑒𝑝_π‘₯𝑝𝑠𝑙, 𝑒𝑏𝑙𝑓_𝑐𝑠𝑓𝑏𝑙}

π‘Œπ‘šπ‘—π‘•β„Žπ‘’1 = {π‘’π‘π‘π‘π‘œπ‘£π‘π‘š, 𝑒𝑝𝐡𝑣𝑒𝑝}

𝐷 = π‘Œπ‘‘π‘“π‘šπ‘”, 𝑍

π‘‘π‘“π‘šπ‘”, 𝐸, 𝑁𝑇, 𝐽𝑇, π‘Žπ‘‡

𝐽𝑇 = 𝐽𝑗 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝐽𝑗 βŠ† 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝑗 βˆ‰ 𝐽𝑗 π‘Žπ‘‡ = π‘Žπ‘—,π‘˜ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” , π‘˜ ∈ 𝐽𝑗 π‘Žπ‘‘π‘“π‘šπ‘”,π‘˜ ∢ π‘Œπ‘‘π‘“π‘šπ‘” β†’ π‘Œ

π‘˜, βˆ€ π‘˜ ∈ 𝐸

π‘Žπ‘—,π‘‘π‘“π‘šπ‘” ∢ 𝑍

𝑗 β†’ 𝑍 π‘‘π‘“π‘šπ‘”, βˆ€ 𝑗 ∈ 𝐸

π‘Žπ‘—,π‘˜ ∢ 𝑍

𝑗 β†’ π‘Œ π‘˜, βˆ€ 𝑗, π‘˜ ∈ 𝐸

𝑁𝑇 = 𝑁𝑗 𝑗 ∈ 𝐸 𝑁𝑗 = π‘Œπ‘—, 𝑍

𝑗, 𝑇𝑗, π‘Ÿπ‘—π‘œπ‘—π‘’,𝑗, πœ€π‘—π‘œπ‘’,𝑗, πœ€π‘“π‘¦π‘’,𝑗, πœ‡π‘—, 𝑒𝑏𝑗 , βˆ€ 𝑗 ∈ 𝐸

slide-57
SLIDE 57

π‘΅π’Žπ’‹π’‰π’Šπ’–πŸ π‘΅π’’π’‘π’ŽπŸ π’•π’‡π’Žπ’ˆ

take_break οƒ  toAuto go_to_work οƒ  toManual

𝐷 = π‘Œπ‘‘π‘“π‘šπ‘”, 𝑍

π‘‘π‘“π‘šπ‘”, 𝐸, 𝑁𝑇, 𝐽𝑇, π‘Žπ‘‡

𝐽𝑇 = 𝐽𝑗 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝐽𝑗 βŠ† 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝑗 βˆ‰ 𝐽𝑗 π‘Žπ‘‡ = π‘Žπ‘—,π‘˜ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” , π‘˜ ∈ 𝐽𝑗 π‘Žπ‘‘π‘“π‘šπ‘”,π‘˜ ∢ π‘Œπ‘‘π‘“π‘šπ‘” β†’ π‘Œ

π‘˜, βˆ€ π‘˜ ∈ 𝐸

π‘Žπ‘—,π‘‘π‘“π‘šπ‘” ∢ 𝑍

𝑗 β†’ 𝑍 π‘‘π‘“π‘šπ‘”, βˆ€ 𝑗 ∈ 𝐸

π‘Žπ‘—,π‘˜ ∢ 𝑍

𝑗 β†’ π‘Œ π‘˜, βˆ€ 𝑗, π‘˜ ∈ 𝐸

𝑁𝑇 = 𝑁𝑗 𝑗 ∈ 𝐸 𝑁𝑗 = π‘Œπ‘—, 𝑍

𝑗, 𝑇𝑗, π‘Ÿπ‘—π‘œπ‘—π‘’,𝑗, πœ€π‘—π‘œπ‘’,𝑗, πœ€π‘“π‘¦π‘’,𝑗, πœ‡π‘—, 𝑒𝑏𝑗 , βˆ€ 𝑗 ∈ 𝐸

slide-58
SLIDE 58

𝐷 = π‘Œπ‘‘π‘“π‘šπ‘”, 𝑍

π‘‘π‘“π‘šπ‘”, 𝐸, 𝑁𝑇, 𝐽𝑇, π‘Žπ‘‡, π‘‘π‘“π‘šπ‘“π‘‘π‘’

𝐽𝑇 = 𝐽𝑗 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝐽𝑗 βŠ† 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝑗 βˆ‰ 𝐽𝑗 π‘Žπ‘‡ = π‘Žπ‘—,π‘˜ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” , π‘˜ ∈ 𝐽𝑗 π‘Žπ‘‘π‘“π‘šπ‘”,π‘˜ ∢ π‘Œπ‘‘π‘“π‘šπ‘” β†’ π‘Œ

π‘˜, βˆ€ π‘˜ ∈ 𝐸

π‘Žπ‘—,π‘‘π‘“π‘šπ‘” ∢ 𝑍

𝑗 β†’ 𝑍 π‘‘π‘“π‘šπ‘”, βˆ€ 𝑗 ∈ 𝐸

π‘Žπ‘—,π‘˜ ∢ 𝑍

𝑗 β†’ π‘Œ π‘˜, βˆ€ 𝑗, π‘˜ ∈ 𝐸

π‘‘π‘“π‘šπ‘“π‘‘π‘’ ∢ 2𝐸 β†’ 𝐸 βˆ€ 𝐹 βŠ† 𝐸, 𝐹 β‰  βˆ…: π‘‘π‘“π‘šπ‘“π‘‘π‘’ 𝐹 ∈ 𝐹 𝑁𝑇 = 𝑁𝑗 𝑗 ∈ 𝐸 𝑁𝑗 = π‘Œπ‘—, 𝑍

𝑗, 𝑇𝑗, π‘Ÿπ‘—π‘œπ‘—π‘’,𝑗, πœ€π‘—π‘œπ‘’,𝑗, πœ€π‘“π‘¦π‘’,𝑗, πœ‡π‘—, 𝑒𝑏𝑗 , βˆ€ 𝑗 ∈ 𝐸

π‘΅π’Žπ’‹π’‰π’Šπ’–πŸ π‘΅π’’π’‘π’ŽπŸ π’•π’‡π’Žπ’ˆ

take_break οƒ  toAuto go_to_work οƒ  toManual

slide-59
SLIDE 59

from pypdevs.DEVS import * from trafficlight import TrafficLight from policeman import Policeman def translate(in_evt): mapping = {β€œtake_break”: β€œtoAuto”, β€œgo_to_work”: β€œtoManual”} return mapping[in_evt] class TrafficLightSystem(CoupledDEVS): def __init__(self): CoupledDEVS.__init__(self, β€œsystem”) self.light = self.addSubModel(TrafficLight()) self.police = self.addSubModel(Policeman()) self.connectPorts(self.police.out, self.light.interrupt, translate) def select(self, immlist): if self.police in immlist: return self.police else: return self.light trafficlight_system.py Concrete Syntax

slide-60
SLIDE 60

__ Current Time: 0.00 __________________________________________ INITIAL CONDITIONS in model <system.light> Initial State: green Next scheduled internal transition at time 57.00 INITIAL CONDITIONS in model <system.policeman> Initial State: idle Next scheduled internal transition at time 20.00

slide-61
SLIDE 61

__ Current Time: 20.00 __________________________________________ EXTERNAL TRANSITION in model <system.light> Input Port Configuration: port <interrupt>: toManual New State: going_manual Next scheduled internal transition at time 20.0 INTERNAL TRANSITION in model <system.policeman> New State: working Output Port Configuration: port <output>: go_to_work Next scheduled internal transition at time 3620.00

slide-62
SLIDE 62

__ Current Time: 20.00 __________________________________________ INTERNAL TRANSITION in model <system.light> Output Port Configuration: port <observer>: turn_off New State: manual Next scheduled internal transition at time inf

slide-63
SLIDE 63

__ Current Time: 3620.00 __________________________________________ EXTERNAL TRANSITION in model <system.light> Input Port Configuration: port <interrupt>: toAuto New State: going_auto Next scheduled internal transition at time 3620.00 INTERNAL TRANSITION in model <system.policeman> New State: idle Output Port Configuration: port <output>: take_break Next scheduled internal transition at time 3920.00

slide-64
SLIDE 64

__ Current Time: 3620.00 __________________________________________ INTERNAL TRANSITION in model <system.light> Output Port Configuration: port <observer>: show_red New State: red Next scheduled internal transition at time 3680.00

slide-65
SLIDE 65

__ Current Time: 3620.00 __________________________________________ EXTERNAL TRANSITION in model <system.light> Input Port Configuration: port <interrupt>: toAuto New State: going_auto Next scheduled internal transition at time 3620.00 INTERNAL TRANSITION in model <system.policeman> New State: idle Output Port Configuration: port <output>: take_break Next scheduled internal transition at time 3920.00

slide-66
SLIDE 66

__ Current Time: 3920.00 __________________________________________ CONFLICT between models: <system.light> * <system.policeman> EXTERNAL TRANSITION in model <system.light> Input Port Configuration: port <interrupt>: toManual New State: going_manual Next scheduled internal transition at time 3920.00 INTERNAL TRANSITION in model <system.policeman> New State: work Output Port Configuration: port <output>: go_to_work Next scheduled internal transition at time 7520.00

slide-67
SLIDE 67

Closure under Coupling

slide-68
SLIDE 68

π‘΅π’Žπ’‹π’‰π’Šπ’–πŸ π‘΅π’’π’‘π’ŽπŸ π’•π’‡π’Žπ’ˆ

take_break οƒ  toAuto go_to_work οƒ  toManual

?

slide-69
SLIDE 69

?

𝐷𝑁 = π‘Œπ‘‘π‘“π‘šπ‘”, 𝑍

π‘‘π‘“π‘šπ‘”, 𝐸, 𝑁𝑇, 𝐽𝑇, π‘Žπ‘‡

π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏 flatten

slide-70
SLIDE 70
slide-71
SLIDE 71

π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2

slide-72
SLIDE 72

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

π‘Œ = π‘Œπ·π‘ 𝑍 = 𝑍

𝐷𝑁

slide-73
SLIDE 73

π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 𝑑1, 𝑓1 𝑑2, 𝑓2 𝑓2 𝑓1

slide-74
SLIDE 74

π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏 𝑇 = Γ—π‘—βˆˆπΈ 𝑅𝑗

CM

2 1

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 𝑑1, 𝑓1 𝑑2, 𝑓2 𝑓2 𝑓1

slide-75
SLIDE 75

π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 𝑑1, 𝑓1 = π‘Ÿπ‘—π‘œπ‘—π‘’,1 𝑑2, 𝑓2 = π‘Ÿπ‘—π‘œπ‘—π‘’,2 𝑓2 𝑓1 𝑒𝑏1 𝑑1 𝑒𝑏2 𝑑2

slide-76
SLIDE 76

π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 𝑑1, 𝑓1 = π‘Ÿπ‘—π‘œπ‘—π‘’,1 𝑑2, 𝑓2 = π‘Ÿπ‘—π‘œπ‘—π‘’,2 𝑓2 𝑓1 𝑒𝑏1 𝑑1 𝑒𝑏2 𝑑2 π‘Ÿπ‘—π‘œπ‘—π‘’ = π‘‘π‘—π‘œπ‘—π‘’, π‘“π‘—π‘œπ‘—π‘’

slide-77
SLIDE 77

π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 𝑑1, 𝑓1 = π‘Ÿπ‘—π‘œπ‘—π‘’,1 𝑑2, 𝑓2 = π‘Ÿπ‘—π‘œπ‘—π‘’,2 𝑓2 𝑓1 𝑒𝑏1 𝑑1 𝑒𝑏2 𝑑2 π‘Ÿπ‘—π‘œπ‘—π‘’ = π‘‘π‘—π‘œπ‘—π‘’, π‘“π‘—π‘œπ‘—π‘’ π‘‘π‘—π‘œπ‘—π‘’ = … , π‘‘π‘—π‘œπ‘—π‘’,𝑗, π‘“π‘—π‘œπ‘—π‘’,𝑗 βˆ’ π‘“π‘—π‘œπ‘—π‘’ , …

slide-78
SLIDE 78

π‘“π‘—π‘œπ‘—π‘’ = min

π‘—βˆˆπΈ π‘“π‘—π‘œπ‘—π‘’,𝑗

π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 𝑑1, 𝑓1 = π‘Ÿπ‘—π‘œπ‘—π‘’,1 𝑑2, 𝑓2 = π‘Ÿπ‘—π‘œπ‘—π‘’,2 𝑓2 𝑓1 𝑒𝑏1 𝑑1 𝑒𝑏2 𝑑2 π‘Ÿπ‘—π‘œπ‘—π‘’ = π‘‘π‘—π‘œπ‘—π‘’, π‘“π‘—π‘œπ‘—π‘’ π‘‘π‘—π‘œπ‘—π‘’ = … , π‘‘π‘—π‘œπ‘—π‘’,𝑗, π‘“π‘—π‘œπ‘—π‘’,𝑗 βˆ’ π‘“π‘—π‘œπ‘—π‘’ , …

slide-79
SLIDE 79

π‘“π‘—π‘œπ‘—π‘’ = min

π‘—βˆˆπΈ π‘“π‘—π‘œπ‘—π‘’,𝑗

π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 𝑑1, 𝑓1 = π‘Ÿπ‘—π‘œπ‘—π‘’,1 𝑑2, 𝑓2 = π‘Ÿπ‘—π‘œπ‘—π‘’,2 𝑓2 𝑓1 𝑒𝑏1 𝑑1 𝑒𝑏2 𝑑2 π‘Ÿπ‘—π‘œπ‘—π‘’ = π‘‘π‘—π‘œπ‘—π‘’, π‘“π‘—π‘œπ‘—π‘’ π‘‘π‘—π‘œπ‘—π‘’,𝑗, π‘“π‘—π‘œπ‘—π‘’,𝑗 = π‘Ÿπ‘—π‘œπ‘—π‘’,𝑗 π‘‘π‘—π‘œπ‘—π‘’ = … , π‘‘π‘—π‘œπ‘—π‘’,𝑗, π‘“π‘—π‘œπ‘—π‘’,𝑗 βˆ’ π‘“π‘—π‘œπ‘—π‘’ , …

slide-80
SLIDE 80

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 𝑒𝑏1 𝑒𝑏2 𝑒 𝑓1 π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

slide-81
SLIDE 81

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 𝑒𝑏 ∢ 𝑇 β†’ ℝ0,+∞

+

𝑒𝑏 𝑑 = min

π‘—βˆˆπΈ πœπ‘— = 𝑒𝑏𝑗 𝑑𝑗 βˆ’ 𝑓𝑗

𝑒𝑏1 𝑒𝑏2 𝑒 𝑓1 𝜏1 𝜏2 π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

slide-82
SLIDE 82

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 𝑒𝑏 ∢ 𝑇 β†’ ℝ0,+∞

+

𝑒𝑏 𝑑 = min

π‘—βˆˆπΈ πœπ‘— = 𝑒𝑏𝑗 𝑑𝑗 βˆ’ 𝑓𝑗

𝐽𝑁𝑁 𝑑 = 𝑗 ∈ 𝐸 πœπ‘— = 𝑒𝑏(𝑑) π‘‘π‘“π‘šπ‘“π‘‘π‘’(𝐽𝑁𝑁 𝑑 ) = π‘—βˆ— 𝑒𝑏1 𝑒𝑏2 𝑒 𝑓1 𝜏1 𝜏2 π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

slide-83
SLIDE 83

π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 𝑒

slide-84
SLIDE 84

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 πœ‡ 𝑑 = ΰ΅π‘Žπ‘—βˆ—,π‘‘π‘“π‘šπ‘” πœ‡π‘—βˆ— π‘‘π‘—βˆ— βˆ… 𝑗𝑔 π‘‘π‘“π‘šπ‘” ∈ π½π‘—βˆ— 𝑗𝑔 π‘‘π‘“π‘šπ‘” βˆ‰ π½π‘—βˆ— 𝑒 π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

𝑧2

slide-85
SLIDE 85

π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 𝑒

𝑑1, 0 𝑑1, 𝑒𝑏1 𝑑1 𝑑2, 𝑓2 𝑑2, 𝑓2 + 𝑒𝑏 𝑑 = 𝑒𝑏2(𝑑2) 𝑑2

β€², 0

𝑒𝑏 𝑑

slide-86
SLIDE 86

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 πœ€π‘—π‘œπ‘’ 𝑑 = … , 𝑑

π‘˜ β€², 𝑓 π‘˜ β€² , …

𝑑

π‘˜ β€², 𝑓 π‘˜ β€² =

πœ€π‘—π‘œπ‘’,π‘˜ 𝑑

π‘˜ , 0

𝑔𝑝𝑠 π‘˜ = π‘—βˆ— ? 𝑔𝑝𝑠 π‘˜ ∈ π½π‘—βˆ— βˆ– π‘‘π‘“π‘šπ‘” 𝑑

π‘˜, 𝑓 π‘˜ + 𝑒𝑏 𝑑

π‘“π‘šπ‘‘π‘“ 𝑒

𝑑1, 0 𝑑1, 𝑒𝑏1 𝑑1 𝑑2, 𝑓2 𝑑2, 𝑓2 + 𝑒𝑏 𝑑 = 𝑒𝑏2(𝑑2) 𝑑2

β€², 0

π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

𝑒𝑏 𝑑

slide-87
SLIDE 87

𝑒 π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 πœ€π‘—π‘œπ‘’ 𝑑 = … , 𝑑

π‘˜ β€², 𝑓 π‘˜ β€² , …

𝑑

π‘˜ β€², 𝑓 π‘˜ β€² =

πœ€π‘—π‘œπ‘’,π‘˜ 𝑑

π‘˜ , 0

𝑔𝑝𝑠 π‘˜ = π‘—βˆ— πœ€π‘“π‘¦π‘’,π‘˜ 𝑑

π‘˜, 𝑓 π‘˜ + 𝑒𝑏 𝑑

, π‘Žπ‘—βˆ—,π‘˜ πœ‡π‘—βˆ— π‘‘π‘—βˆ— , 0 𝑔𝑝𝑠 π‘˜ ∈ π½π‘—βˆ— βˆ– π‘‘π‘“π‘šπ‘” 𝑑

π‘˜, 𝑓 π‘˜ + 𝑒𝑏 𝑑

π‘“π‘šπ‘‘π‘“

𝑑1, 𝑓1 𝑑1, 𝑓1 + 𝑒𝑏 𝑑 = 𝑒𝑏1(𝑑1) 𝑑2, 𝑓2 𝑑2, 𝑓2 + 𝑒𝑏 𝑑 ≀ 𝑒𝑏2 𝑑2 πœ€π‘—π‘œπ‘’ πœ€π‘“π‘¦π‘’ 𝑑1

β€², 0

𝑑2

β€², 0

π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

𝑧1 𝑦2

slide-88
SLIDE 88

π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 𝑒 𝑓 𝑓1

slide-89
SLIDE 89

π‘Œπ·π‘ 𝑍

𝐷𝑁

𝑇1 𝑇2 πœ€π‘“π‘¦π‘’ 𝑑, 𝑓 , 𝑦 = … , 𝑑𝑗

β€², 𝑓𝑗 β€² , …

𝑑𝑗

β€², 𝑓𝑗 β€² = ቐ πœ€π‘“π‘¦π‘’,𝑗

𝑑𝑗, 𝑓𝑗 + 𝑓 , π‘Žπ‘‘π‘“π‘šπ‘”,𝑗 𝑦 , 0 𝑔𝑝𝑠 𝑗 ∈ π½π‘‘π‘“π‘šπ‘” 𝑑𝑗, 𝑓𝑗 + 𝑓 π‘“π‘šπ‘‘π‘“ 𝑒 π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏

CM

2 1

π‘§π‘‘π‘“π‘šπ‘” 𝑓 𝑓1

slide-90
SLIDE 90

𝑇 = Γ—π‘—βˆˆπΈ 𝑅𝑗 𝑒𝑏 𝑑 = min

π‘—βˆˆπΈ πœπ‘— = 𝑒𝑏𝑗 𝑑𝑗 βˆ’ 𝑓𝑗

𝐽𝑁𝑁 𝑑 = 𝑗 ∈ 𝐸 πœπ‘— = 𝑒𝑏(𝑑) πœ‡ 𝑑 = ΰ΅π‘Žπ‘—βˆ—,π‘‘π‘“π‘šπ‘” πœ‡π‘—βˆ— π‘‘π‘—βˆ— 𝜚 𝑗𝑔 π‘‘π‘“π‘šπ‘” ∈ π½π‘—βˆ— 𝑗𝑔 π‘‘π‘“π‘šπ‘” βˆ‰ π½π‘—βˆ— πœ€π‘—π‘œπ‘’ 𝑑 = … , 𝑑

π‘˜ β€², 𝑓 π‘˜ β€² , …

𝑑𝑗

β€², 𝑓𝑗 β€² = ቐ πœ€π‘“π‘¦π‘’,𝑗

𝑑𝑗, 𝑓𝑗 + 𝑓 , π‘Žπ‘‘π‘“π‘šπ‘”,𝑗 𝑦 , 0 𝑔𝑝𝑠 𝑗 ∈ π½π‘‘π‘“π‘šπ‘” 𝑑𝑗, 𝑓𝑗 + 𝑓 π‘“π‘šπ‘‘π‘“ π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿπ‘—π‘œπ‘—π‘’, πœ€π‘—π‘œπ‘’, πœ€π‘“π‘¦π‘’, πœ‡, 𝑒𝑏 π‘“π‘—π‘œπ‘—π‘’ = min

π‘—βˆˆπΈ π‘“π‘—π‘œπ‘—π‘’,𝑗

π‘Ÿπ‘—π‘œπ‘—π‘’ = π‘‘π‘—π‘œπ‘—π‘’, π‘“π‘—π‘œπ‘—π‘’ ∈ 𝑅 𝑑

π‘˜ β€², 𝑓 π‘˜ β€² =

πœ€π‘—π‘œπ‘’,π‘˜ 𝑑

π‘˜ , 0

𝑔𝑝𝑠 π‘˜ = π‘—βˆ— πœ€π‘“π‘¦π‘’,π‘˜ 𝑑

π‘˜, 𝑓 π‘˜ + 𝑒𝑏 𝑑

, π‘Žπ‘—βˆ—,π‘˜ πœ‡π‘—βˆ— π‘‘π‘—βˆ— , 0 𝑔𝑝𝑠 π‘˜ ∈ π½π‘—βˆ— 𝑑

π‘˜, 𝑓 π‘˜ + 𝑒𝑏 𝑑

π‘“π‘šπ‘‘π‘“ π‘Œ = π‘Œπ·π‘ 𝑍 = 𝑍

𝐷𝑁

π‘‘π‘—π‘œπ‘—π‘’,𝑗, π‘“π‘—π‘œπ‘—π‘’,𝑗 = π‘Ÿπ‘—π‘œπ‘—π‘’,𝑗 π‘‘π‘—π‘œπ‘—π‘’ = (… , π‘‘π‘—π‘œπ‘—π‘’,𝑗, π‘“π‘—π‘œπ‘—π‘’,𝑗 βˆ’ π‘“π‘—π‘œπ‘—π‘’ , … ) 𝑅 = 𝑑, 𝑓 𝑑 ∈ 𝑇, 0 ≀ 𝑓 ≀ 𝑒𝑏(𝑑) π‘—βˆ— = π‘‘π‘“π‘šπ‘“π‘‘π‘’(𝐽𝑁𝑁 𝑑 ) πœ€π‘“π‘¦π‘’ 𝑑, 𝑓 , 𝑦 = … , 𝑑𝑗

β€², 𝑓𝑗 β€² , …

slide-91
SLIDE 91

Hierarchical Simulator

slide-92
SLIDE 92

(done, t) (*, t) (y, t) (x, t) (*, t) (done, t) (done, t)

Root coordinator Coordinator Simulator Simulator Coupled DEVS Atomic DEVS Atomic DEVS

(i, t) (done, t) (done, t) (i, t) (done, t)

slide-93
SLIDE 93
slide-94
SLIDE 94
slide-95
SLIDE 95
slide-96
SLIDE 96
slide-97
SLIDE 97

DEVS Semantics

Atomic DEVS Coupled DEVS Operational Semantics Denotational Semantics Abstract Simulator [1] Hierarchical Simulator Closure under Coupling [1] Ashvin Radiya and Robert G. Sargent. A logic-based foundation of discrete event modeling and simulation. ACM Transactions on Modeling and Computer Simulation, 1(1):3-51, 1994.

slide-98
SLIDE 98

Conclusions

 Atomic DEVS  Coupled DEVS  Closure under coupling  Abstract Simulator

(i,t) (x, t) (y, t) (*, t) (done, t) π‘΅π’Žπ’‹π’‰π’Šπ’–πŸ π‘΅π’’π’‘π’ŽπŸ π’•π’‡π’Žπ’ˆ

take_break οƒ  toAuto go_to_work οƒ  toManual

slide-99
SLIDE 99

http://msdl.cs.mcgill.ca/projects/PythonPDEVS

slide-100
SLIDE 100

Limitations of Classic DEVS

 Parallel implementation

 Parallel DEVS [1]

 Select function is artificial

 Parallel DEVS [1]

 Dynamic Structure systems

 Dynamic Structure DEVS [2]

[1] A.C.-H. Chow. Parallel DEVS: A parallel, hierarchical, modular modeling formalism and its distributed simulator. Transactions of the Society for Computer Simulation International, 13(2):55-68, 1996. [2] F . Barros. The dynamic structure discrete event system specification formalism. Transactions of the Society for Computer Simulation International, 13(1):35-46, 1996.

slide-101
SLIDE 101

Formalisms

Dynamic Structure Real-time Cell DEVS Verification

Standardization

Tools Languages Interoperable

Performance

Algorithms Activity Distribution Parallel

Model libraries

Example Reusable

Applications

slide-102
SLIDE 102

http://msdl.cs.mcgill.ca/projects/PythonPDEVS