classic devs
play

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


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

  2. Abstract Syntax Concrete Syntax atomic_out.py 𝑇 = {red, yellow, green} π‘Ÿ π‘—π‘œπ‘—π‘’ = (green, 0) from pypdevs.DEVS import * πœ€ π‘—π‘œπ‘’ = { red β†’ green, green β†’ yellow, class TrafficLightWithOutput(AtomicDEVS): yellow β†’ red} def __init__( self, …): 𝑒𝑏 = {red β†’ π‘’π‘“π‘šπ‘π‘§ 𝑠𝑓𝑒 , AtomicDEVS.__init __(self, β€œlight”) green β†’ π‘’π‘“π‘šπ‘π‘§ π‘•π‘ π‘“π‘“π‘œ , self.observe = self.addOutPort (β€œobserver”) yellow β†’ π‘’π‘“π‘šπ‘π‘§ π‘§π‘“π‘šπ‘šπ‘π‘₯ } … 𝑍 = {β€œ show_red ”, β€œ show_green ”, … β€œ show_yellow ”} πœ‡ = {green β†’ β€œ show_yellow ”, def outputFnc(self): yellow β†’ β€œ show_red ”, state = self.state red β†’ β€œ show_green ”} if state == β€œred”: return {self.observe: β€œ show_green ”} Operational Semantics elif state == β€œyellow”: time = 0 return {self.observe: β€œ show_red ”} current_state = initial_state elif state == β€œgreen”: last_time = -initial_elapsed return {self.observe: β€œ show_yellow ”} while not termination_condition(): time = last_time + ta(current_state) output( πœ‡ (current_state)) current_state = πœ€ π‘—π‘œπ‘’ (current_state) last_time = time

  3. __ 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

  4. X toManual red π‘’π‘“π‘šπ‘π‘§ 𝑠𝑓𝑒 ?toManual toAuto t !show_red ?toAuto S manual !show_green red yellow manual yellow π‘’π‘“π‘šπ‘π‘§ π‘§π‘“π‘šπ‘šπ‘π‘₯ ∞ green ?toManual t !show_yellow Y show_green green ?toManual π‘’π‘“π‘šπ‘π‘§ π‘•π‘ π‘“π‘“π‘œ 𝑓 = 0𝑑 t

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

  6. Abstract Syntax 𝑍 = {β€œ show_red ”, β€œ show_green ”, β€œ show_yellow ”} Operational Semantics 𝑇 = {red, yellow, green, manual} time = 0 π‘Ÿ π‘—π‘œπ‘—π‘’ = (green, 0) current_state = initial_state πœ€ π‘—π‘œπ‘’ = {red β†’ green, last_time = -initial_elapsed green β†’ yellow, while not termination_condition(): yellow β†’ red} next_time = last_time + ta(current_state) πœ‡ = {green β†’ β€œ show_yellow ”, if time_next_ev <= next_time: yellow β†’ β€œ show_red ”, e = time_next_ev – last_time red β†’ β€œ show_green ”} time = time_next_ev 𝑒𝑏 = {red β†’ π‘’π‘“π‘šπ‘π‘§ 𝑠𝑓𝑒 , current_state = πœ€ 𝑓𝑦𝑒 ((current_state, e), next_ev) green β†’ π‘’π‘“π‘šπ‘π‘§ π‘•π‘ π‘“π‘“π‘œ , else: yellow β†’ π‘’π‘“π‘šπ‘π‘§ π‘§π‘“π‘šπ‘šπ‘π‘₯ , time = next_time manual β†’ ∞ } output( πœ‡ (current_state)) π‘Œ = {β€œ toAuto ”, β€œ toManual ”} current_state = πœ€ _ π‘—π‘œπ‘’ (current_state) πœ€ 𝑓𝑦𝑒 = {( (*, *), β€œ toManual ”) β†’ manual, last_time = time ( (manual, *), β€œ toAuto ”) β†’ red}

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

  8. __ 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

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

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

  11. X toManual red π‘’π‘“π‘šπ‘π‘§ 𝑠𝑓𝑒 ?toManual/ toAuto !turn_off t ?toAuto/ !show_red S !show_red manual !show_green red yellow manual yellow π‘’π‘“π‘šπ‘π‘§ π‘§π‘“π‘šπ‘šπ‘π‘₯ ∞ green ?toManual/ !turn_off t !show_yellow Y show_green green ?toManual/ show_red π‘’π‘“π‘šπ‘π‘§ π‘•π‘ π‘“π‘“π‘œ !turn_off turn_off 𝑓 = 0𝑑 t

  12. X toManual red π‘’π‘“π‘šπ‘π‘§ 𝑠𝑓𝑒 ?toManual/ toAuto !turn_off time = 0 current_state = initial_state t ?toAuto/ last_time = -initial_elapsed !show_red S !show_red while not termination_condition(): manual next_time = last_time + ta(current_state) !show_green if time_next_ev <= next_time: red yellow manual e = time_next_ev – last_time yellow π‘’π‘“π‘šπ‘π‘§ π‘§π‘“π‘šπ‘šπ‘π‘₯ time = time_next_ev ∞ green current_state = πœ€ 𝑓𝑦𝑒 ((current_state, e), next_ev) ?toManual/ else: !turn_off t time = next_time !show_yellow output( πœ‡ (current_state)) Y current_state = πœ€ _ π‘—π‘œπ‘’ (current_state) last_time = time show_green green ?toManual/ show_red π‘’π‘“π‘šπ‘π‘§ π‘•π‘ π‘“π‘“π‘œ !turn_off turn_off 𝑓 = 0𝑑 t

  13. X !show_red red toManual going_auto 0𝑑 π‘’π‘“π‘šπ‘π‘§ 𝑠𝑓𝑒 toAuto !show_green t ?toAuto ?toManual !show_red S manual going_auto yellow manual going_manual π‘’π‘“π‘šπ‘π‘§ π‘§π‘“π‘šπ‘šπ‘π‘₯ ∞ red green t !show_yellow !turn_off ?toManual Y show_green green going_manual show_red π‘’π‘“π‘šπ‘π‘§ π‘•π‘ π‘“π‘“π‘œ 0𝑑 turn_off 𝑓 = 0𝑑 t ?toManual

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

  15. S (πœ€ 𝑓𝑦𝑒 𝑑 𝑗 , 𝑓 , 𝑦 , 0) πœ€ 𝑓𝑦𝑒 𝑓 (𝑑 𝑗 , 0) output πœ‡(𝑑 𝑗 ) 𝑒𝑏 𝑑 𝑗 πœ€ π‘—π‘œπ‘’ (πœ€ π‘—π‘œπ‘’ (𝑑 𝑗 ), 0) t 𝑒 𝑗 + 𝑓 𝑒 𝑗 𝑒 𝑗 + 𝑒𝑏 𝑑 𝑗

  16. Coupled Models

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

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

  19. π’•π’‡π’Žπ’ˆ 𝐷 = 𝐸, 𝑁𝑇 𝑡 π’Žπ’‹π’‰π’Šπ’–πŸ 𝑡 π’’π’‘π’ŽπŸ 𝑁𝑇 = 𝑁 𝑗 𝑗 ∈ 𝐸 𝑁 𝑗 = π‘Œ 𝑗 , 𝑍 𝑗 , 𝑇 𝑗 , π‘Ÿ π‘—π‘œπ‘—π‘’,𝑗 , πœ€ π‘—π‘œπ‘’,𝑗 , πœ€ 𝑓𝑦𝑒,𝑗 , πœ‡ 𝑗 , 𝑒𝑏 𝑗 , βˆ€ 𝑗 ∈ 𝐸

  20. 𝐸 = {π‘šπ‘—π‘•β„Žπ‘’ 1 , π‘žπ‘π‘š 1 } π’•π’‡π’Žπ’ˆ 𝐷 = 𝐸, 𝑁𝑇 𝑡 π’Žπ’‹π’‰π’Šπ’–πŸ 𝑡 π’’π’‘π’ŽπŸ 𝑁𝑇 = 𝑁 𝑗 𝑗 ∈ 𝐸 𝑁 𝑗 = π‘Œ 𝑗 , 𝑍 𝑗 , 𝑇 𝑗 , π‘Ÿ π‘—π‘œπ‘—π‘’,𝑗 , πœ€ π‘—π‘œπ‘’,𝑗 , πœ€ 𝑓𝑦𝑒,𝑗 , πœ‡ 𝑗 , 𝑒𝑏 𝑗 , βˆ€ 𝑗 ∈ 𝐸

  21. π’•π’‡π’Žπ’ˆ 𝐷 = π‘Œ π‘‘π‘“π‘šπ‘” , 𝑍 π‘‘π‘“π‘šπ‘” , 𝐸, 𝑁𝑇 𝑡 π’Žπ’‹π’‰π’Šπ’–πŸ 𝑡 π’’π’‘π’ŽπŸ 𝑁𝑇 = 𝑁 𝑗 𝑗 ∈ 𝐸 𝑁 𝑗 = π‘Œ 𝑗 , 𝑍 𝑗 , 𝑇 𝑗 , π‘Ÿ π‘—π‘œπ‘—π‘’,𝑗 , πœ€ π‘—π‘œπ‘’,𝑗 , πœ€ 𝑓𝑦𝑒,𝑗 , πœ‡ 𝑗 , 𝑒𝑏 𝑗 , βˆ€ 𝑗 ∈ 𝐸

  22. π’•π’‡π’Žπ’ˆ 𝐷 = π‘Œ π‘‘π‘“π‘šπ‘” , 𝑍 π‘‘π‘“π‘šπ‘” , 𝐸, 𝑁𝑇, 𝐽𝑇 𝑡 π’Žπ’‹π’‰π’Šπ’–πŸ 𝑡 π’’π’‘π’ŽπŸ 𝑁𝑇 = 𝑁 𝑗 𝑗 ∈ 𝐸 𝑁 𝑗 = π‘Œ 𝑗 , 𝑍 𝑗 , 𝑇 𝑗 , π‘Ÿ π‘—π‘œπ‘—π‘’,𝑗 , πœ€ π‘—π‘œπ‘’,𝑗 , πœ€ 𝑓𝑦𝑒,𝑗 , πœ‡ 𝑗 , 𝑒𝑏 𝑗 , βˆ€ 𝑗 ∈ 𝐸 𝐽𝑇 = 𝐽 𝑗 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝐽 𝑗 βŠ† 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝑗 βˆ‰ 𝐽 𝑗 𝐽 𝑗 : Influencees of 𝑗

  23. π’•π’‡π’Žπ’ˆ 𝐷 = π‘Œ π‘‘π‘“π‘šπ‘” , 𝑍 π‘‘π‘“π‘šπ‘” , 𝐸, 𝑁𝑇, 𝐽𝑇 𝑡 π’Žπ’‹π’‰π’Šπ’–πŸ 𝑡 π’’π’‘π’ŽπŸ 𝑁𝑇 = 𝑁 𝑗 𝑗 ∈ 𝐸 𝑁 𝑗 = π‘Œ 𝑗 , 𝑍 𝑗 , 𝑇 𝑗 , π‘Ÿ π‘—π‘œπ‘—π‘’,𝑗 , πœ€ π‘—π‘œπ‘’,𝑗 , πœ€ 𝑓𝑦𝑒,𝑗 , πœ‡ 𝑗 , 𝑒𝑏 𝑗 , βˆ€ 𝑗 ∈ 𝐸 𝐽𝑇 = 𝐽 𝑗 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝐽 𝑗 βŠ† 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝑗 βˆ‰ 𝐽 𝑗 𝐽 𝑗 : Influencees of 𝑗 𝐽 π‘‘π‘“π‘šπ‘” = {π‘šπ‘—π‘•β„Žπ‘’1} 𝐽 π‘žπ‘π‘š1 = {π‘šπ‘—π‘•β„Žπ‘’1} 𝐽 π‘šπ‘—π‘•β„Žπ‘’1 = {π‘‘π‘“π‘šπ‘”}

  24. 𝑍 π‘žπ‘π‘š1 = {𝑕𝑝_𝑒𝑝_π‘₯𝑝𝑠𝑙, 𝑒𝑏𝑙𝑓_𝑐𝑠𝑓𝑏𝑙} π’•π’‡π’Žπ’ˆ 𝐷 = π‘Œ π‘‘π‘“π‘šπ‘” , 𝑍 π‘‘π‘“π‘šπ‘” , 𝐸, 𝑁𝑇, 𝐽𝑇, π‘Žπ‘‡ 𝑡 π’Žπ’‹π’‰π’Šπ’–πŸ 𝑡 π’’π’‘π’ŽπŸ 𝑁𝑇 = 𝑁 𝑗 𝑗 ∈ 𝐸 𝑁 𝑗 = π‘Œ 𝑗 , 𝑍 𝑗 , 𝑇 𝑗 , π‘Ÿ π‘—π‘œπ‘—π‘’,𝑗 , πœ€ π‘—π‘œπ‘’,𝑗 , πœ€ 𝑓𝑦𝑒,𝑗 , πœ‡ 𝑗 , 𝑒𝑏 𝑗 , βˆ€ 𝑗 ∈ 𝐸 𝐽𝑇 = 𝐽 𝑗 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝐽 𝑗 βŠ† 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝑗 βˆ‰ 𝐽 𝑗 π‘Žπ‘‡ = π‘Ž 𝑗,π‘˜ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” , π‘˜ ∈ 𝐽 𝑗 π‘Ž π‘‘π‘“π‘šπ‘”,π‘˜ ∢ π‘Œ π‘‘π‘“π‘šπ‘” β†’ π‘Œ π‘˜ , βˆ€ π‘˜ ∈ 𝐸 π‘Ž 𝑗,π‘‘π‘“π‘šπ‘” ∢ 𝑍 𝑗 β†’ 𝑍 π‘‘π‘“π‘šπ‘” , βˆ€ 𝑗 ∈ 𝐸 π‘Ž 𝑗,π‘˜ ∢ 𝑍 𝑗 β†’ π‘Œ π‘˜ , βˆ€ 𝑗, π‘˜ ∈ 𝐸 π‘Œ π‘šπ‘—π‘•β„Žπ‘’1 = {π‘’π‘π‘π‘π‘œπ‘£π‘π‘š, 𝑒𝑝𝐡𝑣𝑒𝑝}

  25. π’•π’‡π’Žπ’ˆ 𝐷 = π‘Œ π‘‘π‘“π‘šπ‘” , 𝑍 π‘‘π‘“π‘šπ‘” , 𝐸, 𝑁𝑇, 𝐽𝑇, π‘Žπ‘‡ 𝑡 π’Žπ’‹π’‰π’Šπ’–πŸ 𝑡 π’’π’‘π’ŽπŸ 𝑁𝑇 = 𝑁 𝑗 𝑗 ∈ 𝐸 𝑁 𝑗 = π‘Œ 𝑗 , 𝑍 𝑗 , 𝑇 𝑗 , π‘Ÿ π‘—π‘œπ‘—π‘’,𝑗 , πœ€ π‘—π‘œπ‘’,𝑗 , πœ€ 𝑓𝑦𝑒,𝑗 , πœ‡ 𝑗 , 𝑒𝑏 𝑗 , βˆ€ 𝑗 ∈ 𝐸 𝐽𝑇 = 𝐽 𝑗 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝐽 𝑗 βŠ† 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝑗 βˆ‰ 𝐽 𝑗 π‘Žπ‘‡ = π‘Ž 𝑗,π‘˜ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” , π‘˜ ∈ 𝐽 𝑗 π‘Ž π‘‘π‘“π‘šπ‘”,π‘˜ ∢ π‘Œ π‘‘π‘“π‘šπ‘” β†’ π‘Œ π‘˜ , βˆ€ π‘˜ ∈ 𝐸 π‘Ž 𝑗,π‘‘π‘“π‘šπ‘” ∢ 𝑍 𝑗 β†’ 𝑍 π‘‘π‘“π‘šπ‘” , βˆ€ 𝑗 ∈ 𝐸 π‘Ž 𝑗,π‘˜ ∢ 𝑍 𝑗 β†’ π‘Œ π‘˜ , βˆ€ 𝑗, π‘˜ ∈ 𝐸 take_break οƒ  toAuto go_to_work οƒ  toManual

  26. π’•π’‡π’Žπ’ˆ 𝐷 = π‘Œ π‘‘π‘“π‘šπ‘” , 𝑍 π‘‘π‘“π‘šπ‘” , 𝐸, 𝑁𝑇, 𝐽𝑇, π‘Žπ‘‡, π‘‘π‘“π‘šπ‘“π‘‘π‘’ 𝑡 π’Žπ’‹π’‰π’Šπ’–πŸ 𝑡 π’’π’‘π’ŽπŸ 𝑁𝑇 = 𝑁 𝑗 𝑗 ∈ 𝐸 𝑁 𝑗 = π‘Œ 𝑗 , 𝑍 𝑗 , 𝑇 𝑗 , π‘Ÿ π‘—π‘œπ‘—π‘’,𝑗 , πœ€ π‘—π‘œπ‘’,𝑗 , πœ€ 𝑓𝑦𝑒,𝑗 , πœ‡ 𝑗 , 𝑒𝑏 𝑗 , βˆ€ 𝑗 ∈ 𝐸 𝐽𝑇 = 𝐽 𝑗 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝐽 𝑗 βŠ† 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” βˆ€ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” ∢ 𝑗 βˆ‰ 𝐽 𝑗 π‘Žπ‘‡ = π‘Ž 𝑗,π‘˜ 𝑗 ∈ 𝐸 βˆͺ π‘‘π‘“π‘šπ‘” , π‘˜ ∈ 𝐽 𝑗 π‘Ž π‘‘π‘“π‘šπ‘”,π‘˜ ∢ π‘Œ π‘‘π‘“π‘šπ‘” β†’ π‘Œ π‘˜ , βˆ€ π‘˜ ∈ 𝐸 π‘Ž 𝑗,π‘‘π‘“π‘šπ‘” ∢ 𝑍 𝑗 β†’ 𝑍 π‘‘π‘“π‘šπ‘” , βˆ€ 𝑗 ∈ 𝐸 π‘Ž 𝑗,π‘˜ ∢ 𝑍 𝑗 β†’ π‘Œ π‘˜ , βˆ€ 𝑗, π‘˜ ∈ 𝐸 π‘‘π‘“π‘šπ‘“π‘‘π‘’ ∢ 2 𝐸 β†’ 𝐸 βˆ€ 𝐹 βŠ† 𝐸, 𝐹 β‰  βˆ…: π‘‘π‘“π‘šπ‘“π‘‘π‘’ 𝐹 ∈ 𝐹 take_break οƒ  toAuto go_to_work οƒ  toManual

  27. Concrete Syntax trafficlight_system.py 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

  28. __ 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

  29. __ 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

  30. __ 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

  31. __ 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

  32. __ 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

  33. __ 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

  34. __ 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

  35. Closure under Coupling

  36. π’•π’‡π’Žπ’ˆ 𝑡 π’Žπ’‹π’‰π’Šπ’–πŸ 𝑡 π’’π’‘π’ŽπŸ take_break οƒ  toAuto go_to_work οƒ  toManual ?

  37. ? flatten 𝐷𝑁 = π‘Œ π‘‘π‘“π‘šπ‘” , 𝑍 π‘‘π‘“π‘šπ‘” , 𝐸, 𝑁𝑇, 𝐽𝑇, π‘Žπ‘‡ π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿ π‘—π‘œπ‘—π‘’ , πœ€ π‘—π‘œπ‘’ , πœ€ 𝑓𝑦𝑒 , πœ‡, 𝑒𝑏

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

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

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

  41. CM 1 π‘Œ 𝐷𝑁 2 𝑓 1 𝑇 1 𝑑 1 , 𝑓 1 π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿ π‘—π‘œπ‘—π‘’ , πœ€ π‘—π‘œπ‘’ , πœ€ 𝑓𝑦𝑒 , πœ‡, 𝑒𝑏 𝑇 2 𝑓 2 𝑇 = Γ— π‘—βˆˆπΈ 𝑅 𝑗 𝑑 2 , 𝑓 2 𝑍 𝐷𝑁

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

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

  44. CM 1 π‘Œ 𝐷𝑁 2 𝑓 1 𝑑 1 , 𝑓 1 = π‘Ÿ π‘—π‘œπ‘—π‘’,1 𝑇 1 𝑒𝑏 1 𝑑 1 π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿ π‘—π‘œπ‘—π‘’ , πœ€ π‘—π‘œπ‘’ , πœ€ 𝑓𝑦𝑒 , πœ‡, 𝑒𝑏 𝑇 2 𝑓 2 π‘Ÿ π‘—π‘œπ‘—π‘’ = 𝑑 π‘—π‘œπ‘—π‘’ , 𝑓 π‘—π‘œπ‘—π‘’ 𝑑 2 , 𝑓 2 = π‘Ÿ π‘—π‘œπ‘—π‘’,2 𝑑 π‘—π‘œπ‘—π‘’ = … , 𝑑 π‘—π‘œπ‘—π‘’,𝑗 , 𝑓 π‘—π‘œπ‘—π‘’,𝑗 βˆ’ 𝑓 π‘—π‘œπ‘—π‘’ , … 𝑒𝑏 2 𝑑 2 𝑍 𝐷𝑁

  45. CM 1 π‘Œ 𝐷𝑁 2 𝑓 1 𝑑 1 , 𝑓 1 = π‘Ÿ π‘—π‘œπ‘—π‘’,1 𝑇 1 𝑒𝑏 1 𝑑 1 π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿ π‘—π‘œπ‘—π‘’ , πœ€ π‘—π‘œπ‘’ , πœ€ 𝑓𝑦𝑒 , πœ‡, 𝑒𝑏 𝑇 2 𝑓 2 π‘Ÿ π‘—π‘œπ‘—π‘’ = 𝑑 π‘—π‘œπ‘—π‘’ , 𝑓 π‘—π‘œπ‘—π‘’ 𝑑 2 , 𝑓 2 = π‘Ÿ π‘—π‘œπ‘—π‘’,2 𝑑 π‘—π‘œπ‘—π‘’ = … , 𝑑 π‘—π‘œπ‘—π‘’,𝑗 , 𝑓 π‘—π‘œπ‘—π‘’,𝑗 βˆ’ 𝑓 π‘—π‘œπ‘—π‘’ , … 𝑒𝑏 2 𝑑 2 𝑓 π‘—π‘œπ‘—π‘’ = min π‘—βˆˆπΈ 𝑓 π‘—π‘œπ‘—π‘’,𝑗 𝑍 𝐷𝑁

  46. CM 1 π‘Œ 𝐷𝑁 2 𝑓 1 𝑑 1 , 𝑓 1 = π‘Ÿ π‘—π‘œπ‘—π‘’,1 𝑇 1 𝑒𝑏 1 𝑑 1 π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿ π‘—π‘œπ‘—π‘’ , πœ€ π‘—π‘œπ‘’ , πœ€ 𝑓𝑦𝑒 , πœ‡, 𝑒𝑏 𝑇 2 𝑓 2 π‘Ÿ π‘—π‘œπ‘—π‘’ = 𝑑 π‘—π‘œπ‘—π‘’ , 𝑓 π‘—π‘œπ‘—π‘’ 𝑑 2 , 𝑓 2 = π‘Ÿ π‘—π‘œπ‘—π‘’,2 𝑑 π‘—π‘œπ‘—π‘’ = … , 𝑑 π‘—π‘œπ‘—π‘’,𝑗 , 𝑓 π‘—π‘œπ‘—π‘’,𝑗 βˆ’ 𝑓 π‘—π‘œπ‘—π‘’ , … 𝑒𝑏 2 𝑑 2 𝑓 π‘—π‘œπ‘—π‘’ = min π‘—βˆˆπΈ 𝑓 π‘—π‘œπ‘—π‘’,𝑗 𝑑 π‘—π‘œπ‘—π‘’,𝑗 , 𝑓 π‘—π‘œπ‘—π‘’,𝑗 = π‘Ÿ π‘—π‘œπ‘—π‘’,𝑗 𝑍 𝐷𝑁

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

  48. CM 1 π‘Œ 𝐷𝑁 2 𝑇 1 𝑒𝑏 1 𝑓 1 𝜏 1 π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿ π‘—π‘œπ‘—π‘’ , πœ€ π‘—π‘œπ‘’ , πœ€ 𝑓𝑦𝑒 , πœ‡, 𝑒𝑏 𝑇 2 + 𝑒𝑏 ∢ 𝑇 β†’ ℝ 0,+∞ 𝑒𝑏 2 𝑒𝑏 𝑑 = min π‘—βˆˆπΈ 𝜏 𝑗 = 𝑒𝑏 𝑗 𝑑 𝑗 βˆ’ 𝑓 𝑗 𝜏 2 𝑍 𝐷𝑁 𝑒

  49. CM 1 π‘Œ 𝐷𝑁 2 𝑇 1 𝑒𝑏 1 𝑓 1 𝜏 1 π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿ π‘—π‘œπ‘—π‘’ , πœ€ π‘—π‘œπ‘’ , πœ€ 𝑓𝑦𝑒 , πœ‡, 𝑒𝑏 𝑇 2 + 𝑒𝑏 ∢ 𝑇 β†’ ℝ 0,+∞ 𝑒𝑏 2 𝑒𝑏 𝑑 = min π‘—βˆˆπΈ 𝜏 𝑗 = 𝑒𝑏 𝑗 𝑑 𝑗 βˆ’ 𝑓 𝑗 𝜏 2 𝐽𝑁𝑁 𝑑 = 𝑗 ∈ 𝐸 𝜏 𝑗 = 𝑒𝑏(𝑑) π‘‘π‘“π‘šπ‘“π‘‘π‘’(𝐽𝑁𝑁 𝑑 ) = 𝑗 βˆ— 𝑍 𝐷𝑁 𝑒

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

  51. CM 1 π‘Œ 𝐷𝑁 2 𝑇 1 𝑧 2 π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿ π‘—π‘œπ‘—π‘’ , πœ€ π‘—π‘œπ‘’ , πœ€ 𝑓𝑦𝑒 , πœ‡, 𝑒𝑏 𝑇 2 πœ‡ 𝑑 = ࡝ π‘Ž 𝑗 βˆ— ,π‘‘π‘“π‘šπ‘” πœ‡ 𝑗 βˆ— 𝑑 𝑗 βˆ— 𝑗𝑔 π‘‘π‘“π‘šπ‘” ∈ 𝐽 𝑗 βˆ— 𝑗𝑔 π‘‘π‘“π‘šπ‘” βˆ‰ 𝐽 𝑗 βˆ— βˆ… 𝑍 𝐷𝑁 𝑒

  52. CM 1 π‘Œ 𝐷𝑁 𝑒𝑏 𝑑 2 𝑇 1 𝑑 1 , 𝑒𝑏 1 𝑑 1 𝑑 1 , 0 π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿ π‘—π‘œπ‘—π‘’ , πœ€ π‘—π‘œπ‘’ , πœ€ 𝑓𝑦𝑒 , πœ‡, 𝑒𝑏 𝑇 2 β€² , 0 𝑑 2 𝑑 2 , 𝑓 2 𝑑 2 , 𝑓 2 + 𝑒𝑏 𝑑 = 𝑒𝑏 2 (𝑑 2 ) 𝑍 𝐷𝑁 𝑒

  53. CM 1 π‘Œ 𝐷𝑁 𝑒𝑏 𝑑 2 𝑇 1 𝑑 1 , 𝑒𝑏 1 𝑑 1 𝑑 1 , 0 π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿ π‘—π‘œπ‘—π‘’ , πœ€ π‘—π‘œπ‘’ , πœ€ 𝑓𝑦𝑒 , πœ‡, 𝑒𝑏 β€² , … 𝑇 2 β€² , 𝑓 πœ€ π‘—π‘œπ‘’ 𝑑 = … , 𝑑 β€² , 0 π‘˜ π‘˜ 𝑑 2 𝑔𝑝𝑠 π‘˜ = 𝑗 βˆ— πœ€ π‘—π‘œπ‘’,π‘˜ 𝑑 π‘˜ , 0 𝑑 2 , 𝑓 2 β€² = 𝑔𝑝𝑠 π‘˜ ∈ 𝐽 𝑗 βˆ— βˆ– π‘‘π‘“π‘šπ‘” ? β€² , 𝑓 𝑑 2 , 𝑓 2 + 𝑒𝑏 𝑑 = 𝑒𝑏 2 (𝑑 2 ) 𝑑 π‘˜ π‘˜ 𝑑 π‘˜ , 𝑓 π‘˜ + 𝑒𝑏 𝑑 π‘“π‘šπ‘‘π‘“ 𝑍 𝐷𝑁 𝑒

  54. 𝑦 2 CM 1 π‘Œ 𝐷𝑁 2 𝑧 1 𝑇 1 β€² , 0 𝑑 1 πœ€ π‘—π‘œπ‘’ 𝑑 1 , 𝑓 1 𝑑 1 , 𝑓 1 + 𝑒𝑏 𝑑 = 𝑒𝑏 1 (𝑑 1 ) π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿ π‘—π‘œπ‘—π‘’ , πœ€ π‘—π‘œπ‘’ , πœ€ 𝑓𝑦𝑒 , πœ‡, 𝑒𝑏 β€² , … 𝑇 2 β€² , 𝑓 πœ€ π‘—π‘œπ‘’ 𝑑 = … , 𝑑 β€² , 0 𝑑 2 π‘˜ π‘˜ 𝑔𝑝𝑠 π‘˜ = 𝑗 βˆ— πœ€ π‘—π‘œπ‘’,π‘˜ 𝑑 π‘˜ , 0 πœ€ 𝑓𝑦𝑒 𝑑 2 , 𝑓 2 𝑑 2 , 𝑓 2 + 𝑒𝑏 𝑑 ≀ 𝑒𝑏 2 𝑑 2 β€² = , π‘Ž 𝑗 βˆ— ,π‘˜ πœ‡ 𝑗 βˆ— 𝑑 𝑗 βˆ— 𝑔𝑝𝑠 π‘˜ ∈ 𝐽 𝑗 βˆ— βˆ– π‘‘π‘“π‘šπ‘” πœ€ 𝑓𝑦𝑒,π‘˜ 𝑑 π‘˜ , 𝑓 π‘˜ + 𝑒𝑏 𝑑 , 0 β€² , 𝑓 𝑑 π‘˜ π‘˜ 𝑑 π‘˜ , 𝑓 π‘˜ + 𝑒𝑏 𝑑 π‘“π‘šπ‘‘π‘“ 𝑍 𝐷𝑁 𝑒

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

  56. CM 𝑓 1 π‘Œ 𝐷𝑁 2 𝑇 1 𝑓 1 𝑧 π‘‘π‘“π‘šπ‘” π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿ π‘—π‘œπ‘—π‘’ , πœ€ π‘—π‘œπ‘’ , πœ€ 𝑓𝑦𝑒 , πœ‡, 𝑒𝑏 β€² , … 𝑇 2 β€² , 𝑓 𝑗 πœ€ 𝑓𝑦𝑒 𝑑, 𝑓 , 𝑦 = … , 𝑑 𝑗 β€² = ቐ πœ€ 𝑓𝑦𝑒,𝑗 𝑑 𝑗 , 𝑓 𝑗 + 𝑓 , π‘Ž π‘‘π‘“π‘šπ‘”,𝑗 𝑦 , 0 𝑔𝑝𝑠 𝑗 ∈ 𝐽 π‘‘π‘“π‘šπ‘” β€² , 𝑓 𝑗 𝑑 𝑗 𝑑 𝑗 , 𝑓 𝑗 + 𝑓 π‘“π‘šπ‘‘π‘“ 𝑍 𝐷𝑁 𝑒

  57. π‘”π‘šπ‘π‘’π‘’π‘“π‘œ 𝐷𝑁 = π‘Œ, 𝑍, 𝑇, π‘Ÿ π‘—π‘œπ‘—π‘’ , πœ€ π‘—π‘œπ‘’ , πœ€ 𝑓𝑦𝑒 , πœ‡, 𝑒𝑏 π‘Œ = π‘Œ 𝐷𝑁 𝑍 = 𝑍 𝐷𝑁 𝑇 = Γ— π‘—βˆˆπΈ 𝑅 𝑗 𝑅 = 𝑑, 𝑓 𝑑 ∈ 𝑇, 0 ≀ 𝑓 ≀ 𝑒𝑏(𝑑) π‘Ÿ π‘—π‘œπ‘—π‘’ = 𝑑 π‘—π‘œπ‘—π‘’ , 𝑓 π‘—π‘œπ‘—π‘’ ∈ 𝑅 𝑑 π‘—π‘œπ‘—π‘’ = (… , 𝑑 π‘—π‘œπ‘—π‘’,𝑗 , 𝑓 π‘—π‘œπ‘—π‘’,𝑗 βˆ’ 𝑓 π‘—π‘œπ‘—π‘’ , … ) 𝑓 π‘—π‘œπ‘—π‘’ = min π‘—βˆˆπΈ 𝑓 π‘—π‘œπ‘—π‘’,𝑗 𝑑 π‘—π‘œπ‘—π‘’,𝑗 , 𝑓 π‘—π‘œπ‘—π‘’,𝑗 = π‘Ÿ π‘—π‘œπ‘—π‘’,𝑗 β€² , … β€² , 𝑓 πœ€ π‘—π‘œπ‘’ 𝑑 = … , 𝑑 π‘˜ π‘˜ 𝑔𝑝𝑠 π‘˜ = 𝑗 βˆ— πœ€ π‘—π‘œπ‘’,π‘˜ 𝑑 π‘˜ , 0 β€² = , π‘Ž 𝑗 βˆ— ,π‘˜ πœ‡ 𝑗 βˆ— 𝑑 𝑗 βˆ— β€² , 𝑓 πœ€ 𝑓𝑦𝑒,π‘˜ 𝑑 π‘˜ , 𝑓 π‘˜ + 𝑒𝑏 𝑑 , 0 𝑔𝑝𝑠 π‘˜ ∈ 𝐽 𝑗 βˆ— 𝑑 π‘˜ π‘˜ 𝑑 π‘˜ , 𝑓 π‘˜ + 𝑒𝑏 𝑑 π‘“π‘šπ‘‘π‘“ β€² , … β€² , 𝑓 𝑗 πœ€ 𝑓𝑦𝑒 𝑑, 𝑓 , 𝑦 = … , 𝑑 𝑗 β€² = ቐ πœ€ 𝑓𝑦𝑒,𝑗 𝑑 𝑗 , 𝑓 𝑗 + 𝑓 , π‘Ž π‘‘π‘“π‘šπ‘”,𝑗 𝑦 , 0 𝑔𝑝𝑠 𝑗 ∈ 𝐽 π‘‘π‘“π‘šπ‘” β€² , 𝑓 𝑗 𝑑 𝑗 𝑑 𝑗 , 𝑓 𝑗 + 𝑓 π‘“π‘šπ‘‘π‘“ πœ‡ 𝑑 = ΰ΅π‘Ž 𝑗 βˆ— ,π‘‘π‘“π‘šπ‘” πœ‡ 𝑗 βˆ— 𝑑 𝑗 βˆ— 𝑗𝑔 π‘‘π‘“π‘šπ‘” ∈ 𝐽 𝑗 βˆ— 𝑗𝑔 π‘‘π‘“π‘šπ‘” βˆ‰ 𝐽 𝑗 βˆ— 𝜚 𝑗 βˆ— = π‘‘π‘“π‘šπ‘“π‘‘π‘’(𝐽𝑁𝑁 𝑑 ) 𝐽𝑁𝑁 𝑑 = 𝑗 ∈ 𝐸 𝜏 𝑗 = 𝑒𝑏(𝑑) 𝑒𝑏 𝑑 = min π‘—βˆˆπΈ 𝜏 𝑗 = 𝑒𝑏 𝑗 𝑑 𝑗 βˆ’ 𝑓 𝑗

  58. Hierarchical Simulator

  59. Root coordinator (i, t) (*, t) (done, t) (done, t) Coupled DEVS Coordinator (i, t) (*, t) (x, t) (y, t) (done, t) (done, t) (done, t) (done, t) Simulator Simulator Atomic DEVS Atomic DEVS

  60. DEVS Semantics Operational Denotational Semantics Semantics Abstract Atomic DEVS [1] Simulator Hierarchical Closure under Coupled DEVS Simulator 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.

  61. Conclusions (*, t) (done, t) (i,t) (y, t) (x, t)  Atomic DEVS π’•π’‡π’Žπ’ˆ 𝑡 π’Žπ’‹π’‰π’Šπ’–πŸ 𝑡 π’’π’‘π’ŽπŸ  Coupled DEVS  Closure under coupling  Abstract Simulator take_break οƒ  toAuto go_to_work οƒ  toManual

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

  63. 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.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend