|
|
@@ -1,7 +1,7 @@
|
|
|
"""
|
|
|
Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
|
|
|
|
|
|
-Date: Thu Nov 17 18:39:36 2016
|
|
|
+Date: Fri Nov 25 16:50:58 2016
|
|
|
|
|
|
Model author: Sadaf Mustafiz and Claudio Gomes and Simon Van Mierlo
|
|
|
Model name: FSASimulator_Coordinator
|
|
|
@@ -392,14 +392,14 @@ class WovenSimulator_Coordinator(RuntimeClassBase):
|
|
|
clock = parameters[0]
|
|
|
state = parameters[1]
|
|
|
self.big_step.outputEvent(Event("WovenSimulation.Finished", "user_output", []))
|
|
|
- self.big_step.outputEvent(Event("State", "user_output", [clock / 1000.0, state]))
|
|
|
+ self.big_step.outputEvent(Event("WovenSimulation.State", "user_output", [clock / 1000.0, state]))
|
|
|
|
|
|
def _Main_ModeSelector_Running_1_exec(self, parameters):
|
|
|
triggered_bp = parameters[0]
|
|
|
clock = parameters[1]
|
|
|
state = parameters[2]
|
|
|
- self.big_step.outputEvent(Event("Breakpoint.Triggered", "user_output", [triggered_bp, clock, state]))
|
|
|
- self.big_step.outputEvent(Event("State", "user_output", [clock / 1000.0, state]))
|
|
|
+ self.big_step.outputEvent(Event("Breakpoint.Triggered", "user_output", [triggered_bp, clock / 1000.0, state]))
|
|
|
+ self.big_step.outputEvent(Event("WovenSimulation.State", "user_output", [clock / 1000.0, state]))
|
|
|
|
|
|
def _Main_ModeSelector_Paused_3_exec(self, parameters):
|
|
|
realtime_scale = parameters[0]
|
|
|
@@ -407,19 +407,19 @@ class WovenSimulator_Coordinator(RuntimeClassBase):
|
|
|
|
|
|
def _Main_ModeSelector_Paused_4_exec(self, parameters):
|
|
|
clock = parameters[0]
|
|
|
- timeNext = parameters[1]
|
|
|
+ state = parameters[1]
|
|
|
elapsed = parameters[2]
|
|
|
- fsa_events = parameters[3]
|
|
|
- state = parameters[4]
|
|
|
- transition_taken = parameters[5]
|
|
|
+ time_next = parameters[3]
|
|
|
+ fsa_events = parameters[4]
|
|
|
+ executed_transition = parameters[5]
|
|
|
self.big_step.outputEvent(Event("FSABigStep.Finished", "user_output", []))
|
|
|
- self.big_step.outputEvent(Event("State", "user_output", [clock / 1000.0, state]))
|
|
|
+ self.big_step.outputEvent(Event("FSABigStep.State", "user_output", [clock / 1000.0, state]))
|
|
|
|
|
|
def _Main_ModeSelector_Paused_5_exec(self, parameters):
|
|
|
clock = parameters[0]
|
|
|
state = parameters[1]
|
|
|
self.big_step.outputEvent(Event("WovenSimulation.Finished", "user_output", []))
|
|
|
- self.big_step.outputEvent(Event("State", "user_output", [clock / 1000.0, state]))
|
|
|
+ self.big_step.outputEvent(Event("WovenSimulation.State", "user_output", [clock / 1000.0, state]))
|
|
|
|
|
|
def _Main_ModeSelector_Running_Continuous_0_exec(self, parameters):
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_simulator', Event("WovenSimulation.Pause", None, [])]))
|
|
|
@@ -428,7 +428,7 @@ class WovenSimulator_Coordinator(RuntimeClassBase):
|
|
|
clock = parameters[0]
|
|
|
state = parameters[1]
|
|
|
self.big_step.outputEvent(Event("WovenSimulation.Finished", "user_output", []))
|
|
|
- self.big_step.outputEvent(Event("State", "user_output", [clock / 1000.0, state]))
|
|
|
+ self.big_step.outputEvent(Event("WovenSimulation.State", "user_output", [clock / 1000.0, state]))
|
|
|
|
|
|
def _Main_ModeSelector_Running_Realtime_0_exec(self, parameters):
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_simulator', Event("WovenSimulation.Pause", None, [])]))
|
|
|
@@ -437,64 +437,64 @@ class WovenSimulator_Coordinator(RuntimeClassBase):
|
|
|
clock = parameters[0]
|
|
|
state = parameters[1]
|
|
|
self.big_step.outputEvent(Event("WovenSimulation.Finished", "user_output", []))
|
|
|
- self.big_step.outputEvent(Event("State", "user_output", [clock / 1000.0, state]))
|
|
|
+ self.big_step.outputEvent(Event("WovenSimulation.State", "user_output", [clock / 1000.0, state]))
|
|
|
|
|
|
def _Main_ModeSelector_Running_Realtime_2_exec(self, parameters):
|
|
|
clock = parameters[0]
|
|
|
- timeNext = parameters[1]
|
|
|
+ state = parameters[1]
|
|
|
elapsed = parameters[2]
|
|
|
- fsa_events = parameters[3]
|
|
|
- state = parameters[4]
|
|
|
- transition_taken = parameters[5]
|
|
|
+ time_next = parameters[3]
|
|
|
+ fsa_events = parameters[4]
|
|
|
+ executed_transition = parameters[5]
|
|
|
self.big_step.outputEvent(Event("FSABigStep.Finished", "user_output", []))
|
|
|
- self.big_step.outputEvent(Event("State", "user_output", [clock / 1000.0, state]))
|
|
|
+ self.big_step.outputEvent(Event("FSABigStep.State", "user_output", [clock / 1000.0, state]))
|
|
|
|
|
|
def _Main_ModeSelector_Running_BigStep_0_exec(self, parameters):
|
|
|
clock = parameters[0]
|
|
|
- timeNext = parameters[1]
|
|
|
+ state = parameters[1]
|
|
|
elapsed = parameters[2]
|
|
|
- fsa_events = parameters[3]
|
|
|
- state = parameters[4]
|
|
|
- transition_taken = parameters[5]
|
|
|
+ time_next = parameters[3]
|
|
|
+ fsa_events = parameters[4]
|
|
|
+ executed_transition = parameters[5]
|
|
|
self.big_step.outputEvent(Event("FSABigStep.Finished", "user_output", []))
|
|
|
- self.big_step.outputEvent(Event("State", "user_output", [clock / 1000.0, state]))
|
|
|
+ self.big_step.outputEvent(Event("FSABigStep.State", "user_output", [clock / 1000.0, state]))
|
|
|
|
|
|
def _Main_ModeSelector_Running_BigStep_1_exec(self, parameters):
|
|
|
clock = parameters[0]
|
|
|
state = parameters[1]
|
|
|
self.big_step.outputEvent(Event("WovenSimulation.Finished", "user_output", []))
|
|
|
- self.big_step.outputEvent(Event("State", "user_output", [clock / 1000.0, state]))
|
|
|
+ self.big_step.outputEvent(Event("WovenSimulation.State", "user_output", [clock / 1000.0, state]))
|
|
|
|
|
|
def _Main_ModeSelector_Running_SmallStep_0_exec(self, parameters):
|
|
|
- selectedTransition = parameters[0]
|
|
|
- currentEvent = parameters[1]
|
|
|
- fsa_events = parameters[2]
|
|
|
- elapsed = parameters[3]
|
|
|
- state = parameters[4]
|
|
|
+ clock = parameters[0]
|
|
|
+ state = parameters[1]
|
|
|
+ elapsed = parameters[2]
|
|
|
+ fsa_events = parameters[3]
|
|
|
+ selected_transition = parameters[4]
|
|
|
self.big_step.outputEvent(Event("FSASmallStep.Finished", "user_output", []))
|
|
|
- self.big_step.outputEvent(Event("State", "user_output", [selectedTransition, currentEvent, fsa_events, elapsed, state]))
|
|
|
+ self.big_step.outputEvent(Event("FSASmallStep.State", "user_output", [clock / 1000.0, state, elapsed, fsa_events, selected_transition]))
|
|
|
|
|
|
def _Main_ModeSelector_Running_SmallStep_1_exec(self, parameters):
|
|
|
clock = parameters[0]
|
|
|
- timeNext = parameters[1]
|
|
|
+ state = parameters[1]
|
|
|
elapsed = parameters[2]
|
|
|
- fsa_events = parameters[3]
|
|
|
- state = parameters[4]
|
|
|
- transition_taken = parameters[5]
|
|
|
+ time_next = parameters[3]
|
|
|
+ fsa_events = parameters[4]
|
|
|
+ executed_transition = parameters[5]
|
|
|
self.big_step.outputEvent(Event("FSABigStep.Finished", "user_output", []))
|
|
|
- self.big_step.outputEvent(Event("State", "user_output", [clock / 1000.0, state]))
|
|
|
+ self.big_step.outputEvent(Event("FSABigStep.State", "user_output", [clock / 1000.0, state]))
|
|
|
|
|
|
def _Main_ModeSelector_Running_SmallStep_2_exec(self, parameters):
|
|
|
clock = parameters[0]
|
|
|
state = parameters[1]
|
|
|
self.big_step.outputEvent(Event("WovenSimulation.Finished", "user_output", []))
|
|
|
- self.big_step.outputEvent(Event("State", "user_output", [clock / 1000.0, state]))
|
|
|
+ self.big_step.outputEvent(Event("WovenSimulation.State", "user_output", [clock / 1000.0, state]))
|
|
|
|
|
|
def _Main_ModeSelector_WaitingForPaused_0_exec(self, parameters):
|
|
|
clock = parameters[0]
|
|
|
state = parameters[1]
|
|
|
self.big_step.outputEvent(Event("WovenSimulation.Paused", "user_output", []))
|
|
|
- self.big_step.outputEvent(Event("State", "user_output", [clock / 1000.0, state]))
|
|
|
+ self.big_step.outputEvent(Event("WovenSimulation.State", "user_output", [clock / 1000.0, state]))
|
|
|
|
|
|
def _Main_ChildState_Initialized_0_exec(self, parameters):
|
|
|
self.big_step.outputEventOM(Event("delete_instance", None, [self, 'child_simulator']))
|
|
|
@@ -664,7 +664,7 @@ class WovenSimulator_Simulation(RuntimeClassBase):
|
|
|
simulated_diff = (accurate_time.time() - self.realtime_start_time) * self.realtime_scale
|
|
|
# time_next and simulated_diff are both in simulated time: so now scale back to wall-clock time by dividing.
|
|
|
# This function returns an amount of miliseconds.
|
|
|
- return ((self.time_next - simulated_diff) / self.realtime_scale)
|
|
|
+ return ((self.fsa_time_next - simulated_diff) / self.realtime_scale)
|
|
|
|
|
|
|
|
|
# user defined method
|
|
|
@@ -748,137 +748,146 @@ class WovenSimulator_Simulation(RuntimeClassBase):
|
|
|
# state /Main/ModeSelector/Paused
|
|
|
self.states["/Main/ModeSelector/Paused"] = State(3, "/Main/ModeSelector/Paused", self)
|
|
|
|
|
|
+ # state /Main/ModeSelector/ExecutingRealtimeIfInitialized
|
|
|
+ self.states["/Main/ModeSelector/ExecutingRealtimeIfInitialized"] = State(4, "/Main/ModeSelector/ExecutingRealtimeIfInitialized", self)
|
|
|
+
|
|
|
# state /Main/ModeSelector/Running
|
|
|
- self.states["/Main/ModeSelector/Running"] = State(4, "/Main/ModeSelector/Running", self)
|
|
|
+ self.states["/Main/ModeSelector/Running"] = State(5, "/Main/ModeSelector/Running", self)
|
|
|
|
|
|
# state /Main/ModeSelector/Running/Continuous
|
|
|
- self.states["/Main/ModeSelector/Running/Continuous"] = State(5, "/Main/ModeSelector/Running/Continuous", self)
|
|
|
+ self.states["/Main/ModeSelector/Running/Continuous"] = State(6, "/Main/ModeSelector/Running/Continuous", self)
|
|
|
+
|
|
|
+ # state /Main/ModeSelector/Running/Continuous/Running
|
|
|
+ self.states["/Main/ModeSelector/Running/Continuous/Running"] = State(7, "/Main/ModeSelector/Running/Continuous/Running", self)
|
|
|
+
|
|
|
+ # state /Main/ModeSelector/Running/Continuous/WaitingForBigStepToEnd
|
|
|
+ self.states["/Main/ModeSelector/Running/Continuous/WaitingForBigStepToEnd"] = State(8, "/Main/ModeSelector/Running/Continuous/WaitingForBigStepToEnd", self)
|
|
|
|
|
|
# state /Main/ModeSelector/Running/Realtime
|
|
|
- self.states["/Main/ModeSelector/Running/Realtime"] = State(6, "/Main/ModeSelector/Running/Realtime", self)
|
|
|
+ self.states["/Main/ModeSelector/Running/Realtime"] = State(9, "/Main/ModeSelector/Running/Realtime", self)
|
|
|
|
|
|
# state /Main/ModeSelector/Running/BigStep
|
|
|
- self.states["/Main/ModeSelector/Running/BigStep"] = State(7, "/Main/ModeSelector/Running/BigStep", self)
|
|
|
+ self.states["/Main/ModeSelector/Running/BigStep"] = State(10, "/Main/ModeSelector/Running/BigStep", self)
|
|
|
|
|
|
# state /Main/ModeSelector/Running/SmallStep
|
|
|
- self.states["/Main/ModeSelector/Running/SmallStep"] = State(8, "/Main/ModeSelector/Running/SmallStep", self)
|
|
|
+ self.states["/Main/ModeSelector/Running/SmallStep"] = State(11, "/Main/ModeSelector/Running/SmallStep", self)
|
|
|
|
|
|
# state /Main/ModeSelector/Stopped
|
|
|
- self.states["/Main/ModeSelector/Stopped"] = State(9, "/Main/ModeSelector/Stopped", self)
|
|
|
+ self.states["/Main/ModeSelector/Stopped"] = State(12, "/Main/ModeSelector/Stopped", self)
|
|
|
self.states["/Main/ModeSelector/Stopped"].setEnter(self._Main_ModeSelector_Stopped_enter)
|
|
|
|
|
|
# state /Main/FSAChildState
|
|
|
- self.states["/Main/FSAChildState"] = State(10, "/Main/FSAChildState", self)
|
|
|
+ self.states["/Main/FSAChildState"] = State(13, "/Main/FSAChildState", self)
|
|
|
|
|
|
# state /Main/FSAChildState/Uninitialized
|
|
|
- self.states["/Main/FSAChildState/Uninitialized"] = State(11, "/Main/FSAChildState/Uninitialized", self)
|
|
|
+ self.states["/Main/FSAChildState/Uninitialized"] = State(14, "/Main/FSAChildState/Uninitialized", self)
|
|
|
|
|
|
# state /Main/FSAChildState/Initialized
|
|
|
- self.states["/Main/FSAChildState/Initialized"] = State(12, "/Main/FSAChildState/Initialized", self)
|
|
|
+ self.states["/Main/FSAChildState/Initialized"] = State(15, "/Main/FSAChildState/Initialized", self)
|
|
|
|
|
|
# state /Main/CBDChildState
|
|
|
- self.states["/Main/CBDChildState"] = State(13, "/Main/CBDChildState", self)
|
|
|
+ self.states["/Main/CBDChildState"] = State(16, "/Main/CBDChildState", self)
|
|
|
|
|
|
# state /Main/CBDChildState/Uninitialized
|
|
|
- self.states["/Main/CBDChildState/Uninitialized"] = State(14, "/Main/CBDChildState/Uninitialized", self)
|
|
|
+ self.states["/Main/CBDChildState/Uninitialized"] = State(17, "/Main/CBDChildState/Uninitialized", self)
|
|
|
|
|
|
# state /Main/CBDChildState/Initialized
|
|
|
- self.states["/Main/CBDChildState/Initialized"] = State(15, "/Main/CBDChildState/Initialized", self)
|
|
|
+ self.states["/Main/CBDChildState/Initialized"] = State(18, "/Main/CBDChildState/Initialized", self)
|
|
|
|
|
|
# state /Main/FSAInitializer
|
|
|
- self.states["/Main/FSAInitializer"] = State(16, "/Main/FSAInitializer", self)
|
|
|
+ self.states["/Main/FSAInitializer"] = State(19, "/Main/FSAInitializer", self)
|
|
|
|
|
|
# state /Main/FSAInitializer/Waiting
|
|
|
- self.states["/Main/FSAInitializer/Waiting"] = State(17, "/Main/FSAInitializer/Waiting", self)
|
|
|
+ self.states["/Main/FSAInitializer/Waiting"] = State(20, "/Main/FSAInitializer/Waiting", self)
|
|
|
|
|
|
# state /Main/FSAInitializer/CreatingChildSimulator
|
|
|
- self.states["/Main/FSAInitializer/CreatingChildSimulator"] = State(18, "/Main/FSAInitializer/CreatingChildSimulator", self)
|
|
|
+ self.states["/Main/FSAInitializer/CreatingChildSimulator"] = State(21, "/Main/FSAInitializer/CreatingChildSimulator", self)
|
|
|
|
|
|
# state /Main/FSAInitializer/StartingChildSimulator
|
|
|
- self.states["/Main/FSAInitializer/StartingChildSimulator"] = State(19, "/Main/FSAInitializer/StartingChildSimulator", self)
|
|
|
+ self.states["/Main/FSAInitializer/StartingChildSimulator"] = State(22, "/Main/FSAInitializer/StartingChildSimulator", self)
|
|
|
|
|
|
# state /Main/FSAInitializer/Running
|
|
|
- self.states["/Main/FSAInitializer/Running"] = State(20, "/Main/FSAInitializer/Running", self)
|
|
|
+ self.states["/Main/FSAInitializer/Running"] = State(23, "/Main/FSAInitializer/Running", self)
|
|
|
|
|
|
# state /Main/FSAInitializer/SettleBeforeWaiting
|
|
|
- self.states["/Main/FSAInitializer/SettleBeforeWaiting"] = State(21, "/Main/FSAInitializer/SettleBeforeWaiting", self)
|
|
|
+ self.states["/Main/FSAInitializer/SettleBeforeWaiting"] = State(24, "/Main/FSAInitializer/SettleBeforeWaiting", self)
|
|
|
self.states["/Main/FSAInitializer/SettleBeforeWaiting"].setEnter(self._Main_FSAInitializer_SettleBeforeWaiting_enter)
|
|
|
self.states["/Main/FSAInitializer/SettleBeforeWaiting"].setExit(self._Main_FSAInitializer_SettleBeforeWaiting_exit)
|
|
|
|
|
|
# state /Main/CBDInitializer
|
|
|
- self.states["/Main/CBDInitializer"] = State(22, "/Main/CBDInitializer", self)
|
|
|
+ self.states["/Main/CBDInitializer"] = State(25, "/Main/CBDInitializer", self)
|
|
|
|
|
|
# state /Main/CBDInitializer/Waiting
|
|
|
- self.states["/Main/CBDInitializer/Waiting"] = State(23, "/Main/CBDInitializer/Waiting", self)
|
|
|
+ self.states["/Main/CBDInitializer/Waiting"] = State(26, "/Main/CBDInitializer/Waiting", self)
|
|
|
|
|
|
# state /Main/CBDInitializer/CreatingChildSimulator
|
|
|
- self.states["/Main/CBDInitializer/CreatingChildSimulator"] = State(24, "/Main/CBDInitializer/CreatingChildSimulator", self)
|
|
|
+ self.states["/Main/CBDInitializer/CreatingChildSimulator"] = State(27, "/Main/CBDInitializer/CreatingChildSimulator", self)
|
|
|
|
|
|
# state /Main/CBDInitializer/StartingChildSimulator
|
|
|
- self.states["/Main/CBDInitializer/StartingChildSimulator"] = State(25, "/Main/CBDInitializer/StartingChildSimulator", self)
|
|
|
+ self.states["/Main/CBDInitializer/StartingChildSimulator"] = State(28, "/Main/CBDInitializer/StartingChildSimulator", self)
|
|
|
|
|
|
# state /Main/CBDInitializer/Running
|
|
|
- self.states["/Main/CBDInitializer/Running"] = State(26, "/Main/CBDInitializer/Running", self)
|
|
|
+ self.states["/Main/CBDInitializer/Running"] = State(29, "/Main/CBDInitializer/Running", self)
|
|
|
|
|
|
# state /Main/CBDInitializer/SettleBeforeWaiting
|
|
|
- self.states["/Main/CBDInitializer/SettleBeforeWaiting"] = State(27, "/Main/CBDInitializer/SettleBeforeWaiting", self)
|
|
|
+ self.states["/Main/CBDInitializer/SettleBeforeWaiting"] = State(30, "/Main/CBDInitializer/SettleBeforeWaiting", self)
|
|
|
self.states["/Main/CBDInitializer/SettleBeforeWaiting"].setEnter(self._Main_CBDInitializer_SettleBeforeWaiting_enter)
|
|
|
self.states["/Main/CBDInitializer/SettleBeforeWaiting"].setExit(self._Main_CBDInitializer_SettleBeforeWaiting_exit)
|
|
|
|
|
|
# state /Main/SimulationFlow
|
|
|
- self.states["/Main/SimulationFlow"] = State(28, "/Main/SimulationFlow", self)
|
|
|
+ self.states["/Main/SimulationFlow"] = State(31, "/Main/SimulationFlow", self)
|
|
|
|
|
|
# state /Main/SimulationFlow/Started
|
|
|
- self.states["/Main/SimulationFlow/Started"] = State(29, "/Main/SimulationFlow/Started", self)
|
|
|
+ self.states["/Main/SimulationFlow/Started"] = State(32, "/Main/SimulationFlow/Started", self)
|
|
|
|
|
|
# state /Main/SimulationFlow/Initialized
|
|
|
- self.states["/Main/SimulationFlow/Initialized"] = State(30, "/Main/SimulationFlow/Initialized", self)
|
|
|
+ self.states["/Main/SimulationFlow/Initialized"] = State(33, "/Main/SimulationFlow/Initialized", self)
|
|
|
|
|
|
# state /Main/SimulationFlow/InitializeDebugger
|
|
|
- self.states["/Main/SimulationFlow/InitializeDebugger"] = State(31, "/Main/SimulationFlow/InitializeDebugger", self)
|
|
|
+ self.states["/Main/SimulationFlow/InitializeDebugger"] = State(34, "/Main/SimulationFlow/InitializeDebugger", self)
|
|
|
|
|
|
# state /Main/SimulationFlow/DebuggerInitialized
|
|
|
- self.states["/Main/SimulationFlow/DebuggerInitialized"] = State(32, "/Main/SimulationFlow/DebuggerInitialized", self)
|
|
|
+ self.states["/Main/SimulationFlow/DebuggerInitialized"] = State(35, "/Main/SimulationFlow/DebuggerInitialized", self)
|
|
|
|
|
|
# state /Main/SimulationFlow/Waiting
|
|
|
- self.states["/Main/SimulationFlow/Waiting"] = State(33, "/Main/SimulationFlow/Waiting", self)
|
|
|
+ self.states["/Main/SimulationFlow/Waiting"] = State(36, "/Main/SimulationFlow/Waiting", self)
|
|
|
|
|
|
# state /Main/SimulationFlow/SettleBeforeCheckTermination
|
|
|
- self.states["/Main/SimulationFlow/SettleBeforeCheckTermination"] = State(34, "/Main/SimulationFlow/SettleBeforeCheckTermination", self)
|
|
|
+ self.states["/Main/SimulationFlow/SettleBeforeCheckTermination"] = State(37, "/Main/SimulationFlow/SettleBeforeCheckTermination", self)
|
|
|
self.states["/Main/SimulationFlow/SettleBeforeCheckTermination"].setEnter(self._Main_SimulationFlow_SettleBeforeCheckTermination_enter)
|
|
|
self.states["/Main/SimulationFlow/SettleBeforeCheckTermination"].setExit(self._Main_SimulationFlow_SettleBeforeCheckTermination_exit)
|
|
|
|
|
|
# state /Main/SimulationFlow/CheckTermination
|
|
|
- self.states["/Main/SimulationFlow/CheckTermination"] = State(35, "/Main/SimulationFlow/CheckTermination", self)
|
|
|
+ self.states["/Main/SimulationFlow/CheckTermination"] = State(38, "/Main/SimulationFlow/CheckTermination", self)
|
|
|
|
|
|
# state /Main/SimulationFlow/WaitingRealtime
|
|
|
- self.states["/Main/SimulationFlow/WaitingRealtime"] = State(36, "/Main/SimulationFlow/WaitingRealtime", self)
|
|
|
+ self.states["/Main/SimulationFlow/WaitingRealtime"] = State(39, "/Main/SimulationFlow/WaitingRealtime", self)
|
|
|
self.states["/Main/SimulationFlow/WaitingRealtime"].setEnter(self._Main_SimulationFlow_WaitingRealtime_enter)
|
|
|
self.states["/Main/SimulationFlow/WaitingRealtime"].setExit(self._Main_SimulationFlow_WaitingRealtime_exit)
|
|
|
|
|
|
# state /Main/SimulationFlow/ExecutingCBD
|
|
|
- self.states["/Main/SimulationFlow/ExecutingCBD"] = State(37, "/Main/SimulationFlow/ExecutingCBD", self)
|
|
|
+ self.states["/Main/SimulationFlow/ExecutingCBD"] = State(40, "/Main/SimulationFlow/ExecutingCBD", self)
|
|
|
|
|
|
# state /Main/SimulationFlow/Executing
|
|
|
- self.states["/Main/SimulationFlow/Executing"] = State(38, "/Main/SimulationFlow/Executing", self)
|
|
|
+ self.states["/Main/SimulationFlow/Executing"] = State(41, "/Main/SimulationFlow/Executing", self)
|
|
|
|
|
|
# state /Main/SimulationFlow/Stopped
|
|
|
- self.states["/Main/SimulationFlow/Stopped"] = State(39, "/Main/SimulationFlow/Stopped", self)
|
|
|
+ self.states["/Main/SimulationFlow/Stopped"] = State(42, "/Main/SimulationFlow/Stopped", self)
|
|
|
|
|
|
# state /Main/BreakpointManager
|
|
|
- self.states["/Main/BreakpointManager"] = State(40, "/Main/BreakpointManager", self)
|
|
|
+ self.states["/Main/BreakpointManager"] = State(43, "/Main/BreakpointManager", self)
|
|
|
|
|
|
# state /Main/BreakpointManager/Listening
|
|
|
- self.states["/Main/BreakpointManager/Listening"] = State(41, "/Main/BreakpointManager/Listening", self)
|
|
|
+ self.states["/Main/BreakpointManager/Listening"] = State(44, "/Main/BreakpointManager/Listening", self)
|
|
|
|
|
|
# state /Main/ParentCommunicator
|
|
|
- self.states["/Main/ParentCommunicator"] = State(42, "/Main/ParentCommunicator", self)
|
|
|
+ self.states["/Main/ParentCommunicator"] = State(45, "/Main/ParentCommunicator", self)
|
|
|
|
|
|
# state /Main/ParentCommunicator/Forwarding
|
|
|
- self.states["/Main/ParentCommunicator/Forwarding"] = State(43, "/Main/ParentCommunicator/Forwarding", self)
|
|
|
+ self.states["/Main/ParentCommunicator/Forwarding"] = State(46, "/Main/ParentCommunicator/Forwarding", self)
|
|
|
|
|
|
# state /Stopped
|
|
|
- self.states["/Stopped"] = State(44, "/Stopped", self)
|
|
|
+ self.states["/Stopped"] = State(47, "/Stopped", self)
|
|
|
|
|
|
# add children
|
|
|
self.states[""].addChild(self.states["/Main"])
|
|
|
@@ -892,12 +901,15 @@ class WovenSimulator_Simulation(RuntimeClassBase):
|
|
|
self.states["/Main"].addChild(self.states["/Main/BreakpointManager"])
|
|
|
self.states["/Main"].addChild(self.states["/Main/ParentCommunicator"])
|
|
|
self.states["/Main/ModeSelector"].addChild(self.states["/Main/ModeSelector/Paused"])
|
|
|
+ self.states["/Main/ModeSelector"].addChild(self.states["/Main/ModeSelector/ExecutingRealtimeIfInitialized"])
|
|
|
self.states["/Main/ModeSelector"].addChild(self.states["/Main/ModeSelector/Running"])
|
|
|
self.states["/Main/ModeSelector"].addChild(self.states["/Main/ModeSelector/Stopped"])
|
|
|
self.states["/Main/ModeSelector/Running"].addChild(self.states["/Main/ModeSelector/Running/Continuous"])
|
|
|
self.states["/Main/ModeSelector/Running"].addChild(self.states["/Main/ModeSelector/Running/Realtime"])
|
|
|
self.states["/Main/ModeSelector/Running"].addChild(self.states["/Main/ModeSelector/Running/BigStep"])
|
|
|
self.states["/Main/ModeSelector/Running"].addChild(self.states["/Main/ModeSelector/Running/SmallStep"])
|
|
|
+ self.states["/Main/ModeSelector/Running/Continuous"].addChild(self.states["/Main/ModeSelector/Running/Continuous/Running"])
|
|
|
+ self.states["/Main/ModeSelector/Running/Continuous"].addChild(self.states["/Main/ModeSelector/Running/Continuous/WaitingForBigStepToEnd"])
|
|
|
self.states["/Main/FSAChildState"].addChild(self.states["/Main/FSAChildState/Uninitialized"])
|
|
|
self.states["/Main/FSAChildState"].addChild(self.states["/Main/FSAChildState/Initialized"])
|
|
|
self.states["/Main/CBDChildState"].addChild(self.states["/Main/CBDChildState/Uninitialized"])
|
|
|
@@ -929,6 +941,7 @@ class WovenSimulator_Simulation(RuntimeClassBase):
|
|
|
self.states[""].default_state = self.states["/Main"]
|
|
|
self.states["/Main/ModeSelector"].default_state = self.states["/Main/ModeSelector/Paused"]
|
|
|
self.states["/Main/ModeSelector/Running"].default_state = self.states["/Main/ModeSelector/Running/Continuous"]
|
|
|
+ self.states["/Main/ModeSelector/Running/Continuous"].default_state = self.states["/Main/ModeSelector/Running/Continuous/Running"]
|
|
|
self.states["/Main/FSAChildState"].default_state = self.states["/Main/FSAChildState/Uninitialized"]
|
|
|
self.states["/Main/CBDChildState"].default_state = self.states["/Main/CBDChildState/Uninitialized"]
|
|
|
self.states["/Main/FSAInitializer"].default_state = self.states["/Main/FSAInitializer/Waiting"]
|
|
|
@@ -939,17 +952,15 @@ class WovenSimulator_Simulation(RuntimeClassBase):
|
|
|
|
|
|
# transition /Main/ModeSelector/Paused
|
|
|
_Main_ModeSelector_Paused_0 = Transition(self, self.states["/Main/ModeSelector/Paused"], [self.states["/Main/ModeSelector/Running/SmallStep"]])
|
|
|
- _Main_ModeSelector_Paused_0.setAction(self._Main_ModeSelector_Paused_0_exec)
|
|
|
_Main_ModeSelector_Paused_0.setTrigger(Event("FSASmallStep.Execute", None))
|
|
|
self.states["/Main/ModeSelector/Paused"].addTransition(_Main_ModeSelector_Paused_0)
|
|
|
_Main_ModeSelector_Paused_1 = Transition(self, self.states["/Main/ModeSelector/Paused"], [self.states["/Main/ModeSelector/Running/BigStep"]])
|
|
|
- _Main_ModeSelector_Paused_1.setAction(self._Main_ModeSelector_Paused_1_exec)
|
|
|
_Main_ModeSelector_Paused_1.setTrigger(Event("FSABigStep.Execute", None))
|
|
|
self.states["/Main/ModeSelector/Paused"].addTransition(_Main_ModeSelector_Paused_1)
|
|
|
_Main_ModeSelector_Paused_2 = Transition(self, self.states["/Main/ModeSelector/Paused"], [self.states["/Main/ModeSelector/Running/Continuous"]])
|
|
|
_Main_ModeSelector_Paused_2.setTrigger(Event("WovenSimulation.Execute", None))
|
|
|
self.states["/Main/ModeSelector/Paused"].addTransition(_Main_ModeSelector_Paused_2)
|
|
|
- _Main_ModeSelector_Paused_3 = Transition(self, self.states["/Main/ModeSelector/Paused"], [self.states["/Main/ModeSelector/Running/Realtime"]])
|
|
|
+ _Main_ModeSelector_Paused_3 = Transition(self, self.states["/Main/ModeSelector/Paused"], [self.states["/Main/ModeSelector/ExecutingRealtimeIfInitialized"]])
|
|
|
_Main_ModeSelector_Paused_3.setAction(self._Main_ModeSelector_Paused_3_exec)
|
|
|
_Main_ModeSelector_Paused_3.setTrigger(Event("WovenSimulation.ExecuteRealtime", None))
|
|
|
self.states["/Main/ModeSelector/Paused"].addTransition(_Main_ModeSelector_Paused_3)
|
|
|
@@ -964,10 +975,22 @@ class WovenSimulator_Simulation(RuntimeClassBase):
|
|
|
_Main_ModeSelector_Paused_6.setTrigger(Event("CBDSimulation.Finished", None))
|
|
|
self.states["/Main/ModeSelector/Paused"].addTransition(_Main_ModeSelector_Paused_6)
|
|
|
|
|
|
- # transition /Main/ModeSelector/Running/Continuous
|
|
|
- _Main_ModeSelector_Running_Continuous_0 = Transition(self, self.states["/Main/ModeSelector/Running/Continuous"], [self.states["/Main/ModeSelector/Paused"]])
|
|
|
- _Main_ModeSelector_Running_Continuous_0.setTrigger(Event("WovenSimulation.Pause", None))
|
|
|
- self.states["/Main/ModeSelector/Running/Continuous"].addTransition(_Main_ModeSelector_Running_Continuous_0)
|
|
|
+ # transition /Main/ModeSelector/ExecutingRealtimeIfInitialized
|
|
|
+ _Main_ModeSelector_ExecutingRealtimeIfInitialized_0 = Transition(self, self.states["/Main/ModeSelector/ExecutingRealtimeIfInitialized"], [self.states["/Main/ModeSelector/Running/Realtime"]])
|
|
|
+ _Main_ModeSelector_ExecutingRealtimeIfInitialized_0.setAction(self._Main_ModeSelector_ExecutingRealtimeIfInitialized_0_exec)
|
|
|
+ _Main_ModeSelector_ExecutingRealtimeIfInitialized_0.setTrigger(None)
|
|
|
+ _Main_ModeSelector_ExecutingRealtimeIfInitialized_0.setGuard(self._Main_ModeSelector_ExecutingRealtimeIfInitialized_0_guard)
|
|
|
+ self.states["/Main/ModeSelector/ExecutingRealtimeIfInitialized"].addTransition(_Main_ModeSelector_ExecutingRealtimeIfInitialized_0)
|
|
|
+
|
|
|
+ # transition /Main/ModeSelector/Running/Continuous/Running
|
|
|
+ _Main_ModeSelector_Running_Continuous_Running_0 = Transition(self, self.states["/Main/ModeSelector/Running/Continuous/Running"], [self.states["/Main/ModeSelector/Running/Continuous/WaitingForBigStepToEnd"]])
|
|
|
+ _Main_ModeSelector_Running_Continuous_Running_0.setTrigger(Event("WovenSimulation.Pause", None))
|
|
|
+ self.states["/Main/ModeSelector/Running/Continuous/Running"].addTransition(_Main_ModeSelector_Running_Continuous_Running_0)
|
|
|
+
|
|
|
+ # transition /Main/ModeSelector/Running/Continuous/WaitingForBigStepToEnd
|
|
|
+ _Main_ModeSelector_Running_Continuous_WaitingForBigStepToEnd_0 = Transition(self, self.states["/Main/ModeSelector/Running/Continuous/WaitingForBigStepToEnd"], [self.states["/Main/ModeSelector/Paused"]])
|
|
|
+ _Main_ModeSelector_Running_Continuous_WaitingForBigStepToEnd_0.setTrigger(Event("FSABigStep.Finished", None))
|
|
|
+ self.states["/Main/ModeSelector/Running/Continuous/WaitingForBigStepToEnd"].addTransition(_Main_ModeSelector_Running_Continuous_WaitingForBigStepToEnd_0)
|
|
|
|
|
|
# transition /Main/ModeSelector/Running/Realtime
|
|
|
_Main_ModeSelector_Running_Realtime_0 = Transition(self, self.states["/Main/ModeSelector/Running/Realtime"], [self.states["/Main/ModeSelector/Paused"]])
|
|
|
@@ -1230,20 +1253,9 @@ class WovenSimulator_Simulation(RuntimeClassBase):
|
|
|
def _Main_ModeSelector_Running_0_guard(self, parameters):
|
|
|
return self.breakpointTriggers(self.inState(["/Main/ModeSelector/Running/Realtime"]))
|
|
|
|
|
|
- def _Main_ModeSelector_Paused_0_exec(self, parameters):
|
|
|
- self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_fsa_simulator', Event("FSASmallStep.Execute", None, [])]))
|
|
|
-
|
|
|
- def _Main_ModeSelector_Paused_1_exec(self, parameters):
|
|
|
- self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_fsa_simulator', Event("FSABigStep.Execute", None, [])]))
|
|
|
-
|
|
|
def _Main_ModeSelector_Paused_3_exec(self, parameters):
|
|
|
realtime_scale = parameters[0]
|
|
|
self.realtime_scale = float(realtime_scale)
|
|
|
- # If the simulation was paused, we need to reset the start time of the WovenSimulation.
|
|
|
- # The start time of the simulation is equal to the point in wall-fsa_clock time where simulated time is 0.
|
|
|
- # If the simulation was paused, we have to recompute this point in time: it is the difference of the wall-fsa_clock time and the simulated time.
|
|
|
- # If the scale was changed after the pause, this point of course moves backwards (for scales smaller than 1) or forwards (for scales larger than 1)
|
|
|
- self.realtime_start_time = accurate_time.time() - (self.fsa_clock / self.realtime_scale)
|
|
|
|
|
|
def _Main_ModeSelector_Paused_4_exec(self, parameters):
|
|
|
fsa_clock = parameters[0]
|
|
|
@@ -1259,6 +1271,16 @@ class WovenSimulator_Simulation(RuntimeClassBase):
|
|
|
self.fsa_time_next = fsa_time_next
|
|
|
self.fsa_event_list = fsa_event_list
|
|
|
|
|
|
+ def _Main_ModeSelector_ExecutingRealtimeIfInitialized_0_exec(self, parameters):
|
|
|
+ # If the simulation was paused, we need to reset the start time of the WovenSimulation.
|
|
|
+ # The start time of the simulation is equal to the point in wall-fsa_clock time where simulated time is 0.
|
|
|
+ # If the simulation was paused, we have to recompute this point in time: it is the difference of the wall-fsa_clock time and the simulated time.
|
|
|
+ # If the scale was changed after the pause, this point of course moves backwards (for scales smaller than 1) or forwards (for scales larger than 1)
|
|
|
+ self.realtime_start_time = accurate_time.time() - (self.fsa_clock / self.realtime_scale)
|
|
|
+
|
|
|
+ def _Main_ModeSelector_ExecutingRealtimeIfInitialized_0_guard(self, parameters):
|
|
|
+ return self.inState(["/Main/FSAChildState/Initialized"])
|
|
|
+
|
|
|
def _Main_ModeSelector_Running_Realtime_1_exec(self, parameters):
|
|
|
fsa_clock = parameters[0]
|
|
|
fsa_state = parameters[1]
|
|
|
@@ -1267,6 +1289,11 @@ class WovenSimulator_Simulation(RuntimeClassBase):
|
|
|
fsa_event_list = parameters[4]
|
|
|
fsa_executed_transition = parameters[5]
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("FSABigStep.Finished", None, [fsa_clock, fsa_state, fsa_elapsed, fsa_time_next, fsa_event_list, fsa_executed_transition])]))
|
|
|
+ self.fsa_clock = fsa_clock
|
|
|
+ self.fsa_state = fsa_state
|
|
|
+ self.fsa_elapsed = fsa_elapsed
|
|
|
+ self.fsa_time_next = fsa_time_next
|
|
|
+ self.fsa_event_list = fsa_event_list
|
|
|
|
|
|
def _Main_ModeSelector_Running_BigStep_0_exec(self, parameters):
|
|
|
fsa_clock = parameters[0]
|
|
|
@@ -1276,6 +1303,11 @@ class WovenSimulator_Simulation(RuntimeClassBase):
|
|
|
fsa_event_list = parameters[4]
|
|
|
fsa_executed_transition = parameters[5]
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("FSABigStep.Finished", None, [fsa_clock, fsa_state, fsa_elapsed, fsa_time_next, fsa_event_list, fsa_executed_transition])]))
|
|
|
+ self.fsa_clock = fsa_clock
|
|
|
+ self.fsa_state = fsa_state
|
|
|
+ self.fsa_elapsed = fsa_elapsed
|
|
|
+ self.fsa_time_next = fsa_time_next
|
|
|
+ self.fsa_event_list = fsa_event_list
|
|
|
|
|
|
def _Main_ModeSelector_Running_SmallStep_0_exec(self, parameters):
|
|
|
fsa_clock = parameters[0]
|
|
|
@@ -1331,7 +1363,7 @@ class WovenSimulator_Simulation(RuntimeClassBase):
|
|
|
self.big_step.outputEventOM(Event("create_instance", None, [self, 'child_fsa_simulator', 'FSASimulator_Simulation', self.woven_model, self.fsa_events, self.woven_delta]))
|
|
|
|
|
|
def _Main_FSAInitializer_Waiting_0_guard(self, parameters):
|
|
|
- return self.inState(["/Main/ModeSelector/Running"]) and self.inState(["/Main/FSAChildState/Uninitialized"])
|
|
|
+ return self.inState(["/Main/ModeSelector/Running"]) or self.inState(["/Main/ModeSelector/ExecutingRealtimeIfInitialized"]) and self.inState(["/Main/FSAChildState/Uninitialized"])
|
|
|
|
|
|
def _Main_FSAInitializer_CreatingChildSimulator_0_exec(self, parameters):
|
|
|
self.big_step.outputEventOM(Event("start_instance", None, [self, 'child_fsa_simulator']))
|
|
|
@@ -1375,12 +1407,14 @@ class WovenSimulator_Simulation(RuntimeClassBase):
|
|
|
|
|
|
def _Main_SimulationFlow_CheckTermination_0_exec(self, parameters):
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_fsa_simulator', Event("FSASmallStep.Execute", None, [])]))
|
|
|
+ print 'Executing a FSA small step... (no CBD state)'
|
|
|
|
|
|
def _Main_SimulationFlow_CheckTermination_0_guard(self, parameters):
|
|
|
return (self.inState(["/Main/ModeSelector/Running/Continuous"]) or self.inState(["/Main/ModeSelector/Running/BigStep"]) or self.inState(["/Main/ModeSelector/Running/SmallStep"])) and self.inState(["/Main/FSAChildState/Initialized"]) and not isinstance(self.fsa_state, CBDState)
|
|
|
|
|
|
def _Main_SimulationFlow_CheckTermination_1_exec(self, parameters):
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_cbd_simulator', Event("CBDBigStep.Execute", None, [])]))
|
|
|
+ print 'Executing a CBD big step... (CBD state)'
|
|
|
|
|
|
def _Main_SimulationFlow_CheckTermination_1_guard(self, parameters):
|
|
|
return (self.inState(["/Main/ModeSelector/Running/Continuous"]) or self.inState(["/Main/ModeSelector/Running/BigStep"]) or self.inState(["/Main/ModeSelector/Running/SmallStep"])) and self.inState(["/Main/CBDChildState/Initialized"]) and isinstance(self.fsa_state, CBDState)
|
|
|
@@ -1409,6 +1443,7 @@ class WovenSimulator_Simulation(RuntimeClassBase):
|
|
|
|
|
|
def _Main_SimulationFlow_WaitingRealtime_2_exec(self, parameters):
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_fsa_simulator', Event("FSASmallStep.Execute", None, [])]))
|
|
|
+ print 'Executing a FSA small step... (no CBD state - RT)'
|
|
|
|
|
|
def _Main_SimulationFlow_WaitingRealtime_2_guard(self, parameters):
|
|
|
return self.waitTime() / 1000.0 <= self.sccd_yield() and not isinstance(self.fsa_state, CBDState) and self.inState(["/Main/FSAChildState/Initialized"])
|
|
|
@@ -1429,6 +1464,7 @@ class WovenSimulator_Simulation(RuntimeClassBase):
|
|
|
self.cbd_clock = cbd_clock
|
|
|
self.woven_triggered_when_transition = self.wovenGetTriggeredWhenTransition()
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_fsa_simulator', Event("FSASmallStep.Execute", None, [self.woven_triggered_when_transition])]))
|
|
|
+ print 'Executing a FSA small step... (after CBD big step)'
|
|
|
|
|
|
def _Main_SimulationFlow_Executing_0_exec(self, parameters):
|
|
|
fsa_clock = parameters[0]
|
|
|
@@ -1818,7 +1854,7 @@ class FSASimulator_Simulation(RuntimeClassBase):
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_simulator', Event("FSASmallStep.Execute", None, [])]))
|
|
|
|
|
|
def _Main_ModeSelector_Paused_1_exec(self, parameters):
|
|
|
- self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_simulator', Event("FSABigStep.Execute", None, [])]))
|
|
|
+ self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_simulator', Event("FSABigStep.Execute", None, [None])]))
|
|
|
|
|
|
def _Main_ModeSelector_Paused_2_exec(self, parameters):
|
|
|
clock = parameters[0]
|
|
|
@@ -1836,7 +1872,7 @@ class FSASimulator_Simulation(RuntimeClassBase):
|
|
|
time_next = parameters[3]
|
|
|
event_list = parameters[4]
|
|
|
executed_transition = parameters[5]
|
|
|
- self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("FSABigStep.Finished", None, [clock, state, elapsed, time_next, current_event, event_list, executed_transition])]))
|
|
|
+ self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("FSABigStep.Finished", None, [clock, state, elapsed, time_next, event_list, executed_transition])]))
|
|
|
|
|
|
def _Main_ModeSelector_Running_SmallStep_0_exec(self, parameters):
|
|
|
clock = parameters[0]
|
|
|
@@ -1878,7 +1914,7 @@ class FSASimulator_Simulation(RuntimeClassBase):
|
|
|
return self.inState(["/Main/ModeSelector/Paused"])
|
|
|
|
|
|
def _Main_SimulationFlow_CheckTermination_0_exec(self, parameters):
|
|
|
- self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_simulator', Event("FSABigStep.Execute", None, [])]))
|
|
|
+ self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'child_simulator', Event("FSABigStep.Execute", None, [None])]))
|
|
|
|
|
|
def _Main_SimulationFlow_CheckTermination_0_guard(self, parameters):
|
|
|
return self.inState(["/Main/ModeSelector/Running/BigStep"]) and self.inState(["/Main/ChildState/Initialized"]) and not self.endCondition()
|
|
|
@@ -2278,7 +2314,7 @@ class FSASimulator_BigStep(RuntimeClassBase):
|
|
|
return (self.inState(["/Main/ModeSelector/Running/Continuous"]) or self.inState(["/Main/ModeSelector/Running/SmallStep"])) and self.inState(["/Main/ChildState/Initialized"]) and not self.endCondition()
|
|
|
|
|
|
def _Main_SimulationFlow_CheckTermination_1_exec(self, parameters):
|
|
|
- # print '>>> (FSA) big step executed <<<'
|
|
|
+ print '>>> (FSA) big step executed <<<'
|
|
|
self.finalize()
|
|
|
self.raiseInternalEvent(Event("FSABigStep.Finished", None, []))
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("FSABigStep.Finished", None, [self.clock, self.state, self.elapsed, self.time_next, self.event_list, self.executed_transition])]))
|
|
|
@@ -2293,13 +2329,13 @@ class FSASimulator_BigStep(RuntimeClassBase):
|
|
|
event_list = parameters[3]
|
|
|
current_event = parameters[4]
|
|
|
executed_transition = parameters[5]
|
|
|
+ self.small_step_executed = True
|
|
|
self.state = state
|
|
|
self.elapsed = elapsed
|
|
|
self.event_list = event_list
|
|
|
self.current_event = current_event
|
|
|
- self.executed_transition = executed_transition
|
|
|
- self.small_step_executed = True
|
|
|
- self.selected_transition = None
|
|
|
+ self.current_event = self.getInputEventAt(self.clock / 1000.0)
|
|
|
+ self.selected_transition = self.model.getTransitionFrom(self.state, self.current_event, self.elapsed)
|
|
|
|
|
|
def initializeStatechart(self):
|
|
|
# enter default state
|
|
|
@@ -2632,7 +2668,7 @@ class FSASimulator_SmallStep(RuntimeClassBase):
|
|
|
return self.inState(["/Main/ModeSelector/Running/Continuous"]) and self.inState(["/Main/ChildState/Initialized"]) and not self.endCondition()
|
|
|
|
|
|
def _Main_SimulationFlow_CheckTermination_1_exec(self, parameters):
|
|
|
- # print '>>> (FSA) small step executed <<<'
|
|
|
+ print '>>> (FSA) small step executed <<<'
|
|
|
self.finalize()
|
|
|
self.raiseInternalEvent(Event("FSASmallStep.Finished", None, []))
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("FSASmallStep.Finished", None, [self.clock, self.state, self.elapsed, self.event_list, self.current_event, self.selected_transition])]))
|
|
|
@@ -2717,7 +2753,7 @@ class FSASimulator_Transition(RuntimeClassBase):
|
|
|
|
|
|
def _Waiting_0_exec(self, parameters):
|
|
|
self.executeTransition()
|
|
|
- # print '>>> (FSA) transition executed <<<'
|
|
|
+ print '>>> (FSA) transition executed <<<'
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("FSATransition.Finished", None, [self.newState])]))
|
|
|
|
|
|
def initializeStatechart(self):
|
|
|
@@ -3329,7 +3365,7 @@ class CBDSimulator_Simulation(RuntimeClassBase):
|
|
|
return self.inState(["/Main/ModeSelector/Running/Realtime"]) and self.inState(["/Main/ChildState/Initialized"]) and not self.endCondition()
|
|
|
|
|
|
def _Main_SimulationFlow_CheckTermination_3_exec(self, parameters):
|
|
|
- # print '>>> (CBD) simulation executed <<<'
|
|
|
+ print '>>> (CBD) simulation executed <<<'
|
|
|
self.finalize()
|
|
|
self.raiseInternalEvent(Event("CBDSimulation.Finished", None, []))
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("CBDSimulation.Finished", None, [self.clock, self.state])]))
|
|
|
@@ -3734,7 +3770,7 @@ class CBDSimulator_BigStep(RuntimeClassBase):
|
|
|
|
|
|
def _Main_SimulationFlow_CheckTermination_1_exec(self, parameters):
|
|
|
self.finalize()
|
|
|
- # print '>>> (CBD) big step executed <<<'
|
|
|
+ print '>>> (CBD) big step executed <<<'
|
|
|
self.raiseInternalEvent(Event("CBDBigStep.Finished", None, []))
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("CBDBigStep.Finished", None, [self.clock, self.iteration, self.time_next, self.state])]))
|
|
|
|
|
|
@@ -4051,7 +4087,7 @@ class CBDSimulator_SmallStep(RuntimeClassBase):
|
|
|
return self.inState(["/Main/ModeSelector/Running/Continuous"]) and self.inState(["/Main/ChildState/Initialized"]) and not self.endCondition()
|
|
|
|
|
|
def _Main_SimulationFlow_CheckTermination_1_exec(self, parameters):
|
|
|
- # print '>>> (CBD) small step executed <<<'
|
|
|
+ print '>>> (CBD) small step executed <<<'
|
|
|
self.finalize()
|
|
|
self.raiseInternalEvent(Event("CBDSmallStep.Finished", None, []))
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("CBDSmallStep.Finished", None, [self.current_component_idx, self.state])]))
|
|
|
@@ -4142,7 +4178,7 @@ class CBDSimulator_Block(RuntimeClassBase):
|
|
|
|
|
|
def _Waiting_0_exec(self, parameters):
|
|
|
self.computeBlock()
|
|
|
- # print '>>> (CBD) block executed <<<'
|
|
|
+ print '>>> (CBD) block executed <<<'
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, 'parent', Event("CBDBlock.Finished", None, [{b.getBlockName(): b.getSignal() for b in self.cbd_controller.model.getBlocks()}])]))
|
|
|
|
|
|
def initializeStatechart(self):
|