Parcourir la source

added hybrid debugging folder (not completed)

Simon Van Mierlo il y a 9 ans
Parent
commit
2fd5464b9d
33 fichiers modifiés avec 18540 ajouts et 0 suppressions
  1. BIN
      debugging_fsa_cbd_composition/cbdsimulator/cbdsim_debugging.py.pdf
  2. 19 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/.project
  3. 11 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/.pydevproject
  4. 347 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/DEPRECATED_composed_hybrid_fsa_simulator.sccd
  5. 326 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/DEPRECATED_weaved_cbd_fsa_simulator.sccd
  6. 382 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/DEPRECATED_weaved_cbd_fsa_simulator_hierarchical.sccd
  7. 394 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/DEPRECATED_weaved_cbd_fsa_simulator_normal_form.sccd
  8. BIN
      debugging_fsa_cbd_composition/fsa_cbd_simulator/bb_vhplots.pdf
  9. BIN
      debugging_fsa_cbd_composition/fsa_cbd_simulator/bbplots.pdf
  10. BIN
      debugging_fsa_cbd_composition/fsa_cbd_simulator/bbplots_vertical.pdf
  11. 130 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/events.csv
  12. 18 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/fsa_cbd_simulator weaved_runner.py.launch
  13. BIN
      debugging_fsa_cbd_composition/fsa_cbd_simulator/fsa_cbd_simulator_debugging.py.pdf
  14. 5578 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/fsa_cbd_simulator_debugging.py.svg
  15. 20 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/fsa_cbd_weaved_classes.py
  16. 6 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/generateSCCD.bat
  17. 0 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/models/__init__.py
  18. 857 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/models/bouncing_ball_model.graphml
  19. 373 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/models/bouncing_ball_model.pdf
  20. 117 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/models/bouncingball.py
  21. 444 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/models/plots.pdf
  22. BIN
      debugging_fsa_cbd_composition/fsa_cbd_simulator/models/plots_nokick.pdf
  23. BIN
      debugging_fsa_cbd_composition/fsa_cbd_simulator/ntplot.pdf
  24. 59 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/plotSignals.r
  25. 48 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/plotSignals_horizontal.r
  26. 401 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/plots.pdf
  27. 6517 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/signals.csv
  28. 968 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/test_models.graphml
  29. 169 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/weaved_cbd_fsa_lib.py
  30. 751 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/weaved_cbd_fsa_simulator.py
  31. 73 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/weaved_runner.py
  32. 532 0
      debugging_fsa_cbd_composition/fsa_cbd_simulator/woven_fsa_cbd_simulator_hierarchical.xml
  33. BIN
      debugging_fsa_cbd_composition/fsasimulator/fsasimulator_debugging.py.pdf

BIN
debugging_fsa_cbd_composition/cbdsimulator/cbdsim_debugging.py.pdf


+ 19 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/.project

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>fsa_cbd_simulator</name>
+	<comment></comment>
+	<projects>
+		<project>cbdsimulator</project>
+		<project>fsasimulator</project>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.python.pydev.PyDevBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.python.pydev.pythonNature</nature>
+	</natures>
+</projectDescription>

+ 11 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/.pydevproject

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?eclipse-pydev version="1.0"?><pydev_project>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
+<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
+<path>/${PROJECT_DIR_NAME}</path>
+</pydev_pathproperty>
+<pydev_pathproperty name="org.python.pydev.PROJECT_EXTERNAL_SOURCE_PATH">
+<path>C:\Users\clagms\Source Control\Git_SCCD\src\build\lib</path>
+</pydev_pathproperty>
+</pydev_project>

+ 347 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/DEPRECATED_composed_hybrid_fsa_simulator.sccd

@@ -0,0 +1,347 @@
+Diagram(name = 'Weaved_CBD_FSA_Simulator_Manual',
+        author = 'Sadaf Mustafiz and Bruno Barroca and Claudio Gomes',
+        description = 'Manually woven CBD and FSA simulators with the FSA being the dominant.'):
+    Top {
+		import copy
+        from CBD_Controller import CBDController
+		import Options
+		from fsa_cbd_weaved_classes import CBDState
+		from weaved_cbd_fsa_lib import FSACBDLib
+    }
+
+    Class(name = 'Woven_CBD_FSA_Simulator', default = True):
+        Attribute(name = 'fsa_timestep')
+		Attribute(name = 'fsa_elapsed')
+		Attribute(name = 'fsa_currentState')
+		Attribute(name = 'fsa_logicalTime')
+		Attribute(name = 'fsa_currentEvent')
+		Attribute(name = 'fsa_selectedTransition')
+		Attribute(name = 'fsa_eventList')
+		
+		Attribute(name='cbd_iteration')
+        Attribute(name='cbd_strongComponentList')
+        Attribute(name='cbd_currentCompIdx')
+        Attribute(name='cbd_clock')
+        Attribute(name='cbd_options')
+        Attribute(name='cbd_delta')
+        Attribute(name='cbd_cbdController')
+		Attribute(name='cbd_depGraph')
+		
+		Attribute(name='weaved_delta')
+        Attribute(name='weaved_processing_cbd')
+        Attribute(name='weaved_ended_cbd')
+		Attribute(name='weaved_model')
+        Attribute(name='weaved_step_executed')
+        Attribute(name='weaved_global_state')
+        Attribute(name='weaved_previous_global_state')
+        Attribute(name='weaved_triggered_when_transition')
+        Attribute(name='weaved_lib')
+        
+		
+		Method fsa_getInputEventAt(time) {
+			return self.fsa_eventList->getInputAt(time)
+		}
+		
+		Method cbd_maxIterationsReached() {
+			return self.cbd_iteration >= self.cbd_options->getMaxIterations()
+        }
+		
+		Method cbd_hasNextStrongComponent() {
+			return (self.cbd_currentCompIdx + 1) < len(self.cbd_strongComponentList)
+        }
+		
+		Method cbd_currentComponentIsCycle() {
+            return self.cbd_cbdController->componentIsCycle(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_depGraph)
+        }
+		
+		Method updateGlobalState() {
+			self.weaved_previous_global_state = copy->deepcopy(self.weaved_global_state)
+            self.weaved_lib->updateGlobalState(self.weaved_global_state, self.fsa_currentState.cbd, self.cbd_clock)
+        }
+		
+		Method updateCBDState() {
+            self.weaved_lib->updateCBDState(self.weaved_global_state, self.fsa_currentState.cbd)
+        }
+		
+		Method getTriggeredWhenTransition() {
+            return self.weaved_lib->getTriggeredWhenTransition(self.weaved_model, self.fsa_currentState, self.weaved_global_state, self.weaved_previous_global_state)
+        }
+		
+        Constructor(cbd_options, amodel, fsa_events) {
+            self.weaved_lib = FSACBDLib()
+			
+			self.cbd_options = cbd_options
+			self.cbd_delta = self.cbd_options->getDeltaT()
+			
+			self.weaved_model = amodel
+			self.fsa_eventList = fsa_events
+			self.fsa_timestep = 1.0
+        }
+		StateMachine:
+			initial = 'Start'
+			State('TFSA'):
+				State('FSA_Start'):
+					Transition(target='../FSA_Prepare'):
+					Actions {
+						self.weaved_delta = min(self.fsa_timestep, self.cbd_delta)
+						self.fsa_logicalTime = 0.0
+						self.fsa_elapsed = 0
+						self.fsa_timestep = self.weaved_delta
+						self.fsa_currentState = self.weaved_model.initialState
+
+						self.weaved_processing_cbd = False
+						self.weaved_ended_cbd = False
+						self.weaved_global_state = dict()
+						self.weaved_previous_global_state = dict()
+					}
+				State('FSA_Prepare'):
+				State('FSA_Process'):
+				State('FSA_CheckTermination'):
+				State('FSA_End'):
+
+			State('CBD'):
+				State('Start'):
+				State('Prepare'):
+				State('Process'):
+				State('CheckTermination'):
+				State('End'):
+
+
+        StateMachine:
+            initial = 'FSA_Start'
+			final = 'FSA_End'
+			State('FSA_Start'):
+				Transition(target='../FSA_Prepare'):
+					Actions {
+						self.weaved_delta = min(self.fsa_timestep, self.cbd_delta)
+						self.fsa_logicalTime = 0.0
+						self.fsa_elapsed = 0
+						self.fsa_timestep = self.weaved_delta
+						self.fsa_currentState = self.weaved_model.initialState
+						
+						self.weaved_processing_cbd = False
+						self.weaved_ended_cbd = False
+						self.weaved_global_state = dict()
+						self.weaved_previous_global_state = dict()
+					}
+			State('FSA_Prepare'):
+				Transition(target='../FSA_Process'):
+					guard = { self.fsa_currentState.final == False and not isinstance(self.fsa_currentState, CBDState)}
+					Actions {
+						print('going to fsa process... ')
+					}
+				Transition(target='../ProcessChild'):
+					guard = { self.fsa_currentState.final == False and isinstance(self.fsa_currentState, CBDState)}
+					Actions {
+						print('going to cbd process... ')
+						self.weaved_step_executed = False
+					}
+				Transition(target='../FSA_End'):
+					guard = { self.fsa_currentState.final == True }
+					Actions {
+						print('going to end... ')
+					}
+				OnEnter {
+					print("Attempting to read event: ")
+					self.fsa_currentEvent = self->fsa_getInputEventAt(self.fsa_logicalTime)
+					self.fsa_selectedTransition = self.weaved_model->getTransitionFrom(self.fsa_currentState, self.fsa_currentEvent, self.fsa_elapsed)
+					
+					print("Read event: " + str(self.fsa_currentEvent))
+					print("Selected transition: " + str(self.fsa_selectedTransition))
+				}
+			State('FSA_Process'):
+				Transition(target='../FSA_Pepare'):
+					guard = {self.fsa_selectedTransition != None}
+					Actions {
+						self.fsa_currentState = self.fsa_selectedTransition.target
+						self.fsa_elapsed = 0
+						
+						self.weaved_processing_cbd = False
+						self.weaved_ended_cbd = False
+						
+						self.weaved_lib->dumpDiscreteEvent(self.weaved_model, self.fsa_logicalTime, self.fsa_currentState , self.fsa_selectedTransition)
+						self.weaved_lib->dumpGlobalState(self.weaved_model, self.weaved_global_state , self.fsa_logicalTime, self.fsa_currentState)
+						
+						print("changing to state: ")
+						print(self.fsa_currentState->getName())
+						print(self.fsa_logicalTime)
+						print(self.fsa_elapsed)
+					}
+				Transition(target='../FSA_Prepare'):
+					guard = {self.fsa_selectedTransition == None}
+					Actions {
+						self.fsa_logicalTime = self.fsa_logicalTime + self.fsa_timestep
+						self.fsa_elapsed = self.fsa_elapsed + self.fsa_timestep
+						print(self.fsa_logicalTime)
+						print(self.fsa_elapsed)
+					}
+			State('ProcessChild'):
+				Transition(target='../FSA_Prepare'):
+					guard = {self.fsa_selectedTransition != None and self.weaved_processing_cbd and (self.weaved_step_executed or self.weaved_ended_cbd)}
+					Actions {
+						self.fsa_currentState = self.fsa_selectedTransition.target
+						self.fsa_elapsed = 0
+						
+						self.weaved_processing_cbd = False
+						self.weaved_ended_cbd = False
+						
+						self.weaved_lib->dumpDiscreteEvent(self.weaved_model, self.fsa_logicalTime, self.fsa_currentState , self.fsa_selectedTransition)
+						self.weaved_lib->dumpGlobalState(self.weaved_model, self.weaved_global_state , self.fsa_logicalTime, self.fsa_currentState)
+							
+						print("changing to state: ")
+						print(self.fsa_currentState->getName())
+						print(self.fsa_logicalTime)
+						print(self.fsa_elapsed)
+					}
+				Transition(target='../FSA_Prepare'):
+					guard = {self.fsa_selectedTransition == None and self.weaved_processing_cbd and (self.weaved_step_executed or self.weaved_ended_cbd)}
+					Actions {
+						self.fsa_logicalTime = self.fsa_logicalTime + self.fsa_timestep
+						self.fsa_elapsed = self.fsa_elapsed + self.fsa_timestep
+						print("Going to FSA_Check")
+						print(self.fsa_logicalTime)
+						print(self.fsa_elapsed)
+						
+					}
+				Transition(target='../CBD_Initialize'):
+					guard = {not self.weaved_processing_cbd}
+					Actions {
+						self.cbd_delta = self.weaved_delta
+						
+						self->updateCBDState()
+					}
+				Transition(target='../CBD_CheckTerminationCondition'):
+					guard = {self.weaved_processing_cbd and not self.weaved_ended_cbd and not self.weaved_step_executed}
+					Actions {
+						self.cbd_clock = self.cbd_clock + self.cbd_delta
+						self.cbd_iteration = self.cbd_iteration + 1
+						self.cbd_cbdController->advanceTimeStep()
+						print("CBD clock: " + str(self.cbd_clock))
+						print("CBD iteration: " + str(self.cbd_iteration))	
+					}
+			State('CBD_Initialize'):
+				Transition(target='../CBD_CheckTerminationCondition'):
+					Actions {
+						print('Transition to CBD_CheckTerminationCondition')
+					}
+				OnEnter {
+					print('Performing initialization...')
+					self.cbd_iteration = 0
+					self.cbd_clock = 0.0
+					self.cbd_cbdController = CBDController(self.fsa_currentState.cbd,self.cbd_delta)
+					self.cbd_cbdController->initSimulation()
+					print("CBD clock: " + str(self.cbd_clock))
+					print("CBD iteration: " + str(self.cbd_iteration))
+				}
+			State('CBD_CheckTerminationCondition'):
+				Transition(target='../CBD_CreateDependencyGraph'):
+					guard = {not self->cbd_maxIterationsReached()}
+					Actions {
+						print('Transition to CBD_CreateDependencyGraph')
+					}
+				Transition(target='../CBD_SimulationComplete'):
+					guard = {self->cbd_maxIterationsReached()}
+					Actions {
+						print('Transition to CBD_SimulationComplete')
+					}
+			State('CBD_CreateDependencyGraph'):
+				Transition(target='../CBD_IsolateStrongComponents'):
+					Actions {
+						print('Transition to CBD_IsolateStrongComponents')
+					}
+				OnEnter {
+					self.cbd_depGraph = self.cbd_cbdController->createDepGraph(self.cbd_iteration)
+				}
+			State('CBD_IsolateStrongComponents'):
+				Transition(target='../CBD_ExecuteSimulationStep'):
+					Actions {
+						print('Transition to CBD_ExecuteSimulationStep')
+						self.cbd_currentCompIdx = -1
+					}
+				OnEnter {
+					print('Performing strong components isolation...')
+					self.cbd_strongComponentList = self.cbd_cbdController->createStrongComponents(self.cbd_depGraph, self.cbd_iteration)
+					print('Performing strong components isolation... DONE')
+				}
+			State('CBD_ExecuteSimulationStep'):
+				initial = 'CheckNextComponent'
+				State('CheckNextComponent'):
+					Transition(target='../CheckCycle'):
+						guard = {self->cbd_hasNextStrongComponent()}
+						Actions {
+							print('Transition to CheckCycle')
+							self.cbd_currentCompIdx = self.cbd_currentCompIdx + 1
+						}
+					Transition(target='../../ProcessingCBD'):
+						guard = {not self->cbd_hasNextStrongComponent()}
+						Actions {
+							self->updateGlobalState()
+							self.weaved_lib->dumpGlobalState(self.weaved_model, self.weaved_global_state , self.fsa_logicalTime, self.fsa_currentState)
+							self.weaved_triggered_when_transition = self->getTriggeredWhenTransition()
+							if self.fsa_selectedTransition == None and self.weaved_processing_cbd:
+								self.fsa_selectedTransition = self.weaved_triggered_when_transition
+							end
+							self.weaved_step_executed = True
+							self.weaved_processing_cbd = True
+							
+							print('Transition to ProcessingCBD')
+						}
+					OnEnter {
+						print('Performing CheckNextComponent...')
+						print('Performing CheckNextComponent... DONE')
+					}
+				State('CheckCycle'):
+					Transition(target='../CheckNextComponent'):
+						guard = {self->cbd_currentComponentIsCycle()}
+						Actions {
+							print('Transition to CheckNextComponent')
+							self.cbd_cbdController->computeNextAlgebraicLoop(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_iteration)
+						}
+					Transition(target='../CheckNextComponent'):
+						guard = {not self->cbd_currentComponentIsCycle()}
+						Actions {
+							print('Transition to CheckNextComponent')
+							self.cbd_cbdController->computeNextBlock(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_iteration)
+						}
+					OnEnter {
+						print('Performing CheckCycle...')
+						print('Performing CheckCycle... DONE')
+					}
+			State('CBD_SimulationComplete'):
+				Transition(target='../ProcessChild'):
+					guard = {self->cbd_maxIterationsReached()}
+					Actions {
+						self.weaved_step_executed = True
+						self.weaved_ended_cbd = True
+						self.weaved_processing_cbd = True
+						print('Transition to ProcessingCBD')
+					}
+			State('FSA_End')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 326 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/DEPRECATED_weaved_cbd_fsa_simulator.sccd

@@ -0,0 +1,326 @@
+Diagram(name = 'Weaved_FSA_CBD_Simulator_Manual',
+        author = 'Sadaf Mustafiz and Bruno Barroca and Claudio Gomes',
+        description = 'Manually woven CBD and FSA simulators with the FSA being the dominant.'):
+    Top {
+		import copy
+        from CBD_Controller import CBDController
+		import Options
+		from fsa_cbd_weaved_classes import CBDState
+		from weaved_cbd_fsa_lib import FSACBDLib
+    }
+
+    Class(name = 'Weaved_CBD_FSA_Simulator', default = True):
+        Attribute(name = 'fsa_timestep')
+		Attribute(name = 'fsa_elapsed')
+		Attribute(name = 'fsa_currentState')
+		Attribute(name = 'fsa_logicalTime')
+		Attribute(name = 'fsa_currentEvent')
+		Attribute(name = 'fsa_selectedTransition')
+		Attribute(name = 'fsa_eventList')
+		
+		Attribute(name='cbd_iteration')
+        Attribute(name='cbd_strongComponentList')
+        Attribute(name='cbd_currentCompIdx')
+        Attribute(name='cbd_clock')
+        Attribute(name='cbd_options')
+        Attribute(name='cbd_delta')
+        Attribute(name='cbd_cbdController')
+		Attribute(name='cbd_depGraph')
+		
+		Attribute(name='weaved_delta')
+        Attribute(name='weaved_processing_cbd')
+        Attribute(name='weaved_ended_cbd')
+		Attribute(name='weaved_model')
+        Attribute(name='weaved_step_executed')
+        Attribute(name='weaved_global_state')
+        Attribute(name='weaved_previous_global_state')
+        Attribute(name='weaved_triggered_when_transition')
+        Attribute(name='weaved_lib')
+        
+		Method fsa_processEvent(event) {
+			if (event != None):
+				self.fsa_eventList->popEvent(event)
+				event.processed = True
+			end
+		}
+		
+		Method fsa_getInputEventAt(time) {
+			return self.fsa_eventList->getInputAt(time)
+		}
+		
+		Method cbd_maxIterationsReached() {
+			return self.cbd_iteration >= self.cbd_options->getMaxIterations()
+        }
+		
+		Method cbd_hasNextStrongComponent() {
+			return (self.cbd_currentCompIdx + 1) < len(self.cbd_strongComponentList)
+        }
+		
+		Method cbd_currentComponentIsCycle() {
+            return self.cbd_cbdController->componentIsCycle(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_depGraph)
+        }
+		
+		Method updateGlobalState() {
+			self.weaved_previous_global_state = copy->deepcopy(self.weaved_global_state)
+            self.weaved_lib->updateGlobalState(self.weaved_global_state, self.fsa_currentState.cbd, self.cbd_clock)
+        }
+		
+		Method updateCBDState() {
+            self.weaved_lib->updateCBDState(self.weaved_global_state, self.fsa_currentState.cbd)
+        }
+		
+		Method getTriggeredWhenTransition() {
+            return self.weaved_lib->getTriggeredWhenTransition(self.weaved_model, self.fsa_currentState, self.weaved_global_state, self.weaved_previous_global_state)
+        }
+		
+        Constructor(cbd_options, amodel, fsa_events) {
+            self.weaved_lib = FSACBDLib()
+			
+			self.cbd_options = cbd_options
+			self.cbd_delta = self.cbd_options->getDeltaT()
+			
+			self.weaved_model = amodel
+			self.fsa_eventList = fsa_events
+			self.fsa_timestep = 1.0
+        }
+		
+        StateMachine:
+            initial = 'FSA_Start'
+			final = 'FSA_End'
+			State('FSA_Start'):
+				Transition(target='../FSA_Check'):
+					Actions {
+						self.weaved_delta = min(self.fsa_timestep, self.cbd_delta)
+						self.fsa_logicalTime = 0.0
+						self.fsa_elapsed = 0
+						self.fsa_timestep = self.weaved_delta
+						self.fsa_currentState = self.weaved_model.initialState
+						
+						self.weaved_processing_cbd = False
+						self.weaved_ended_cbd = False
+						self.weaved_global_state = dict()
+						self.weaved_previous_global_state = dict()
+					}
+			State('FSA_Check'):
+				Transition(target='../FSA_Processing'):
+					guard = { self.fsa_currentState.final == False and not isinstance(self.fsa_currentState, CBDState)}
+					Actions {
+						print('going to fsa process... ')
+					}
+				Transition(target='../ProcessingCBD'):
+					guard = { self.fsa_currentState.final == False and isinstance(self.fsa_currentState, CBDState)}
+					Actions {
+						print('going to cbd process... ')
+						self.weaved_step_executed = False
+					}
+				Transition(target='../FSA_End'):
+					guard = { self.fsa_currentState.final == True }
+					Actions {
+						print('going to end... ')
+					}
+				OnEnter {
+					print("Attempting to read event: ")
+					self.fsa_currentEvent = self->fsa_getInputEventAt(self.fsa_logicalTime)
+					self.fsa_selectedTransition = self.weaved_model->getTransitionFrom(self.fsa_currentState, self.fsa_currentEvent, self.fsa_elapsed)
+					
+					print("Read event: " + str(self.fsa_currentEvent))
+					print("Selected transition: " + str(self.fsa_selectedTransition))
+				}
+			State('FSA_Processing'):
+				Transition(target='../FSA_Check'):
+					guard = {self.fsa_selectedTransition != None}
+					Actions {
+						self.fsa_currentState = self.fsa_selectedTransition.target
+						self.fsa_elapsed = 0
+						self->fsa_processEvent(self.fsa_currentEvent)
+						
+						self.weaved_processing_cbd = False
+						self.weaved_ended_cbd = False
+						
+						self.weaved_lib->dumpDiscreteEvent(self.weaved_model, self.fsa_logicalTime, self.fsa_currentState , self.fsa_selectedTransition)
+						self.weaved_lib->dumpGlobalState(self.weaved_model, self.weaved_global_state , self.fsa_logicalTime, self.fsa_currentState)
+						
+						print("changing to state: ")
+						print(self.fsa_currentState->getName())
+						print(self.fsa_logicalTime)
+						print(self.fsa_elapsed)
+					}
+				Transition(target='../FSA_Check'):
+					guard = {self.fsa_selectedTransition == None}
+					Actions {
+						self.fsa_logicalTime = self.fsa_logicalTime + self.fsa_timestep
+						self.fsa_elapsed = self.fsa_elapsed + self.fsa_timestep
+						print(self.fsa_logicalTime)
+						print(self.fsa_elapsed)
+					}
+			State('ProcessingCBD'):
+				Transition(target='../FSA_Check'):
+					guard = {self.fsa_selectedTransition != None and self.weaved_processing_cbd and (self.weaved_step_executed or self.weaved_ended_cbd)}
+					Actions {
+						self.fsa_currentState = self.fsa_selectedTransition.target
+						self.fsa_elapsed = 0
+						
+						self->fsa_processEvent(self.fsa_currentEvent)
+						
+						self.weaved_processing_cbd = False
+						self.weaved_ended_cbd = False
+						
+						self.weaved_lib->dumpDiscreteEvent(self.weaved_model, self.fsa_logicalTime, self.fsa_currentState , self.fsa_selectedTransition)
+						self.weaved_lib->dumpGlobalState(self.weaved_model, self.weaved_global_state , self.fsa_logicalTime, self.fsa_currentState)
+						
+						print("changing to state: ")
+						print(self.fsa_currentState->getName())
+						print(self.fsa_logicalTime)
+						print(self.fsa_elapsed)
+					}
+				Transition(target='../FSA_Check'):
+					guard = {self.fsa_selectedTransition == None and self.weaved_processing_cbd and (self.weaved_step_executed or self.weaved_ended_cbd)}
+					Actions {
+						self.fsa_logicalTime = self.fsa_logicalTime + self.fsa_timestep
+						self.fsa_elapsed = self.fsa_elapsed + self.fsa_timestep
+						print("Going to FSA_Check")
+						print(self.fsa_logicalTime)
+						print(self.fsa_elapsed)
+						
+					}
+				Transition(target='../CBD_Initialize'):
+					guard = {not self.weaved_processing_cbd}
+					Actions {
+						self.cbd_delta = self.weaved_delta
+						self->updateCBDState()
+					}
+				Transition(target='../CBD_CheckTerminationCondition'):
+					guard = {self.weaved_processing_cbd and not self.weaved_ended_cbd and not self.weaved_step_executed}
+					Actions {
+						self.cbd_clock = self.cbd_clock + self.cbd_delta
+						self.cbd_iteration = self.cbd_iteration + 1
+						self.cbd_cbdController->advanceTimeStep()
+						print("CBD clock: " + str(self.cbd_clock))
+						print("CBD iteration: " + str(self.cbd_iteration))	
+					}
+			State('CBD_Initialize'):
+				Transition(target='../CBD_CheckTerminationCondition'):
+					Actions {
+						print('Transition to CBD_CheckTerminationCondition')
+					}
+				OnEnter {
+					print('Performing initialization...')
+					self.cbd_iteration = 0
+					self.cbd_clock = 0.0
+					self.cbd_cbdController = CBDController(self.fsa_currentState.cbd,self.cbd_delta)
+					self.cbd_cbdController->initSimulation()
+					print("CBD clock: " + str(self.cbd_clock))
+					print("CBD iteration: " + str(self.cbd_iteration))
+				}
+			State('CBD_CheckTerminationCondition'):
+				Transition(target='../CBD_CreateDependencyGraph'):
+					guard = {not self->cbd_maxIterationsReached()}
+					Actions {
+						print('Transition to CBD_CreateDependencyGraph')
+					}
+				Transition(target='../CBD_SimulationComplete'):
+					guard = {self->cbd_maxIterationsReached()}
+					Actions {
+						print('Transition to CBD_SimulationComplete')
+					}
+			State('CBD_CreateDependencyGraph'):
+				Transition(target='../CBD_IsolateStrongComponents'):
+					Actions {
+						print('Transition to CBD_IsolateStrongComponents')
+					}
+				OnEnter {
+					self.cbd_depGraph = self.cbd_cbdController->createDepGraph(self.cbd_iteration)
+				}
+			State('CBD_IsolateStrongComponents'):
+				Transition(target='../CBD_ExecuteSimulationStep'):
+					Actions {
+						print('Transition to CBD_ExecuteSimulationStep')
+						self.cbd_currentCompIdx = -1
+					}
+				OnEnter {
+					print('Performing strong components isolation...')
+					self.cbd_strongComponentList = self.cbd_cbdController->createStrongComponents(self.cbd_depGraph, self.cbd_iteration)
+					print('Performing strong components isolation... DONE')
+				}
+			State('CBD_ExecuteSimulationStep'):
+				initial = 'CheckNextComponent'
+				State('CheckNextComponent'):
+					Transition(target='../CheckCycle'):
+						guard = {self->cbd_hasNextStrongComponent()}
+						Actions {
+							print('Transition to CheckCycle')
+							self.cbd_currentCompIdx = self.cbd_currentCompIdx + 1
+						}
+					Transition(target='../../ProcessingCBD'):
+						guard = {not self->cbd_hasNextStrongComponent()}
+						Actions {
+							self->updateGlobalState()
+							self.weaved_lib->dumpGlobalState(self.weaved_model, self.weaved_global_state , self.fsa_logicalTime, self.fsa_currentState)
+							self.weaved_triggered_when_transition = self->getTriggeredWhenTransition()
+							if self.fsa_selectedTransition == None and self.weaved_processing_cbd:
+								self.fsa_selectedTransition = self.weaved_triggered_when_transition
+							end
+							self.weaved_step_executed = True
+							self.weaved_processing_cbd = True
+							
+							print('Transition to ProcessingCBD')
+						}
+					OnEnter {
+						print('Performing CheckNextComponent...')
+						print('Performing CheckNextComponent... DONE')
+					}
+				State('CheckCycle'):
+					Transition(target='../CheckNextComponent'):
+						guard = {self->cbd_currentComponentIsCycle()}
+						Actions {
+							print('Transition to CheckNextComponent')
+							self.cbd_cbdController->computeNextAlgebraicLoop(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_iteration)
+						}
+					Transition(target='../CheckNextComponent'):
+						guard = {not self->cbd_currentComponentIsCycle()}
+						Actions {
+							print('Transition to CheckNextComponent')
+							self.cbd_cbdController->computeNextBlock(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_iteration)
+						}
+					OnEnter {
+						print('Performing CheckCycle...')
+						print('Performing CheckCycle... DONE')
+					}
+			State('CBD_SimulationComplete'):
+				Transition(target='../ProcessingCBD'):
+					guard = {self->cbd_maxIterationsReached()}
+					Actions {
+						self.weaved_step_executed = True
+						self.weaved_ended_cbd = True
+						self.weaved_processing_cbd = True
+						print('Transition to ProcessingCBD')
+					}
+			State('FSA_End')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 382 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/DEPRECATED_weaved_cbd_fsa_simulator_hierarchical.sccd

@@ -0,0 +1,382 @@
+Diagram(name = 'Weaved_CBD_FSA_Simulator_Manual',
+        author = 'Sadaf Mustafiz and Bruno Barroca and Claudio Gomes',
+        description = 'Automatically woven CBD and FSA simulators with the FSA being the dominant.'):
+    Top {
+		import copy
+        from CBD_Controller import CBDController
+		import Options
+		from fsa_cbd_weaved_classes import CBDState
+		from weaved_cbd_fsa_lib import FSACBDLib
+    }
+
+    Class(name = 'Weaved_CBD_FSA_Simulator', default = True):
+        Attribute(name = 'fsa_timestep')
+		Attribute(name = 'fsa_elapsed')
+		Attribute(name = 'fsa_currentState')
+		Attribute(name = 'fsa_logicalTime')
+		Attribute(name = 'fsa_currentEvent')
+		Attribute(name = 'fsa_selectedTransition')
+		Attribute(name = 'fsa_eventList')
+		
+		Attribute(name='cbd_iteration')
+        Attribute(name='cbd_strongComponentList')
+        Attribute(name='cbd_currentCompIdx')
+        Attribute(name='cbd_clock')
+        Attribute(name='cbd_options')
+        Attribute(name='cbd_delta')
+        Attribute(name='cbd_controller')
+		Attribute(name='cbd_depGraph')
+		
+		Attribute(name='weaved_delta')
+        Attribute(name='woven_child_initialized')
+		Attribute(name='weaved_model')
+        Attribute(name='weaved_global_state')
+        Attribute(name='weaved_previous_global_state')
+        Attribute(name='weaved_triggered_when_transition')
+        Attribute(name='weaved_lib')
+        
+		Method fsa_processEvent(event) {
+			if (event != None):
+				self.fsa_eventList->popEvent(event)
+				event.processed = True
+			end
+		}
+		
+		Method fsa_getInputEventAt(time) {
+			return self.fsa_eventList->getInputAt(time)
+		}
+		
+		Method cbd_computeBlock(){
+			if self->cbd_currentComponentIsCycle():
+				self.cbd_controller->computeNextAlgebraicLoop(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_iteration)
+			else:
+				self.cbd_controller->computeNextBlock(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_iteration)
+			end
+		}
+		
+		Method cbd_maxIterationsReached() {
+			return self.cbd_iteration >= self.cbd_options->getMaxIterations()
+        }
+		
+		Method cbd_hasNextStrongComponent() {
+			return (self.cbd_currentCompIdx) < len(self.cbd_strongComponentList)
+        }
+		
+		Method cbd_currentComponentIsCycle() {
+            return self.cbd_controller->componentIsCycle(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_depGraph)
+        }
+		
+		Method updateGlobalState() {
+			self.weaved_previous_global_state = copy->deepcopy(self.weaved_global_state)
+            self.weaved_lib->updateGlobalState(self.weaved_global_state, self.fsa_currentState.cbd, self.cbd_clock)
+        }
+		
+		Method updateCBDState() {
+            self.weaved_lib->updateCBDState(self.weaved_global_state, self.fsa_currentState.cbd)
+        }
+		
+		Method getTriggeredWhenTransition() {
+            return self.weaved_lib->getTriggeredWhenTransition(self.weaved_model, self.fsa_currentState, self.weaved_global_state, self.weaved_previous_global_state)
+        }
+		
+        Constructor(cbd_options, amodel, fsa_events) {
+            self.weaved_lib = FSACBDLib()
+			
+			self.cbd_options = cbd_options
+			self.cbd_delta = self.cbd_options->getDeltaT()
+			
+			self.weaved_model = amodel
+			self.fsa_eventList = fsa_events
+			self.fsa_timestep = 1.0
+        }
+		
+        StateMachine:
+            initial = 'FSA'
+			final = 'HybridTerminated'
+			State('ParentStarted'):
+				Transition(target='../FSA/Initialized'):
+					Actions {
+						print('From ParentStarted to FSA/Initialized... ')
+						self.weaved_global_state = dict()
+						self.weaved_previous_global_state = dict()
+						self.woven_child_initialized = False
+					}
+			State('FSA'):
+				initial = 'Started'
+				State('Started'):
+					Transition(target='../../ParentStarted'):
+						Actions {
+							print('From FSA/Started to ParentStarted... ')
+							self.weaved_delta = min(self.fsa_timestep, self.cbd_delta)
+							self.fsa_logicalTime = 0.0
+							self.fsa_elapsed = 0
+							self.fsa_timestep = self.weaved_delta
+							self.fsa_currentState = self.weaved_model.initialState
+						}
+				State('Initialized'):
+					Transition(target='../CheckTermination'):
+						Actions {
+							print('From FSA/Initialized to FSA/CheckTermination... ')
+						}
+				State('CheckTermination'):
+					initial = 'MacroStepProcessed'
+					State('MacroStepProcessed'):
+						Transition(target='../../MacroStepPrepared'):
+							guard = { not self.fsa_currentState.final }
+							Actions {
+								print('From FSA/CheckTermination/MacroStepProcessed to FSA/MacroStepPrepared and reading events... ')
+								self.fsa_currentEvent = self->fsa_getInputEventAt(self.fsa_logicalTime)
+								self.fsa_selectedTransition = self.weaved_model->getTransitionFrom(self.fsa_currentState, self.fsa_currentEvent, self.fsa_elapsed)
+								print(self.fsa_currentEvent)
+								print(self.fsa_selectedTransition)
+							}
+						Transition(target='../../Terminated'):
+							guard = { self.fsa_currentState.final }
+							Actions {
+								print('From FSA/CheckTermination/MacroStepProcessed to Terminated... ')
+							}
+				State('MacroStepPrepared'):
+					Transition(target='../MicroStepProcessed'):
+						guard = { False }
+						Actions {
+							print('From FSA/MacroStepPrepared to MicroStepProcessed... ')
+						}
+					Transition(target='../../ParentPaused'):
+						Actions {
+							print('From FSA/MacroStepPrepared to ParentPaused... ')
+						}
+				State('MicroStepProcessed'):
+					Transition(target='../CheckTermination'):
+						guard = { self.fsa_selectedTransition == None}
+						Actions {
+							print('From FSA/MicroStepProcessed to FSA/CheckTermination and advancing time... ')
+							self.fsa_logicalTime = self.fsa_logicalTime + self.fsa_timestep
+							self.fsa_elapsed = self.fsa_elapsed + self.fsa_timestep
+							print(self.fsa_logicalTime)
+							print(self.fsa_elapsed)
+						}
+					Transition(target='../MicroStepPrepared'):
+						guard = { self.fsa_selectedTransition != None }
+						Actions {
+							print('From FSA/MicroStepProcessed to MicroStepPrepared... ')
+						}
+				State('MicroStepPrepared'):
+					Transition(target='../MicroStepProcessed'):
+						guard = { False }
+						Actions {
+							print('From FSA/MicroStepPrepared to MicroStepProcessed and attempting to take transition... ')
+							print('Transition to be taken: ' + str(self.fsa_selectedTransition))
+							self.fsa_currentState = self.fsa_selectedTransition.target
+							self.fsa_elapsed = 0
+							self->fsa_processEvent(self.fsa_currentEvent)
+							self.weaved_lib->dumpDiscreteEvent(self.weaved_model, self.fsa_logicalTime, self.fsa_currentState , self.fsa_selectedTransition)
+							self.weaved_lib->dumpGlobalState(self.weaved_model, self.weaved_global_state , self.fsa_logicalTime, self.fsa_currentState)
+							print('New state: ' + str(self.fsa_currentState))
+							
+							print('Reading events:')
+							self.fsa_currentEvent = self->fsa_getInputEventAt(self.fsa_logicalTime)
+							self.fsa_selectedTransition = self.weaved_model->getTransitionFrom(self.fsa_currentState, self.fsa_currentEvent, self.fsa_elapsed)
+							print(self.fsa_currentEvent)
+							print(self.fsa_selectedTransition)
+						}
+					Transition(target='../../ParentMicroStepProcessed'):
+						Actions {
+							print('From FSA/MicroStepPrepared to ParentMicroStepProcessed and attempting to take transition... ')
+							print('Transition to be taken: ' + str(self.fsa_selectedTransition))
+							self.fsa_currentState = self.fsa_selectedTransition.target
+							self.fsa_elapsed = 0
+							self->fsa_processEvent(self.fsa_currentEvent)
+							self.weaved_lib->dumpDiscreteEvent(self.weaved_model, self.fsa_logicalTime, self.fsa_currentState , self.fsa_selectedTransition)
+							self.weaved_lib->dumpGlobalState(self.weaved_model, self.weaved_global_state , self.fsa_logicalTime, self.fsa_currentState)
+							print('New state: ' + str(self.fsa_currentState))
+							
+							print('Reading events:')
+							self.fsa_currentEvent = self->fsa_getInputEventAt(self.fsa_logicalTime)
+							self.fsa_selectedTransition = self.weaved_model->getTransitionFrom(self.fsa_currentState, self.fsa_currentEvent, self.fsa_elapsed)
+							print(self.fsa_currentEvent)
+							print(self.fsa_selectedTransition)
+						}
+				State('Terminated'):
+					Transition(target='../../HybridTerminated'):
+						Actions {
+							print('From FSA/Terminated to HybridTerminated... ')
+						}
+			State('ParentMicroStepProcessed'):
+				Transition(target='../ParentPaused'):
+					Actions {
+						print('From ParentMicroStepProcessed to ParentPaused and resetting the child... ')
+						self.woven_child_initialized = False
+					}
+			State('HybridTerminated')
+			State('ChildNotInitialized'):
+				Transition(target='../CBD/Started'):
+					Actions {
+						print('From ChildNotInitialized to CBD/Started... ')
+						self.cbd_delta = self.weaved_delta
+						self->updateCBDState()
+						self.woven_child_initialized = True
+					}
+			State('ChildInitialized'):
+				Transition(target='../CBD/MacroStepProcessed'):
+					Actions {
+						print('From ChildInitialized to CBD/MacroStepProcessed... ')
+						self.cbd_clock = self.cbd_clock + self.cbd_delta
+						self.cbd_iteration = self.cbd_iteration + 1
+						self.cbd_controller->advanceTimeStep()
+						print("CBD clock: " + str(self.cbd_clock))
+						print("CBD iteration: " + str(self.cbd_iteration))	
+					}
+			State('ChildPaused'):
+				Transition(target='../StateEventDetected'):
+					guard = { self.weaved_triggered_when_transition != None }
+					Actions {
+						print('From ChildPaused to StateEventDetected... ')
+					}
+				Transition(target='../NoStateEventDetected'):
+					guard = { self.weaved_triggered_when_transition == None }
+					Actions {
+						print('From ChildPaused to NoStateEventDetected... ')
+					}
+			State('NoStateEventDetected'):
+				Transition(target='../ChildProcessed'):
+					Actions {
+						print('From NoStateEventDetected to ChildProcessed... ')
+					}
+			State('StateEventDetected'):
+				Transition(target='../ChildProcessed'):
+					Actions {
+						print('From StateEventDetected to ChildProcessed... ')
+						if self.fsa_selectedTransition == None:
+							self.fsa_selectedTransition = self.weaved_triggered_when_transition
+						end
+					}
+			State('ChildProcessed'):
+				Transition(target='../FSA/MicroStepProcessed'):
+					Actions {
+						print('From ChildProcessed to FSA/MicroStepProcessed... ')
+					}
+			State('ParentPaused'):
+				Transition(target='../ChildProcessed'):
+					guard = { not isinstance(self.fsa_currentState, CBDState) }
+					Actions {
+						print('From ParentPaused to ChildProcessed without any child to process... ')
+					}
+				Transition(target='../ChildDetected'):
+					guard = { isinstance(self.fsa_currentState, CBDState) }
+					Actions {
+						print('From ParentPaused to ChildDetected... ')
+						self.cbd_model = self.fsa_currentState.cbd
+					}
+			State('ChildDetected'):
+				Transition(target='../ChildNotInitialized'):
+					guard = { not self.woven_child_initialized }
+					Actions {
+						print('From ChildDetected to ChildNotInitialized... ')
+					}
+				Transition(target='../ChildInitialized'):
+					guard = { self.woven_child_initialized }
+					Actions {
+						print('From ChildDetected to ChildInitialized... ')
+					}
+			State('CBD'):
+				initial = 'Started'
+				State('Started'):
+					Transition(target='../Initialized'):
+						Actions {
+							print('From CBD/Started to Initialized... ')
+							print('Performing initialization...')
+							self.cbd_iteration = 0
+							self.cbd_clock = 0
+							self.cbd_controller = CBDController(self.cbd_model,self.cbd_delta)
+							self.cbd_controller->initSimulation()
+							print('Performing initialization... DONE')
+						}
+				State('Initialized'):
+					Transition(target='../MacroStepProcessed'):
+						Actions {
+							print('From CBD/Initialized to MacroStepProcessed... ')
+						}
+				State('MacroStepProcessed'):
+					Transition(target='../MacroStepPrepared'):
+						guard = { not self->cbd_maxIterationsReached() }
+						Actions {
+							print('From CBD/MacroStepProcessed to MacroStepPrepared... ')
+							self.cbd_currentCompIdx = 0
+							self.cbd_depGraph = self.cbd_controller->createDepGraph(self.cbd_iteration)
+							self.cbd_strongComponentList = self.cbd_controller->createStrongComponents(self.cbd_depGraph, self.cbd_iteration)
+						}
+					Transition(target='../Terminated'):
+						guard = { self->cbd_maxIterationsReached() }
+						Actions {
+							print('From CBD/MacroStepProcessed to Terminated... ')
+						}
+				State('MacroStepPrepared'):
+					Transition(target='../MicroStepProcessed'):
+						Actions {
+							print('From CBD/MacroStepPrepared to MicroStepProcessed... ')
+						}
+				State('MicroStepProcessed'):
+					Transition(target='../MacroStepProcessed'):
+						guard = { not self->cbd_hasNextStrongComponent() and False }
+						Actions {
+							print('From CBD/MicroStepProcessed to MacroStepProcessed and advancing time... ')
+							self.cbd_clock = self.cbd_clock + self.cbd_delta
+							self.cbd_iteration = self.cbd_iteration + 1
+							self.cbd_controller->advanceTimeStep()
+							print("CBD clock: " + str(self.cbd_clock))
+							print("CBD iteration: " + str(self.cbd_iteration))
+						}
+					Transition(target='../../ChildPaused'):
+						guard = { not self->cbd_hasNextStrongComponent() }
+						Actions {
+							print('From CBD/MicroStepProcessed to ChildPaused and detecting triggered transitions... ')
+							self->updateGlobalState()
+							self.weaved_lib->dumpGlobalState(self.weaved_model, self.weaved_global_state , self.fsa_logicalTime, self.fsa_currentState)
+							self.weaved_triggered_when_transition = self->getTriggeredWhenTransition()
+						}
+					Transition(target='../MicroStepPrepared'):
+						guard = { self->cbd_hasNextStrongComponent() }
+						Actions {
+							print('From CBD/MicroStepProcessed to MicroStepPrepared')
+						}
+				State('MicroStepPrepared'):
+					Transition(target='../MicroStepProcessed'):
+						Actions {
+							print('From CBD/MicroStepPrepared to MicroStepProcessed...')
+							self->cbd_computeBlock()
+							self.cbd_currentCompIdx = self.cbd_currentCompIdx + 1
+						}
+				State('Terminated'):
+					Transition(target='../../HybridTerminated'):
+						Actions {
+							print('From CBD/Terminated to HybridTerminated... ')
+						}
+				
+			
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 394 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/DEPRECATED_weaved_cbd_fsa_simulator_normal_form.sccd

@@ -0,0 +1,394 @@
+Diagram(name = 'Weaved_CBD_FSA_Simulator_Manual',
+        author = 'Sadaf Mustafiz and Bruno Barroca and Claudio Gomes',
+        description = 'Automatically woven CBD and FSA simulators with the FSA being the dominant.'):
+    Top {
+		import copy
+        from CBD_Controller import CBDController
+		import Options
+		from fsa_cbd_weaved_classes import CBDState
+		from weaved_cbd_fsa_lib import FSACBDLib
+    }
+
+    Class(name = 'Weaved_CBD_FSA_Simulator', default = True):
+        Attribute(name = 'fsa_timestep')
+		Attribute(name = 'fsa_elapsed')
+		Attribute(name = 'fsa_currentState')
+		Attribute(name = 'fsa_logicalTime')
+		Attribute(name = 'fsa_currentEvent')
+		Attribute(name = 'fsa_selectedTransition')
+		Attribute(name = 'fsa_eventList')
+		
+		Attribute(name='cbd_iteration')
+        Attribute(name='cbd_strongComponentList')
+        Attribute(name='cbd_currentCompIdx')
+        Attribute(name='cbd_clock')
+        Attribute(name='cbd_options')
+        Attribute(name='cbd_delta')
+        Attribute(name='cbd_controller')
+		Attribute(name='cbd_depGraph')
+		
+		Attribute(name='weaved_delta')
+        Attribute(name='woven_child_initialized')
+		Attribute(name='weaved_model')
+        Attribute(name='weaved_global_state')
+        Attribute(name='weaved_previous_global_state')
+        Attribute(name='weaved_triggered_when_transition')
+        Attribute(name='weaved_lib')
+        
+		Method fsa_processEvent(event) {
+			if (event != None):
+				self.fsa_eventList->popEvent(event)
+				event.processed = True
+			end
+		}
+		
+		Method fsa_getInputEventAt(time) {
+			return self.fsa_eventList->getInputAt(time)
+		}
+		
+		Method cbd_computeBlock(){
+			if self->cbd_currentComponentIsCycle():
+				self.cbd_controller->computeNextAlgebraicLoop(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_iteration)
+			else:
+				self.cbd_controller->computeNextBlock(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_iteration)
+			end
+		}
+		
+		Method cbd_maxIterationsReached() {
+			return self.cbd_iteration >= self.cbd_options->getMaxIterations()
+        }
+		
+		Method cbd_hasNextStrongComponent() {
+			return (self.cbd_currentCompIdx) < len(self.cbd_strongComponentList)
+        }
+		
+		Method cbd_currentComponentIsCycle() {
+            return self.cbd_controller->componentIsCycle(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_depGraph)
+        }
+		
+		Method updateGlobalState() {
+			self.weaved_previous_global_state = copy->deepcopy(self.weaved_global_state)
+            self.weaved_lib->updateGlobalState(self.weaved_global_state, self.fsa_currentState.cbd, self.cbd_clock)
+        }
+		
+		Method updateCBDState() {
+            self.weaved_lib->updateCBDState(self.weaved_global_state, self.fsa_currentState.cbd)
+        }
+		
+		Method getTriggeredWhenTransition() {
+            return self.weaved_lib->getTriggeredWhenTransition(self.weaved_model, self.fsa_currentState, self.weaved_global_state, self.weaved_previous_global_state)
+        }
+		
+        Constructor(cbd_options, amodel, fsa_events) {
+            self.weaved_lib = FSACBDLib()
+			
+			self.cbd_options = cbd_options
+			self.cbd_delta = self.cbd_options->getDeltaT()
+			
+			self.weaved_model = amodel
+			self.fsa_eventList = fsa_events
+			self.fsa_timestep = 1.0
+        }
+		
+        StateMachine:
+            initial = 'FSA'
+			final = 'HybridTerminated'
+			State('ParentStarted'):
+				Transition(target='../FSA/Initialized'):
+					Actions {
+						print('From ParentStarted to FSA/Initialized... ')
+						self.weaved_global_state = dict()
+						self.weaved_previous_global_state = dict()
+						self.woven_child_initialized = False
+					}
+			State('FSA'):
+				initial = 'Started'
+				State('Started'):
+					Transition(target='../Initialized'):
+						guard = { False }
+						Actions {
+							print('From FSA/Started to Initialized... ')
+							self.weaved_delta = min(self.fsa_timestep, self.cbd_delta)
+							self.fsa_logicalTime = 0.0
+							self.fsa_elapsed = 0
+							self.fsa_timestep = self.weaved_delta
+							self.fsa_currentState = self.weaved_model.initialState
+							
+							self.weaved_global_state = dict()
+							self.weaved_previous_global_state = dict()
+						}
+					Transition(target='../../ParentStarted'):
+						Actions {
+							print('From FSA/Started to ParentStarted... ')
+							self.weaved_delta = min(self.fsa_timestep, self.cbd_delta)
+							self.fsa_logicalTime = 0.0
+							self.fsa_elapsed = 0
+							self.fsa_timestep = self.weaved_delta
+							self.fsa_currentState = self.weaved_model.initialState
+							
+						}
+				State('Initialized'):
+					Transition(target='../MacroStepProcessed'):
+						Actions {
+							print('From FSA/Initialized to MacroStepProcessed... ')
+						}
+				State('MacroStepProcessed'):
+					Transition(target='../MacroStepPrepared'):
+						guard = { not self.fsa_currentState.final }
+						Actions {
+							print('From FSA/MacroStepProcessed to MacroStepPrepared and reading events... ')
+							self.fsa_currentEvent = self->fsa_getInputEventAt(self.fsa_logicalTime)
+							self.fsa_selectedTransition = self.weaved_model->getTransitionFrom(self.fsa_currentState, self.fsa_currentEvent, self.fsa_elapsed)
+							print(self.fsa_currentEvent)
+							print(self.fsa_selectedTransition)
+						}
+					Transition(target='../Terminated'):
+						guard = { self.fsa_currentState.final }
+						Actions {
+							print('From FSA/MacroStepProcessed to Terminated... ')
+						}
+				State('MacroStepPrepared'):
+					Transition(target='../MicroStepProcessed'):
+						guard = { False }
+						Actions {
+							print('From FSA/MacroStepPrepared to MicroStepProcessed... ')
+						}
+					Transition(target='../../ParentPaused'):
+						Actions {
+							print('From FSA/MacroStepPrepared to ParentPaused... ')
+						}
+				State('MicroStepProcessed'):
+					Transition(target='../MacroStepProcessed'):
+						guard = { self.fsa_selectedTransition == None}
+						Actions {
+							print('From FSA/MicroStepProcessed to MacroStepProcessed and advancing time... ')
+							self.fsa_logicalTime = self.fsa_logicalTime + self.fsa_timestep
+							self.fsa_elapsed = self.fsa_elapsed + self.fsa_timestep
+							print(self.fsa_logicalTime)
+							print(self.fsa_elapsed)
+						}
+					Transition(target='../MicroStepPrepared'):
+						guard = { self.fsa_selectedTransition != None }
+						Actions {
+							print('From FSA/MicroStepProcessed to MicroStepPrepared... ')
+						}
+				State('MicroStepPrepared'):
+					Transition(target='../MicroStepProcessed'):
+						guard = { False }
+						Actions {
+							print('From FSA/MicroStepPrepared to MicroStepProcessed and attempting to take transition... ')
+							print('Transition to be taken: ' + str(self.fsa_selectedTransition))
+							self.fsa_currentState = self.fsa_selectedTransition.target
+							self.fsa_elapsed = 0
+							self->fsa_processEvent(self.fsa_currentEvent)
+							self.weaved_lib->dumpDiscreteEvent(self.weaved_model, self.fsa_logicalTime, self.fsa_currentState , self.fsa_selectedTransition)
+							self.weaved_lib->dumpGlobalState(self.weaved_model, self.weaved_global_state , self.fsa_logicalTime, self.fsa_currentState)
+							print('New state: ' + str(self.fsa_currentState))
+							
+							print('Reading events:')
+							self.fsa_currentEvent = self->fsa_getInputEventAt(self.fsa_logicalTime)
+							self.fsa_selectedTransition = self.weaved_model->getTransitionFrom(self.fsa_currentState, self.fsa_currentEvent, self.fsa_elapsed)
+							print(self.fsa_currentEvent)
+							print(self.fsa_selectedTransition)
+						}
+					Transition(target='../../ParentMicroStepProcessed'):
+						Actions {
+							print('From FSA/MicroStepPrepared to ParentMicroStepProcessed and attempting to take transition... ')
+							print('Transition to be taken: ' + str(self.fsa_selectedTransition))
+							self.fsa_currentState = self.fsa_selectedTransition.target
+							self.fsa_elapsed = 0
+							self->fsa_processEvent(self.fsa_currentEvent)
+							self.weaved_lib->dumpDiscreteEvent(self.weaved_model, self.fsa_logicalTime, self.fsa_currentState , self.fsa_selectedTransition)
+							self.weaved_lib->dumpGlobalState(self.weaved_model, self.weaved_global_state , self.fsa_logicalTime, self.fsa_currentState)
+							print('New state: ' + str(self.fsa_currentState))
+							
+							print('Reading events:')
+							self.fsa_currentEvent = self->fsa_getInputEventAt(self.fsa_logicalTime)
+							self.fsa_selectedTransition = self.weaved_model->getTransitionFrom(self.fsa_currentState, self.fsa_currentEvent, self.fsa_elapsed)
+							print(self.fsa_currentEvent)
+							print(self.fsa_selectedTransition)
+						}
+				State('Terminated'):
+					Transition(target='../../HybridTerminated'):
+						Actions {
+							print('From FSA/Terminated to HybridTerminated... ')
+						}
+			State('ParentMicroStepProcessed'):
+				Transition(target='../ParentPaused'):
+					Actions {
+						print('From ParentMicroStepProcessed to ParentPaused and resetting the child... ')
+						self.woven_child_initialized = False
+					}
+			State('HybridTerminated')
+			State('ChildNotInitialized'):
+				Transition(target='../CBD/Started'):
+					Actions {
+						print('From ChildNotInitialized to CBD/Started... ')
+						self.cbd_delta = self.weaved_delta
+						self->updateCBDState()
+						self.woven_child_initialized = True
+					}
+			State('ChildInitialized'):
+				Transition(target='../CBD/MacroStepProcessed'):
+					Actions {
+						print('From ChildInitialized to CBD/MacroStepProcessed... ')
+						self.cbd_clock = self.cbd_clock + self.cbd_delta
+						self.cbd_iteration = self.cbd_iteration + 1
+						self.cbd_controller->advanceTimeStep()
+						print("CBD clock: " + str(self.cbd_clock))
+						print("CBD iteration: " + str(self.cbd_iteration))	
+					}
+			State('ChildPaused'):
+				Transition(target='../StateEventDetected'):
+					guard = { self.weaved_triggered_when_transition != None }
+					Actions {
+						print('From ChildPaused to StateEventDetected... ')
+					}
+				Transition(target='../NoStateEventDetected'):
+					guard = { self.weaved_triggered_when_transition == None }
+					Actions {
+						print('From ChildPaused to NoStateEventDetected... ')
+					}
+			State('NoStateEventDetected'):
+				Transition(target='../ChildProcessed'):
+					Actions {
+						print('From NoStateEventDetected to ChildProcessed... ')
+					}
+			State('StateEventDetected'):
+				Transition(target='../ChildProcessed'):
+					Actions {
+						print('From StateEventDetected to ChildProcessed... ')
+						if self.fsa_selectedTransition == None:
+							self.fsa_selectedTransition = self.weaved_triggered_when_transition
+						end
+					}
+			State('ChildProcessed'):
+				Transition(target='../FSA/MicroStepProcessed'):
+					Actions {
+						print('From ChildProcessed to FSA/MicroStepProcessed... ')
+					}
+			State('ParentPaused'):
+				Transition(target='../ChildProcessed'):
+					guard = { not isinstance(self.fsa_currentState, CBDState) }
+					Actions {
+						print('From ParentPaused to ChildProcessed without any child to process... ')
+					}
+				Transition(target='../ChildDetected'):
+					guard = { isinstance(self.fsa_currentState, CBDState) }
+					Actions {
+						print('From ParentPaused to ChildDetected... ')
+						self.cbd_model = self.fsa_currentState.cbd
+					}
+			State('ChildDetected'):
+				Transition(target='../ChildNotInitialized'):
+					guard = { not self.woven_child_initialized }
+					Actions {
+						print('From ChildDetected to ChildNotInitialized... ')
+					}
+				Transition(target='../ChildInitialized'):
+					guard = { self.woven_child_initialized }
+					Actions {
+						print('From ChildDetected to ChildInitialized... ')
+					}
+			State('CBD'):
+				initial = 'Started'
+				State('Started'):
+					Transition(target='../Initialized'):
+						Actions {
+							print('From CBD/Started to Initialized... ')
+							print('Performing initialization...')
+							self.cbd_iteration = 0
+							self.cbd_clock = 0
+							self.cbd_controller = CBDController(self.cbd_model,self.cbd_delta)
+							self.cbd_controller->initSimulation()
+							print('Performing initialization... DONE')
+						}
+				State('Initialized'):
+					Transition(target='../MacroStepProcessed'):
+						Actions {
+							print('From CBD/Initialized to MacroStepProcessed... ')
+						}
+				State('MacroStepProcessed'):
+					Transition(target='../MacroStepPrepared'):
+						guard = { not self->cbd_maxIterationsReached() }
+						Actions {
+							print('From CBD/MacroStepProcessed to MacroStepPrepared... ')
+							self.cbd_currentCompIdx = 0
+							self.cbd_depGraph = self.cbd_controller->createDepGraph(self.cbd_iteration)
+							self.cbd_strongComponentList = self.cbd_controller->createStrongComponents(self.cbd_depGraph, self.cbd_iteration)
+						}
+					Transition(target='../Terminated'):
+						guard = { self->cbd_maxIterationsReached() }
+						Actions {
+							print('From CBD/MacroStepProcessed to Terminated... ')
+						}
+				State('MacroStepPrepared'):
+					Transition(target='../MicroStepProcessed'):
+						Actions {
+							print('From CBD/MacroStepPrepared to MicroStepProcessed... ')
+						}
+				State('MicroStepProcessed'):
+					Transition(target='../MacroStepProcessed'):
+						guard = { not self->cbd_hasNextStrongComponent() and False }
+						Actions {
+							print('From CBD/MicroStepProcessed to MacroStepProcessed and advancing time... ')
+							self.cbd_clock = self.cbd_clock + self.cbd_delta
+							self.cbd_iteration = self.cbd_iteration + 1
+							self.cbd_controller->advanceTimeStep()
+							print("CBD clock: " + str(self.cbd_clock))
+							print("CBD iteration: " + str(self.cbd_iteration))
+						}
+					Transition(target='../../ChildPaused'):
+						guard = { not self->cbd_hasNextStrongComponent() }
+						Actions {
+							print('From CBD/MicroStepProcessed to ChildPaused and detecting triggered transitions... ')
+							self->updateGlobalState()
+							self.weaved_lib->dumpGlobalState(self.weaved_model, self.weaved_global_state , self.fsa_logicalTime, self.fsa_currentState)
+							self.weaved_triggered_when_transition = self->getTriggeredWhenTransition()
+						}
+					Transition(target='../MicroStepPrepared'):
+						guard = { self->cbd_hasNextStrongComponent() }
+						Actions {
+							print('From CBD/MicroStepProcessed to MicroStepPrepared')
+						}
+				State('MicroStepPrepared'):
+					Transition(target='../MicroStepProcessed'):
+						Actions {
+							print('From CBD/MicroStepPrepared to MicroStepProcessed...')
+							self->cbd_computeBlock()
+							self.cbd_currentCompIdx = self.cbd_currentCompIdx + 1
+						}
+				State('Terminated'):
+					Transition(target='../../HybridTerminated'):
+						Actions {
+							print('From CBD/Terminated to HybridTerminated... ')
+						}
+				
+			
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

BIN
debugging_fsa_cbd_composition/fsa_cbd_simulator/bb_vhplots.pdf


BIN
debugging_fsa_cbd_composition/fsa_cbd_simulator/bbplots.pdf


BIN
debugging_fsa_cbd_composition/fsa_cbd_simulator/bbplots_vertical.pdf


+ 130 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/events.csv

@@ -0,0 +1,130 @@
+fsatime,Event

+3.6299999999999666,when(x +-)

+7.009999999999895,when(x +-)

+9.729999999999837,when(x +-)

+11.91999999999979,when(x +-)

+12.999999999999767,kick

+16.87999999999984,when(x +-)

+20.160000000000352,when(x +-)

+22.800000000000765,when(x +-)

+23.000000000000796,kick

+28.870000000001713,when(x +-)

+33.640000000001876,when(x +-)

+37.00000000000121,kick

+38.99000000000081,when(x +-)

+41.240000000000364,when(x +-)

+43.050000000000004,when(x +-)

+44.509999999999714,when(x +-)

+45.69999999999948,when(x +-)

+46.669999999999284,when(x +-)

+47.45999999999913,when(x +-)

+48.109999999999,when(x +-)

+48.63999999999889,when(x +-)

+49.079999999998805,when(x +-)

+49.44999999999873,when(x +-)

+49.75999999999867,when(x +-)

+50.029999999998616,when(x +-)

+50.25999999999857,when(x +-)

+50.45999999999853,when(x +-)

+50.639999999998494,when(x +-)

+50.79999999999846,when(x +-)

+50.94999999999843,when(x +-)

+51.089999999998405,when(x +-)

+51.20999999999838,when(x +-)

+51.31999999999836,when(x +-)

+51.42999999999834,when(x +-)

+51.539999999998315,when(x +-)

+51.639999999998295,when(x +-)

+51.739999999998275,when(x +-)

+51.839999999998255,when(x +-)

+51.92999999999824,when(x +-)

+52.01999999999822,when(x +-)

+52.1099999999982,when(x +-)

+52.199999999998184,when(x +-)

+52.289999999998166,when(x +-)

+52.37999999999815,when(x +-)

+52.46999999999813,when(x +-)

+52.55999999999811,when(x +-)

+52.649999999998094,when(x +-)

+52.739999999998076,when(x +-)

+52.82999999999806,when(x +-)

+52.91999999999804,when(x +-)

+53.00999999999802,when(x +-)

+53.099999999998005,when(x +-)

+53.18999999999799,when(x +-)

+53.27999999999797,when(x +-)

+53.36999999999795,when(x +-)

+53.45999999999793,when(x +-)

+53.549999999997915,when(x +-)

+53.6399999999979,when(x +-)

+53.72999999999788,when(x +-)

+53.81999999999786,when(x +-)

+53.909999999997844,when(x +-)

+53.999999999997826,when(x +-)

+54.08999999999781,when(x +-)

+54.17999999999779,when(x +-)

+54.26999999999777,when(x +-)

+54.359999999997754,when(x +-)

+54.449999999997736,when(x +-)

+54.53999999999772,when(x +-)

+54.6299999999977,when(x +-)

+54.71999999999768,when(x +-)

+54.809999999997665,when(x +-)

+54.89999999999765,when(x +-)

+54.98999999999763,when(x +-)

+55.07999999999761,when(x +-)

+55.16999999999759,when(x +-)

+55.259999999997575,when(x +-)

+55.34999999999756,when(x +-)

+55.43999999999754,when(x +-)

+55.52999999999752,when(x +-)

+55.6199999999975,when(x +-)

+55.709999999997486,when(x +-)

+55.79999999999747,when(x +-)

+55.88999999999745,when(x +-)

+55.97999999999743,when(x +-)

+56.069999999997414,when(x +-)

+56.159999999997396,when(x +-)

+56.24999999999738,when(x +-)

+56.33999999999736,when(x +-)

+56.42999999999734,when(x +-)

+56.519999999997324,when(x +-)

+56.60999999999731,when(x +-)

+56.69999999999729,when(x +-)

+56.78999999999727,when(x +-)

+56.87999999999725,when(x +-)

+56.969999999997235,when(x +-)

+57.05999999999722,when(x +-)

+57.1499999999972,when(x +-)

+57.23999999999718,when(x +-)

+57.32999999999716,when(x +-)

+57.419999999997145,when(x +-)

+57.50999999999713,when(x +-)

+57.59999999999711,when(x +-)

+57.68999999999709,when(x +-)

+57.779999999997074,when(x +-)

+57.869999999997056,when(x +-)

+57.95999999999704,when(x +-)

+58.04999999999702,when(x +-)

+58.139999999997,when(x +-)

+58.229999999996984,when(x +-)

+58.319999999996966,when(x +-)

+58.40999999999695,when(x +-)

+58.49999999999693,when(x +-)

+58.58999999999691,when(x +-)

+58.679999999996895,when(x +-)

+58.76999999999688,when(x +-)

+58.85999999999686,when(x +-)

+58.94999999999684,when(x +-)

+59.03999999999682,when(x +-)

+59.129999999996805,when(x +-)

+59.21999999999679,when(x +-)

+59.30999999999677,when(x +-)

+59.39999999999675,when(x +-)

+59.48999999999673,when(x +-)

+59.579999999996716,when(x +-)

+59.6699999999967,when(x +-)

+59.75999999999668,when(x +-)

+59.84999999999666,when(x +-)

+59.939999999996644,when(x +-)

+59.99999999999663,enough


+ 18 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/fsa_cbd_simulator weaved_runner.py.launch

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.python.pydev.debug.regularLaunchConfigurationType">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/fsa_cbd_simulator/weaved_runner.py"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.debug.ui.ATTR_CAPTURE_IN_FILE" value="${workspace_loc:/fsa_cbd_simulator/log.txt}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:fsa_cbd_simulator/weaved_runner.py}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_OTHER_WORKING_DIRECTORY" value="${workspace_loc:fsa_cbd_simulator}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value=""/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:fsa_cbd_simulator}"/>
+<stringAttribute key="org.python.pydev.debug.ATTR_INTERPRETER" value="__default"/>
+<stringAttribute key="org.python.pydev.debug.ATTR_PROJECT" value="fsa_cbd_simulator"/>
+<intAttribute key="org.python.pydev.debug.ATTR_RESOURCE_TYPE" value="1"/>
+<stringAttribute key="process_factory_id" value="org.python.pydev.debug.processfactory.PyProcessFactory"/>
+</launchConfiguration>

BIN
debugging_fsa_cbd_composition/fsa_cbd_simulator/fsa_cbd_simulator_debugging.py.pdf


Fichier diff supprimé car celui-ci est trop grand
+ 5578 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/fsa_cbd_simulator_debugging.py.svg


+ 20 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/fsa_cbd_weaved_classes.py

@@ -0,0 +1,20 @@
+from fsaclasses import State, Trigger
+from CBDMultipleOutput.Source.CBD import ConstantBlock
+
+
+class CBDState(State):
+    def __init__(self, name, cbdModel, final = False):
+        State.__init__(self, name, final)
+        self.cbd = cbdModel
+        
+    def getName(self):
+        return self.name
+
+class WhenCrossesZeroTrigger(Trigger):
+    def __init__(self, varname, up_direction = True):
+        self.varname = varname
+        self.up_direction = up_direction
+
+
+class InputConstantBlock(ConstantBlock):
+    pass

+ 6 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/generateSCCD.bat

@@ -0,0 +1,6 @@
+@ECHO OFF
+setlocal
+set PYTHONPATH=C:\Users\clagms\Source Control\Git_SCCD\src\build\lib
+python -m sccd.compiler.sccdc -p threads -l python -o weaved_cbd_fsa_simulator.py woven_fsa_cbd_simulator_hierarchical.xml
+endlocal
+pause

+ 0 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/models/__init__.py


Fichier diff supprimé car celui-ci est trop grand
+ 857 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/models/bouncing_ball_model.graphml


+ 373 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/models/bouncing_ball_model.pdf

@@ -0,0 +1,373 @@
+%PDF-1.4
+%âãÏÓ
+1 0 obj
+   << 
+      /Title ()
+      /Author ()
+      /Subject ()
+      /Keywords ()
+      /Creator (yExport 1.5)
+      /Producer (org.freehep.graphicsio.pdf.YPDFGraphics2D 1.5)
+      /CreationDate (D:20151030112720-04'00')
+      /ModDate (D:20151030112720-04'00')
+      /Trapped /False
+   >>
+endobj
+2 0 obj
+   << 
+      /Type /Catalog
+      /Pages 3 0 R
+      /ViewerPreferences 4 0 R
+      /OpenAction [5 0 R /Fit]
+   >>
+endobj
+4 0 obj
+   << 
+      /FitWindow true
+      /CenterWindow false
+   >>
+endobj
+5 0 obj
+   << 
+      /Parent 3 0 R
+      /Type /Page
+      /Contents 6 0 R
+   >>
+endobj
+6 0 obj
+   << 
+      /Length 7 0 R
+      /Filter [/ASCII85Decode /FlateDecode]
+   >>
+stream
+Gb"/L3KL#KP+:FEU20j9ikCec":1)DHH$d()+"YX26$g3ruVds,*V(J<U[Y9h7>r!i3gt1K&jruR7nsL
+A2:lRp$X1hr-XP9Yg9]UG^92Vm=0P29_dZ&a@PXlh6DD!rp;FupM[fpqo<XTA**<#s5!SPr9_8;QiI&7
+T!G_qs8Ch>&-#H*r`f:Or6rG]j+$k(=Oo9FT%j6<RqLH32IAo3T;qbV-2q6B.q'O>"rBSc6diINqJ#^K
+W9*^.10`!Bjn/t*pOF$;Y^Q&#cNh45qeuMl](jG]5IKLK]-+QO3m()&jgB]!Nmi6tod,pr>4P<9rO'n:
+)!>[1No%Lp^,"r5=-e!s0-)M![r7#]#d:AEfU&k^f,Qq\6Z:k`<0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8R<bX'8E<t8MS8aIFg1".WX)ZF=D*^C4JIr6)OaE7gW.t_8b4*aq%S+N/t.!!pHr?D$X#:3M?
+D]Cpk>]sL=&L6ju4TuTneV3Uk$N[Nik_B?724A4D9Y=f@A#DDQ_=MPIYJ]Q2_+JKf:g\M2[mTR#0]j"?
+HXJFob*e:H8>ePXX![t@M+_.IO1Mn4*6fWuBBuECJLBLgifW3>Hjk(G=YQ#+Y;papI#!"mFOi.hFi(-q
+cqKHfQVpWGj?#_]!tfXR\tm[.hi4[CkTF0LWA3tuG]C[H0:XV7]#MRINV>EU=`+_@n/ceaaao+dH1#]I
+Y]8(#no;.uk<7,[r^X]maZnU+O.+sQblU)!j7Q"a0eUGo6OFeNF13K_@!>+Nd[O08Dl7\>-bJN&8WSD+
+)s>D;I&W^C:X"VB3Mu/_.piJ3UFG=mXhN`(45TjfkJ`;0.@]b&&dMj/SXHY%bpZM^/m"$2bVH+$meENg
+oZbadnL.*-gTR+ArGR2A`:8-/A;@[7FQ5_pqt6*mn'4>dA,Pe^mrnL*G"L;l1=th=I[b,N8@md<YFG/(
++277>J)9K<DYbAslc^&j^M\'2L\K9srHcSG\(=?UrI=cgP=K,&]pfj]5R!oj^37E7l1ckrk$0"=0F*n$
+/fnUSoR.5X%D;UDFP$FDhaX,^bEZ^FaH8Q;ES0VA&oIJqH+H-O+#\jfq#&W,ru^%-qbc>K2"9nQ9)cU)
+cl8oJ;q>Ho`pc>.81g5t4C_$=[f5<rs06>:&)[@>\h<>"~>
+endstream
+endobj
+7 0 obj
+   21431
+endobj
+3 0 obj
+   << 
+      /Parent null
+      /Type /Pages
+      /MediaBox [0.0000 0.0000 831.00 792.00]
+      /Resources 8 0 R
+      /Kids [5 0 R]
+      /Count 1
+   >>
+endobj
+9 0 obj
+   [/PDF /Text /ImageC]
+endobj
+10 0 obj
+   << 
+      /S /Transparency
+      /CS /DeviceRGB
+      /I true
+      /K false
+   >>
+endobj
+11 0 obj
+   << 
+      /Alpha1
+      << 
+         /ca 1.0000
+         /CA 1.0000
+         /BM /Normal
+         /AIS false
+      >>
+   >>
+endobj
+8 0 obj
+   << 
+      /ProcSet 9 0 R
+      /ExtGState 11 0 R
+   >>
+endobj
+xref
+0 12
+0000000000 65535 f 
+0000000015 00000 n 
+0000000315 00000 n 
+0000022174 00000 n 
+0000000445 00000 n 
+0000000521 00000 n 
+0000000609 00000 n 
+0000022150 00000 n 
+0000022628 00000 n 
+0000022344 00000 n 
+0000022383 00000 n 
+0000022485 00000 n 
+trailer
+<< 
+   /Size 12
+   /Root 2 0 R
+   /Info 1 0 R
+>>
+startxref
+22701
+%%EOF

+ 117 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/models/bouncingball.py

@@ -0,0 +1,117 @@
+from CBDMultipleOutput.Source.CBD import ConstantBlock, NegatorBlock, \
+    IntegratorBlock, CBD, ProductBlock, AdderBlock
+from fsa_cbd_weaved_classes import InputConstantBlock, CBDState, WhenCrossesZeroTrigger
+from fsaclasses import FSAModel, Transition, Event, State
+
+
+class BouncingBallFSA(FSAModel):
+    def __init__(self):
+        initial = CBDState("Initial", BouncingBallInitial("BouncingBallInitial"))
+        freeFall = CBDState("FreeFall", BouncingBallFreefall("BouncingBallFreefall"))
+        collision = CBDState("Collision", BouncingBallCollision("BouncingBallCollision"))
+        kicked = CBDState("Kicked", BouncingBallKicked("BouncingBallKicked"))
+        end = State("End", True)
+        
+        initial2Freefall = Transition("Initial2Freefall", initial, freeFall)
+        freefall2Collision = Transition("Freefall2Collision", freeFall, collision)
+        freefall2Collision.trigger = WhenCrossesZeroTrigger("x", up_direction=False);
+        collision2Freefall = Transition("Collision2Freefall", collision, freeFall)
+        freefall2Kicked = Transition("Freefall2Kicked", freeFall, kicked)
+        freefall2Kicked.trigger = Event("kick");
+        kicked2Freefall = Transition("kicked2Freefall", kicked, freeFall)
+        freefall2End = Transition("Freefall2End", freeFall, end)
+        freefall2End.trigger = Event("enough");
+        
+        self.states = [
+                       initial,
+                       freeFall,
+                       collision,
+                       kicked,
+                       end
+                       ]
+        
+        self.initialState = initial
+        
+        self.transitions = [
+                            initial2Freefall,
+                            freefall2Collision,
+                            collision2Freefall,
+                            freefall2Kicked,
+                            kicked2Freefall,
+                            freefall2End
+                            ]
+        
+       
+    
+        
+        
+
+class BouncingBallFreefall(CBD):
+    def __init__(self, blockName, delta_t = 0.01):
+        CBD.__init__(self,blockName, input_ports=[], output_ports=["out_v", "out_x"])
+        
+        self.addBlock(InputConstantBlock(block_name="in_x"))
+        self.addBlock(InputConstantBlock(block_name="in_v"))
+        
+        self.addBlock(ConstantBlock(block_name="gravity", value=-9.81))
+        self.addBlock(ConstantBlock(block_name="delta", value=delta_t))
+        
+        self.addBlock(IntegratorBlock(block_name="intgv"))
+        self.addBlock(IntegratorBlock(block_name="intvx"))
+        
+        self.addConnection("delta", "intgv",  input_port_name="delta_t")
+        self.addConnection("delta", "intvx",  input_port_name="delta_t")
+        self.addConnection("in_v", "intgv",  input_port_name="IC")
+        self.addConnection("in_x", "intvx",  input_port_name="IC")
+        
+        self.addConnection("gravity", "intgv")
+        self.addConnection("intgv", "intvx")
+        self.addConnection("intgv", "out_v")
+        self.addConnection("intvx", "out_x")
+    
+    def setDeltaT(self, deltaT):
+        CBD.setDeltaT(self, deltaT)
+        self.getBlockByName("delta").setValue(deltaT);
+    
+    
+
+class BouncingBallInitial(CBD):
+    def __init__(self, blockName, delta_t=0.01):
+        CBD.__init__(self,blockName, input_ports=[], output_ports=["out_v", "out_x"])
+        
+        self.addBlock(ConstantBlock(block_name="init_velocity", value=15.0))
+        self.addBlock(ConstantBlock(block_name="init_position", value=10.0))
+        
+        self.addConnection("init_velocity", "out_v")
+        self.addConnection("init_position", "out_x")
+    
+
+
+class BouncingBallCollision(CBD):
+    def __init__(self, blockName, delta_t=0.01):
+        CBD.__init__(self,blockName, input_ports=[], output_ports=["out_v"])
+        
+        self.addBlock(InputConstantBlock(block_name="in_v"))
+        
+        self.addBlock(ConstantBlock(block_name="coeficient", value=-0.8))
+        self.addBlock(ProductBlock(block_name="mult"))
+        
+        self.addConnection("in_v", "mult")
+        self.addConnection("coeficient", "mult")
+        self.addConnection("mult", "out_v")
+
+
+class BouncingBallKicked(CBD):
+    def __init__(self, blockName, delta_t=0.01):
+        CBD.__init__(self,blockName, input_ports=[], output_ports=["out_v"])
+        
+        self.addBlock(InputConstantBlock(block_name="in_v"))
+        
+        self.addBlock(ConstantBlock(block_name="kick_impact", value=20))
+        self.addBlock(AdderBlock(block_name="sum"))
+        
+        self.addConnection("in_v", "sum")
+        self.addConnection("kick_impact", "sum")
+        self.addConnection("sum", "out_v")
+
+

Fichier diff supprimé car celui-ci est trop grand
+ 444 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/models/plots.pdf


BIN
debugging_fsa_cbd_composition/fsa_cbd_simulator/models/plots_nokick.pdf


BIN
debugging_fsa_cbd_composition/fsa_cbd_simulator/ntplot.pdf


+ 59 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/plotSignals.r

@@ -0,0 +1,59 @@
+library(ggplot2)
+library(cowplot)
+
+mydata_signals = read.csv("./signals.csv")
+mydata_events = read.csv("./events.csv")
+
+total <- merge(mydata_signals,mydata_events,by="fsatime", all=TRUE)
+
+pe <- ggplot(data=total , aes(x=fsatime, y=Event, group=1)) +
+  geom_point(na.rm = FALSE) +
+  ylab("Event") + 
+  xlab("Time (s)") + 
+  scale_y_discrete("Event", labels = waiver(), limits=c("when(x +-)", "kick")) +
+  theme(axis.title.y=element_text(vjust=-4))
+pe
+
+ps <- ggplot(data=total , aes(x=fsatime, y=fsastate, group=1)) +
+  geom_line() +
+  ylab("State") + 
+  xlab("Time (s)") + 
+  scale_y_discrete("State", labels = waiver(), limits=c("Initial", "FreeFall", "Collision", "Kicked")) +
+  theme(axis.title.y=element_text(vjust=-2))
+ps
+
+px <- ggplot(data=total , aes(x=fsatime, y=x, group=1)) +
+        geom_line() +
+        ylab("Height (m)") + 
+        xlab("Time (s)") +
+        theme(axis.title.y=element_text(vjust=-6))
+px
+
+pv <- ggplot(data=total , aes(x=fsatime, y=v, group=1)) +
+        geom_line() +
+        ylab("Velocity (m/s)") + 
+        xlab("Time (s)") +
+        theme(axis.title.y=element_text(vjust=-6))
+pv
+
+pt <- ggplot(data=total , aes(x=fsatime, y=current_cbdtime, group=1)) +
+        geom_point() +
+        ylab("CBD Time (s)") +
+        xlab("FSA Time (s)") +
+        scale_y_continuous(limits=c(0, 10)) +
+        scale_x_continuous(limits=c(0, 10)) +
+        theme(axis.title.y=element_text(vjust=-6))
+pt
+
+multiplot <- plot_grid(pe, ps, px , pv, pt, nrow = 3, ncol = 2, align = "v")
+px_pv_plot <- plot_grid(px, pv, nrow=1, ncol=2, align="h")
+ntplot <- plot_grid(pt, nrow=1, ncol=1, align="v")
+col_plot <- plot_grid(pe, ps, px , pv, pt, nrow = 5, ncol = 1, align = "v")
+row_plot <- plot_grid(pe, ps, px , pv, pt, nrow = 1, ncol = 5, align = "h")
+
+save_plot("plots.pdf", multiplot, nrow = 3, ncol = 2, base_aspect_ratio = 1.2)
+save_plot("ntplot.pdf", ntplot, nrow=1, ncol=1, base_aspect_ratio = 1)
+save_plot("bbplots_vertical.pdf", col_plot, nrow=5, ncol=1, base_aspect_ratio = 1.0)
+save_plot("bbplots.pdf", row_plot, nrow=1, ncol=5, base_aspect_ratio = 1.0)
+save_plot("bb_vhplots.pdf", row_plot, nrow=1, ncol=2, base_aspect_ratio = 1.0)
+

+ 48 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/plotSignals_horizontal.r

@@ -0,0 +1,48 @@
+library(ggplot2)
+library(cowplot)
+
+mydata_signals = read.csv("./signals.csv")
+mydata_events = read.csv("./events.csv")
+
+total <- merge(mydata_signals,mydata_events,by="fsatime", all=TRUE)
+
+vertical_adjust <- 1
+label_size <- 20
+
+pe <- ggplot(data=total , aes(x=fsatime, y=Event, group=1)) +
+  geom_point(na.rm = FALSE) +
+  ylab("Event") + 
+  xlab("Time (s)") + 
+  scale_y_discrete("Event", labels = waiver(), limits=c("when(x +-)", "kick")) +
+  theme(axis.title.y=element_text(vjust=vertical_adjust), axis.title=element_text(size=label_size,face="bold"))
+
+ps <- ggplot(data=total , aes(x=fsatime, y=fsastate, group=1)) +
+  geom_line() +
+  ylab("State") + 
+  xlab("Time (s)") + 
+  scale_y_discrete("State", labels = waiver(), limits=c("Initial", "FreeFall", "Collision", "Kicked")) +
+  theme(axis.title.y=element_text(vjust=vertical_adjust), axis.title=element_text(size=label_size,face="bold"))
+
+px <- ggplot(data=total , aes(x=fsatime, y=x, group=1)) +
+        geom_line() +
+        ylab("Height (m)") + 
+        xlab("Time (s)") +
+        theme(axis.title.y=element_text(vjust=vertical_adjust), axis.title=element_text(size=label_size,face="bold"))
+
+pv <- ggplot(data=total , aes(x=fsatime, y=v, group=1)) +
+        geom_line() +
+        ylab("Velocity (m/s)") + 
+        xlab("Time (s)") +
+        theme(axis.title.y=element_text(vjust=vertical_adjust), axis.title=element_text(size=label_size,face="bold"))
+
+pt <- ggplot(data=total , aes(x=fsatime, y=current_cbdtime, group=1)) +
+        geom_point() +
+        ylab("CBD Time (s)") +
+        xlab("FSA Time (s)") +
+        scale_y_continuous(limits=c(0, 10)) +
+        scale_x_continuous(limits=c(0, 10)) +
+        theme(axis.title.y=element_text(vjust=vertical_adjust), axis.title=element_text(size=label_size,face="bold"))
+
+row_plot <- plot_grid(pe, ps, px , pv, pt, nrow = 1, ncol = 5, align = "h")
+save_plot("bbplots.pdf", row_plot, nrow=1, ncol=5, base_aspect_ratio = 1.0)
+

Fichier diff supprimé car celui-ci est trop grand
+ 401 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/plots.pdf


Fichier diff supprimé car celui-ci est trop grand
+ 6517 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/signals.csv


Fichier diff supprimé car celui-ci est trop grand
+ 968 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/test_models.graphml


+ 169 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/weaved_cbd_fsa_lib.py

@@ -0,0 +1,169 @@
+'''
+@author: Claudio Gomes, Bruno Barroca and Sadaf Mustafiz
+'''
+
+from fsa_cbd_weaved_classes import WhenCrossesZeroTrigger, InputConstantBlock,\
+	CBDState
+from CBDMultipleOutput.Source.CBD import OutputPortBlock
+import numpy
+import os
+import csv
+from fsaclasses import Event, After
+
+class FSACBDLib():
+	BLOCK_NAME_OUT = "out_"
+	OUTPUT_SIGNALS = "./signals.csv"
+	OUTPUT_EVENTS = "./events.csv"
+		
+	def __init__(self):
+		pass
+	
+	def getTriggeredWhenTransition(self, fsaCbdModel, currentFSAState, globalState, previousGlobalState):
+		'''
+		This method will check whether there is any transition triggered by a zero crossing detection and if so,
+		if that zero crossing has in fact occurred when comparing the new globalState with the previousGlobalState.
+		'''
+		triggeredTransiton = None
+		
+		for t in fsaCbdModel.transitions:
+			if t.source == currentFSAState and isinstance(t.trigger,WhenCrossesZeroTrigger):
+				varNameToCheck = t.trigger.varname
+				if varNameToCheck in globalState and varNameToCheck in previousGlobalState:
+					if t.trigger.up_direction and previousGlobalState[varNameToCheck] <= 0 and 0 < globalState[varNameToCheck] :
+						triggeredTransiton = t
+						break
+					if not t.trigger.up_direction and globalState[varNameToCheck] < 0 and 0 <= previousGlobalState[varNameToCheck] :
+						triggeredTransiton = t
+						break
+		
+		assert triggeredTransiton == None or t.source == currentFSAState
+		
+		return triggeredTransiton
+	
+	def updateGlobalState(self ,globalState, cbdModel, cbdTime):
+		'''
+		The globalState is a dictionary mapping variable names to values.
+		This function will get the signals for the outputPorts in the cbdModel and then
+		update the globalState with the values of the outputPorts at time cbdTime
+		'''
+		for block in cbdModel.getBlocks():
+			if (isinstance(block, OutputPortBlock)):
+				port = block.getBlockName()
+				signal = block.getSignal()
+				# Convention: port is of the form "out_varName" to represent the global varName
+				assert port.startswith(self.BLOCK_NAME_OUT), "Convention violated for output port: " + str(port)
+				varName = self.stripConventionOutname(port)
+				assert len(varName)>0 , "Convention violated for output port: " + str(port)
+				
+				mostRecentSignal = signal[-1]
+				
+				assert numpy.isclose(mostRecentSignal.time,cbdTime, 1e-05, 1e-08), "Signal as not been computed up to time " + str(cbdTime)
+				
+				signalValue = mostRecentSignal.value
+				globalState[varName] = signalValue
+	
+	def stripConventionOutname(self, name):
+		return name.replace(self.BLOCK_NAME_OUT, "", 1)
+	
+	def updateCBDState(self, globalState, cbdModel):
+		'''
+		The globalState is a dictionary mapping variable names to values.
+		
+		This function is to be called when initializing the cbdModel.
+		This function will iterate the input blocks of the CBD, which have conventioned name as "in_varName" and it will set the values for those blocks. 
+		'''	
+		for block in cbdModel.getBlocks():
+			if isinstance(block, InputConstantBlock):
+				assert block.getBlockName().startswith("in_"), "Convention violated for input block of the CBD: " + str(block.getBlockName())
+				varName = block.getBlockName().replace("in_", "", 1)
+				assert len(varName)>0 , "Convention violated for input block of the CBD: " + str(block.getBlockName())
+				assert varName in globalState, "Input block not initialized before: " + str(block.getBlockName())
+				
+				block.setValue(globalState[varName])
+		
+		
+	def dumpGlobalState(self, fsaCbdModel, globalState, fsaTime, fsaState):
+		create_header = not os.path.exists(self.OUTPUT_SIGNALS);
+		
+		if create_header:
+			self.addRemainingSignals(globalState, fsaCbdModel)
+		
+		# It is not a good idea to write this directly to the global state but it is more efficient.
+		
+		globalState["fsatime"] = fsaTime
+		
+		if isinstance(fsaState, CBDState):
+			assert fsaState.cbd != None
+			if fsaState.cbd.getClock() != None:
+				globalState["current_cbdtime"] = fsaState.cbd.getClock().getTime()
+			else:
+				# Clock not yet initialized. Can happen.
+				globalState["current_cbdtime"] = -1.0
+		else:
+			globalState["current_cbdtime"] = -1.0
+		
+		globalState["fsastate"] = fsaState.name
+		
+		with open(self.OUTPUT_SIGNALS, "a") as csvFile:
+			writerCsv = csv.DictWriter(csvFile, fieldnames=globalState.keys())
+			if create_header:
+				writerCsv.writeheader()
+			writerCsv.writerow(globalState)
+	
+	def addRemainingSignals(self, stateDict, fsaCbdModel):
+		
+		for state in fsaCbdModel.states:
+			if (isinstance(state, CBDState)):
+				for block in state.cbd.getBlocks():
+					if isinstance(block, OutputPortBlock):
+						varName = self.stripConventionOutname(block.getBlockName())
+						if not varName in stateDict:
+							stateDict[varName] = None
+		
+		
+		return stateDict
+	
+	def dumpDiscreteEvent(self, fsaCbdModel, fsaTime, fsa_currentState, fsa_selectedTransition):
+		create_header = not os.path.exists(self.OUTPUT_EVENTS);
+		
+		event = None
+		if (fsa_selectedTransition != None):
+			if fsa_selectedTransition.trigger != None:
+				if isinstance(fsa_selectedTransition.trigger, Event):
+					event = fsa_selectedTransition.trigger.name
+				elif isinstance(fsa_selectedTransition.trigger, After):
+					event = "after("+str(fsa_selectedTransition.trigger.expression)+")"
+				elif isinstance(fsa_selectedTransition.trigger, WhenCrossesZeroTrigger):
+					event = "when("+str(fsa_selectedTransition.trigger.varname)+" " + ("-+" if fsa_selectedTransition.trigger.up_direction else "+-") + ")"
+		
+		if (event != None):
+			with open(self.OUTPUT_EVENTS, "a") as csvFile:
+				eventDict = {"fsatime" : fsaTime , "Event" : event}
+				writerCsv = csv.DictWriter(csvFile, fieldnames=eventDict.keys())
+				if create_header:
+					writerCsv.writeheader()
+				writerCsv.writerow(eventDict)
+				
+				
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+				

+ 751 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/weaved_cbd_fsa_simulator.py

@@ -0,0 +1,751 @@
+"""
+Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
+
+Date:   Tue Oct 11 21:25:15 2016
+
+Model author: Sadaf Mustafiz and Bruno Barroca and Claudio Gomes
+Model name:   Weaved_CBD_FSA_Simulator_Manual
+Model description:
+Automatically woven CBD and FSA simulators with the FSA being the dominant.
+"""
+
+from sccd.runtime.statecharts_core import *
+from sccd.runtime.libs.ui import *
+from sccd.runtime.libs.utils import *
+import copy
+from CBD_Controller import CBDController
+import Options
+from fsa_cbd_weaved_classes import CBDState
+from weaved_cbd_fsa_lib import FSACBDLib
+
+# package "Weaved_CBD_FSA_Simulator_Manual"
+
+class Weaved_CBD_FSA_Simulator(RuntimeClassBase):
+    def __init__(self, controller, cbd_options, amodel, fsa_events):
+        RuntimeClassBase.__init__(self, controller)
+        
+        self.semantics.big_step_maximality = StatechartSemantics.TakeMany
+        self.semantics.internal_event_lifeline = StatechartSemantics.Queue
+        self.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep
+        self.semantics.priority = StatechartSemantics.SourceParent
+        self.semantics.concurrency = StatechartSemantics.Single
+        
+        # build Statechart structure
+        self.build_statechart_structure()
+        
+        # user defined attributes
+        self.weaved_global_state = None
+        self.fsa_elapsed = None
+        self.cbd_options = None
+        self.weaved_lib = None
+        self.woven_child_initialized = None
+        self.cbd_clock = None
+        self.fsa_currentEvent = None
+        self.weaved_delta = None
+        self.weaved_model = None
+        self.cbd_controller = None
+        self.fsa_timestep = None
+        self.cbd_currentCompIdx = None
+        self.fsa_eventList = None
+        self.cbd_depGraph = None
+        self.fsa_selectedTransition = None
+        self.cbd_strongComponentList = None
+        self.weaved_previous_global_state = None
+        self.cbd_delta = None
+        self.weaved_triggered_when_transition = None
+        self.cbd_iteration = None
+        self.fsa_logicalTime = None
+        self.fsa_currentState = None
+        
+        # call user defined constructor
+        Weaved_CBD_FSA_Simulator.user_defined_constructor(self, cbd_options, amodel, fsa_events)
+    
+    def user_defined_constructor(self, cbd_options, amodel, fsa_events):
+        self.weaved_lib = FSACBDLib()
+        self.cbd_options = cbd_options
+        self.cbd_delta = self.cbd_options.getDeltaT()
+        self.weaved_model = amodel
+        self.fsa_eventList = fsa_events
+        self.fsa_timestep = 1.0
+    
+    def user_defined_destructor(self):
+        pass
+    
+    
+    # user defined method
+    def fsa_processEvent(self, event):
+        if (event != None):
+        	self.fsa_eventList.popEvent(event)
+        	event.processed = True
+    
+    
+    # user defined method
+    def updateCBDState(self):
+        self.weaved_lib.updateCBDState(self.weaved_global_state, self.fsa_currentState.cbd)
+    
+    
+    # user defined method
+    def cbd_maxIterationsReached(self):
+        return self.cbd_iteration >= self.cbd_options.getMaxIterations()
+    
+    
+    # user defined method
+    def fsa_getInputEventAt(self, time):
+        return self.fsa_eventList.getInputAt(time)
+    
+    
+    # user defined method
+    def cbd_computeBlock(self):
+        if self.cbd_currentComponentIsCycle():
+        	self.cbd_controller.computeNextAlgebraicLoop(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_iteration)
+        else:
+        	self.cbd_controller.computeNextBlock(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_iteration)
+    
+    
+    # user defined method
+    def updateGlobalState(self):
+        self.weaved_previous_global_state = copy.deepcopy(self.weaved_global_state)
+        self.weaved_lib.updateGlobalState(self.weaved_global_state, self.fsa_currentState.cbd, self.cbd_clock)
+    
+    
+    # user defined method
+    def cbd_currentComponentIsCycle(self):
+        return self.cbd_controller.componentIsCycle(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_depGraph)
+    
+    
+    # user defined method
+    def cbd_hasNextStrongComponent(self):
+        return (self.cbd_currentCompIdx) < len(self.cbd_strongComponentList)
+    
+    
+    # user defined method
+    def getTriggeredWhenTransition(self):
+        return self.weaved_lib.getTriggeredWhenTransition(self.weaved_model, self.fsa_currentState, self.weaved_global_state, self.weaved_previous_global_state)
+    
+    
+    # builds Statechart structure
+    def build_statechart_structure(self):
+        
+        # state <root>
+        self.states[""] = State(0, self)
+        
+        # state /FSA
+        self.states["/FSA"] = State(1, self)
+        
+        # state /FSA/Started
+        self.states["/FSA/Started"] = State(2, self)
+        
+        # state /FSA/Initialized
+        self.states["/FSA/Initialized"] = State(3, self)
+        
+        # state /FSA/CheckTermination
+        self.states["/FSA/CheckTermination"] = State(4, self)
+        
+        # state /FSA/CheckTermination/MacroStepProcessed
+        self.states["/FSA/CheckTermination/MacroStepProcessed"] = State(5, self)
+        
+        # state /FSA/DoSimulation
+        self.states["/FSA/DoSimulation"] = State(6, self)
+        
+        # state /FSA/DoSimulation/MacroStepPrepared
+        self.states["/FSA/DoSimulation/MacroStepPrepared"] = State(7, self)
+        
+        # state /FSA/DoSimulation/MacroStepPrepared/ParentPaused
+        self.states["/FSA/DoSimulation/MacroStepPrepared/ParentPaused"] = State(8, self)
+        
+        # state /FSA/DoSimulation/MacroStepPrepared/ChildNotDetected
+        self.states["/FSA/DoSimulation/MacroStepPrepared/ChildNotDetected"] = State(9, self)
+        
+        # state /FSA/DoSimulation/MacroStepPrepared/ChildDetected
+        self.states["/FSA/DoSimulation/MacroStepPrepared/ChildDetected"] = State(10, self)
+        
+        # state /FSA/DoSimulation/MacroStepPrepared/ChildInitialized
+        self.states["/FSA/DoSimulation/MacroStepPrepared/ChildInitialized"] = State(11, self)
+        
+        # state /FSA/DoSimulation/MacroStepPrepared/ChildNotInitialized
+        self.states["/FSA/DoSimulation/MacroStepPrepared/ChildNotInitialized"] = State(12, self)
+        
+        # state /FSA/DoSimulation/MacroStepPrepared/CBD
+        self.states["/FSA/DoSimulation/MacroStepPrepared/CBD"] = State(13, self)
+        
+        # state /FSA/DoSimulation/MacroStepPrepared/CBD/Started
+        self.states["/FSA/DoSimulation/MacroStepPrepared/CBD/Started"] = State(14, self)
+        
+        # state /FSA/DoSimulation/MacroStepPrepared/CBD/Initialized
+        self.states["/FSA/DoSimulation/MacroStepPrepared/CBD/Initialized"] = State(15, self)
+        
+        # state /FSA/DoSimulation/MacroStepPrepared/ChildProcessed
+        self.states["/FSA/DoSimulation/MacroStepPrepared/ChildProcessed"] = State(16, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed
+        self.states["/FSA/DoSimulation/MicroStepProcessed"] = State(17, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed/ParentPaused
+        self.states["/FSA/DoSimulation/MicroStepProcessed/ParentPaused"] = State(18, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed/ChildNotDetected
+        self.states["/FSA/DoSimulation/MicroStepProcessed/ChildNotDetected"] = State(19, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed/ChildDetected
+        self.states["/FSA/DoSimulation/MicroStepProcessed/ChildDetected"] = State(20, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed/ChildInitialized
+        self.states["/FSA/DoSimulation/MicroStepProcessed/ChildInitialized"] = State(21, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed/CBD
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD"] = State(22, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed/CBD/CheckTermination
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/CheckTermination"] = State(23, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed/CBD/CheckTermination/MacroStepProcessed
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/CheckTermination/MacroStepProcessed"] = State(24, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation"] = State(25, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MacroStepPrepared
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MacroStepPrepared"] = State(26, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepProcessed
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepProcessed"] = State(27, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepPrepared
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepPrepared"] = State(28, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed/CBD/Terminated
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/Terminated"] = State(29, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed/ChildPaused
+        self.states["/FSA/DoSimulation/MicroStepProcessed/ChildPaused"] = State(30, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed/NoStateEventDetected
+        self.states["/FSA/DoSimulation/MicroStepProcessed/NoStateEventDetected"] = State(31, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed/StateEventDetected
+        self.states["/FSA/DoSimulation/MicroStepProcessed/StateEventDetected"] = State(32, self)
+        
+        # state /FSA/DoSimulation/MicroStepProcessed/ChildProcessed
+        self.states["/FSA/DoSimulation/MicroStepProcessed/ChildProcessed"] = State(33, self)
+        
+        # state /FSA/DoSimulation/MicroStepPrepared
+        self.states["/FSA/DoSimulation/MicroStepPrepared"] = State(34, self)
+        
+        # state /FSA/DoSimulation/ParentMicroStepProcessed
+        self.states["/FSA/DoSimulation/ParentMicroStepProcessed"] = State(35, self)
+        
+        # state /FSA/Terminated
+        self.states["/FSA/Terminated"] = State(36, self)
+        
+        # state /ParentStarted
+        self.states["/ParentStarted"] = State(37, self)
+        
+        # state /HybridTerminated
+        self.states["/HybridTerminated"] = State(38, self)
+        
+        # add children
+        self.states[""].addChild(self.states["/FSA"])
+        self.states[""].addChild(self.states["/ParentStarted"])
+        self.states[""].addChild(self.states["/HybridTerminated"])
+        self.states["/FSA"].addChild(self.states["/FSA/Started"])
+        self.states["/FSA"].addChild(self.states["/FSA/Initialized"])
+        self.states["/FSA"].addChild(self.states["/FSA/CheckTermination"])
+        self.states["/FSA"].addChild(self.states["/FSA/DoSimulation"])
+        self.states["/FSA"].addChild(self.states["/FSA/Terminated"])
+        self.states["/FSA/CheckTermination"].addChild(self.states["/FSA/CheckTermination/MacroStepProcessed"])
+        self.states["/FSA/DoSimulation"].addChild(self.states["/FSA/DoSimulation/MacroStepPrepared"])
+        self.states["/FSA/DoSimulation"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed"])
+        self.states["/FSA/DoSimulation"].addChild(self.states["/FSA/DoSimulation/MicroStepPrepared"])
+        self.states["/FSA/DoSimulation"].addChild(self.states["/FSA/DoSimulation/ParentMicroStepProcessed"])
+        self.states["/FSA/DoSimulation/MacroStepPrepared"].addChild(self.states["/FSA/DoSimulation/MacroStepPrepared/ParentPaused"])
+        self.states["/FSA/DoSimulation/MacroStepPrepared"].addChild(self.states["/FSA/DoSimulation/MacroStepPrepared/ChildNotDetected"])
+        self.states["/FSA/DoSimulation/MacroStepPrepared"].addChild(self.states["/FSA/DoSimulation/MacroStepPrepared/ChildDetected"])
+        self.states["/FSA/DoSimulation/MacroStepPrepared"].addChild(self.states["/FSA/DoSimulation/MacroStepPrepared/ChildInitialized"])
+        self.states["/FSA/DoSimulation/MacroStepPrepared"].addChild(self.states["/FSA/DoSimulation/MacroStepPrepared/ChildNotInitialized"])
+        self.states["/FSA/DoSimulation/MacroStepPrepared"].addChild(self.states["/FSA/DoSimulation/MacroStepPrepared/CBD"])
+        self.states["/FSA/DoSimulation/MacroStepPrepared"].addChild(self.states["/FSA/DoSimulation/MacroStepPrepared/ChildProcessed"])
+        self.states["/FSA/DoSimulation/MacroStepPrepared/CBD"].addChild(self.states["/FSA/DoSimulation/MacroStepPrepared/CBD/Started"])
+        self.states["/FSA/DoSimulation/MacroStepPrepared/CBD"].addChild(self.states["/FSA/DoSimulation/MacroStepPrepared/CBD/Initialized"])
+        self.states["/FSA/DoSimulation/MicroStepProcessed"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed/ParentPaused"])
+        self.states["/FSA/DoSimulation/MicroStepProcessed"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed/ChildNotDetected"])
+        self.states["/FSA/DoSimulation/MicroStepProcessed"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed/ChildDetected"])
+        self.states["/FSA/DoSimulation/MicroStepProcessed"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed/ChildInitialized"])
+        self.states["/FSA/DoSimulation/MicroStepProcessed"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed/CBD"])
+        self.states["/FSA/DoSimulation/MicroStepProcessed"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed/ChildPaused"])
+        self.states["/FSA/DoSimulation/MicroStepProcessed"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed/NoStateEventDetected"])
+        self.states["/FSA/DoSimulation/MicroStepProcessed"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed/StateEventDetected"])
+        self.states["/FSA/DoSimulation/MicroStepProcessed"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed/ChildProcessed"])
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/CheckTermination"])
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation"])
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/Terminated"])
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/CheckTermination"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/CheckTermination/MacroStepProcessed"])
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MacroStepPrepared"])
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepProcessed"])
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation"].addChild(self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepPrepared"])
+        self.states[""].fixTree()
+        self.states[""].default_state = self.states["/FSA"]
+        self.states["/FSA"].default_state = self.states["/FSA/Started"]
+        self.states["/FSA/CheckTermination"].default_state = self.states["/FSA/CheckTermination/MacroStepProcessed"]
+        self.states["/FSA/DoSimulation"].default_state = self.states["/FSA/DoSimulation/MacroStepPrepared"]
+        self.states["/FSA/DoSimulation/MacroStepPrepared"].default_state = self.states["/FSA/DoSimulation/MacroStepPrepared/ParentPaused"]
+        self.states["/FSA/DoSimulation/MacroStepPrepared/CBD"].default_state = self.states["/FSA/DoSimulation/MacroStepPrepared/CBD/Started"]
+        self.states["/FSA/DoSimulation/MicroStepProcessed"].default_state = self.states["/FSA/DoSimulation/MicroStepProcessed/ParentPaused"]
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD"].default_state = self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/CheckTermination"]
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/CheckTermination"].default_state = self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/CheckTermination/MacroStepProcessed"]
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation"].default_state = self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MacroStepPrepared"]
+        
+        # transition /FSA/Started
+        _FSA_Started_0 = Transition(self, self.states["/FSA/Started"], [self.states["/ParentStarted"]])
+        _FSA_Started_0.setAction(self._FSA_Started_0_exec)
+        _FSA_Started_0.setTrigger(None)
+        self.states["/FSA/Started"].addTransition(_FSA_Started_0)
+        
+        # transition /FSA/Initialized
+        _FSA_Initialized_0 = Transition(self, self.states["/FSA/Initialized"], [self.states["/FSA/CheckTermination"]])
+        _FSA_Initialized_0.setAction(self._FSA_Initialized_0_exec)
+        _FSA_Initialized_0.setTrigger(None)
+        self.states["/FSA/Initialized"].addTransition(_FSA_Initialized_0)
+        
+        # transition /FSA/CheckTermination/MacroStepProcessed
+        _FSA_CheckTermination_MacroStepProcessed_0 = Transition(self, self.states["/FSA/CheckTermination/MacroStepProcessed"], [self.states["/FSA/DoSimulation"]])
+        _FSA_CheckTermination_MacroStepProcessed_0.setAction(self._FSA_CheckTermination_MacroStepProcessed_0_exec)
+        _FSA_CheckTermination_MacroStepProcessed_0.setTrigger(None)
+        _FSA_CheckTermination_MacroStepProcessed_0.setGuard(self._FSA_CheckTermination_MacroStepProcessed_0_guard)
+        self.states["/FSA/CheckTermination/MacroStepProcessed"].addTransition(_FSA_CheckTermination_MacroStepProcessed_0)
+        _FSA_CheckTermination_MacroStepProcessed_1 = Transition(self, self.states["/FSA/CheckTermination/MacroStepProcessed"], [self.states["/FSA/Terminated"]])
+        _FSA_CheckTermination_MacroStepProcessed_1.setAction(self._FSA_CheckTermination_MacroStepProcessed_1_exec)
+        _FSA_CheckTermination_MacroStepProcessed_1.setTrigger(None)
+        _FSA_CheckTermination_MacroStepProcessed_1.setGuard(self._FSA_CheckTermination_MacroStepProcessed_1_guard)
+        self.states["/FSA/CheckTermination/MacroStepProcessed"].addTransition(_FSA_CheckTermination_MacroStepProcessed_1)
+        
+        # transition /FSA/DoSimulation/MacroStepPrepared/ParentPaused
+        _FSA_DoSimulation_MacroStepPrepared_ParentPaused_0 = Transition(self, self.states["/FSA/DoSimulation/MacroStepPrepared/ParentPaused"], [self.states["/FSA/DoSimulation/MacroStepPrepared/ChildDetected"]])
+        _FSA_DoSimulation_MacroStepPrepared_ParentPaused_0.setAction(self._FSA_DoSimulation_MacroStepPrepared_ParentPaused_0_exec)
+        _FSA_DoSimulation_MacroStepPrepared_ParentPaused_0.setTrigger(None)
+        _FSA_DoSimulation_MacroStepPrepared_ParentPaused_0.setGuard(self._FSA_DoSimulation_MacroStepPrepared_ParentPaused_0_guard)
+        self.states["/FSA/DoSimulation/MacroStepPrepared/ParentPaused"].addTransition(_FSA_DoSimulation_MacroStepPrepared_ParentPaused_0)
+        _FSA_DoSimulation_MacroStepPrepared_ParentPaused_1 = Transition(self, self.states["/FSA/DoSimulation/MacroStepPrepared/ParentPaused"], [self.states["/FSA/DoSimulation/MacroStepPrepared/ChildNotDetected"]])
+        _FSA_DoSimulation_MacroStepPrepared_ParentPaused_1.setAction(self._FSA_DoSimulation_MacroStepPrepared_ParentPaused_1_exec)
+        _FSA_DoSimulation_MacroStepPrepared_ParentPaused_1.setTrigger(None)
+        _FSA_DoSimulation_MacroStepPrepared_ParentPaused_1.setGuard(self._FSA_DoSimulation_MacroStepPrepared_ParentPaused_1_guard)
+        self.states["/FSA/DoSimulation/MacroStepPrepared/ParentPaused"].addTransition(_FSA_DoSimulation_MacroStepPrepared_ParentPaused_1)
+        
+        # transition /FSA/DoSimulation/MacroStepPrepared/ChildNotDetected
+        _FSA_DoSimulation_MacroStepPrepared_ChildNotDetected_0 = Transition(self, self.states["/FSA/DoSimulation/MacroStepPrepared/ChildNotDetected"], [self.states["/FSA/DoSimulation/MacroStepPrepared/ChildProcessed"]])
+        _FSA_DoSimulation_MacroStepPrepared_ChildNotDetected_0.setAction(self._FSA_DoSimulation_MacroStepPrepared_ChildNotDetected_0_exec)
+        _FSA_DoSimulation_MacroStepPrepared_ChildNotDetected_0.setTrigger(None)
+        self.states["/FSA/DoSimulation/MacroStepPrepared/ChildNotDetected"].addTransition(_FSA_DoSimulation_MacroStepPrepared_ChildNotDetected_0)
+        
+        # transition /FSA/DoSimulation/MacroStepPrepared/ChildDetected
+        _FSA_DoSimulation_MacroStepPrepared_ChildDetected_0 = Transition(self, self.states["/FSA/DoSimulation/MacroStepPrepared/ChildDetected"], [self.states["/FSA/DoSimulation/MacroStepPrepared/ChildInitialized"]])
+        _FSA_DoSimulation_MacroStepPrepared_ChildDetected_0.setAction(self._FSA_DoSimulation_MacroStepPrepared_ChildDetected_0_exec)
+        _FSA_DoSimulation_MacroStepPrepared_ChildDetected_0.setTrigger(None)
+        _FSA_DoSimulation_MacroStepPrepared_ChildDetected_0.setGuard(self._FSA_DoSimulation_MacroStepPrepared_ChildDetected_0_guard)
+        self.states["/FSA/DoSimulation/MacroStepPrepared/ChildDetected"].addTransition(_FSA_DoSimulation_MacroStepPrepared_ChildDetected_0)
+        _FSA_DoSimulation_MacroStepPrepared_ChildDetected_1 = Transition(self, self.states["/FSA/DoSimulation/MacroStepPrepared/ChildDetected"], [self.states["/FSA/DoSimulation/MacroStepPrepared/ChildNotInitialized"]])
+        _FSA_DoSimulation_MacroStepPrepared_ChildDetected_1.setAction(self._FSA_DoSimulation_MacroStepPrepared_ChildDetected_1_exec)
+        _FSA_DoSimulation_MacroStepPrepared_ChildDetected_1.setTrigger(None)
+        _FSA_DoSimulation_MacroStepPrepared_ChildDetected_1.setGuard(self._FSA_DoSimulation_MacroStepPrepared_ChildDetected_1_guard)
+        self.states["/FSA/DoSimulation/MacroStepPrepared/ChildDetected"].addTransition(_FSA_DoSimulation_MacroStepPrepared_ChildDetected_1)
+        
+        # transition /FSA/DoSimulation/MacroStepPrepared/ChildInitialized
+        _FSA_DoSimulation_MacroStepPrepared_ChildInitialized_0 = Transition(self, self.states["/FSA/DoSimulation/MacroStepPrepared/ChildInitialized"], [self.states["/FSA/DoSimulation/MacroStepPrepared/ChildProcessed"]])
+        _FSA_DoSimulation_MacroStepPrepared_ChildInitialized_0.setAction(self._FSA_DoSimulation_MacroStepPrepared_ChildInitialized_0_exec)
+        _FSA_DoSimulation_MacroStepPrepared_ChildInitialized_0.setTrigger(None)
+        self.states["/FSA/DoSimulation/MacroStepPrepared/ChildInitialized"].addTransition(_FSA_DoSimulation_MacroStepPrepared_ChildInitialized_0)
+        
+        # transition /FSA/DoSimulation/MacroStepPrepared/ChildNotInitialized
+        _FSA_DoSimulation_MacroStepPrepared_ChildNotInitialized_0 = Transition(self, self.states["/FSA/DoSimulation/MacroStepPrepared/ChildNotInitialized"], [self.states["/FSA/DoSimulation/MacroStepPrepared/CBD/Started"]])
+        _FSA_DoSimulation_MacroStepPrepared_ChildNotInitialized_0.setAction(self._FSA_DoSimulation_MacroStepPrepared_ChildNotInitialized_0_exec)
+        _FSA_DoSimulation_MacroStepPrepared_ChildNotInitialized_0.setTrigger(None)
+        self.states["/FSA/DoSimulation/MacroStepPrepared/ChildNotInitialized"].addTransition(_FSA_DoSimulation_MacroStepPrepared_ChildNotInitialized_0)
+        
+        # transition /FSA/DoSimulation/MacroStepPrepared/CBD/Started
+        _FSA_DoSimulation_MacroStepPrepared_CBD_Started_0 = Transition(self, self.states["/FSA/DoSimulation/MacroStepPrepared/CBD/Started"], [self.states["/FSA/DoSimulation/MacroStepPrepared/CBD/Initialized"]])
+        _FSA_DoSimulation_MacroStepPrepared_CBD_Started_0.setAction(self._FSA_DoSimulation_MacroStepPrepared_CBD_Started_0_exec)
+        _FSA_DoSimulation_MacroStepPrepared_CBD_Started_0.setTrigger(None)
+        self.states["/FSA/DoSimulation/MacroStepPrepared/CBD/Started"].addTransition(_FSA_DoSimulation_MacroStepPrepared_CBD_Started_0)
+        
+        # transition /FSA/DoSimulation/MacroStepPrepared/CBD/Initialized
+        _FSA_DoSimulation_MacroStepPrepared_CBD_Initialized_0 = Transition(self, self.states["/FSA/DoSimulation/MacroStepPrepared/CBD/Initialized"], [self.states["/FSA/DoSimulation/MacroStepPrepared/ChildInitialized"]])
+        _FSA_DoSimulation_MacroStepPrepared_CBD_Initialized_0.setAction(self._FSA_DoSimulation_MacroStepPrepared_CBD_Initialized_0_exec)
+        _FSA_DoSimulation_MacroStepPrepared_CBD_Initialized_0.setTrigger(None)
+        self.states["/FSA/DoSimulation/MacroStepPrepared/CBD/Initialized"].addTransition(_FSA_DoSimulation_MacroStepPrepared_CBD_Initialized_0)
+        
+        # transition /FSA/DoSimulation/MacroStepPrepared/ChildProcessed
+        _FSA_DoSimulation_MacroStepPrepared_ChildProcessed_0 = Transition(self, self.states["/FSA/DoSimulation/MacroStepPrepared/ChildProcessed"], [self.states["/FSA/DoSimulation/MicroStepProcessed"]])
+        _FSA_DoSimulation_MacroStepPrepared_ChildProcessed_0.setAction(self._FSA_DoSimulation_MacroStepPrepared_ChildProcessed_0_exec)
+        _FSA_DoSimulation_MacroStepPrepared_ChildProcessed_0.setTrigger(None)
+        self.states["/FSA/DoSimulation/MacroStepPrepared/ChildProcessed"].addTransition(_FSA_DoSimulation_MacroStepPrepared_ChildProcessed_0)
+        
+        # transition /FSA/DoSimulation/MicroStepProcessed/ParentPaused
+        _FSA_DoSimulation_MicroStepProcessed_ParentPaused_0 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/ParentPaused"], [self.states["/FSA/DoSimulation/MicroStepProcessed/ChildDetected"]])
+        _FSA_DoSimulation_MicroStepProcessed_ParentPaused_0.setAction(self._FSA_DoSimulation_MicroStepProcessed_ParentPaused_0_exec)
+        _FSA_DoSimulation_MicroStepProcessed_ParentPaused_0.setTrigger(None)
+        _FSA_DoSimulation_MicroStepProcessed_ParentPaused_0.setGuard(self._FSA_DoSimulation_MicroStepProcessed_ParentPaused_0_guard)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/ParentPaused"].addTransition(_FSA_DoSimulation_MicroStepProcessed_ParentPaused_0)
+        _FSA_DoSimulation_MicroStepProcessed_ParentPaused_1 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/ParentPaused"], [self.states["/FSA/DoSimulation/MicroStepProcessed/ChildNotDetected"]])
+        _FSA_DoSimulation_MicroStepProcessed_ParentPaused_1.setAction(self._FSA_DoSimulation_MicroStepProcessed_ParentPaused_1_exec)
+        _FSA_DoSimulation_MicroStepProcessed_ParentPaused_1.setTrigger(None)
+        _FSA_DoSimulation_MicroStepProcessed_ParentPaused_1.setGuard(self._FSA_DoSimulation_MicroStepProcessed_ParentPaused_1_guard)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/ParentPaused"].addTransition(_FSA_DoSimulation_MicroStepProcessed_ParentPaused_1)
+        
+        # transition /FSA/DoSimulation/MicroStepProcessed/ChildNotDetected
+        _FSA_DoSimulation_MicroStepProcessed_ChildNotDetected_0 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/ChildNotDetected"], [self.states["/FSA/DoSimulation/MicroStepProcessed/ChildProcessed"]])
+        _FSA_DoSimulation_MicroStepProcessed_ChildNotDetected_0.setAction(self._FSA_DoSimulation_MicroStepProcessed_ChildNotDetected_0_exec)
+        _FSA_DoSimulation_MicroStepProcessed_ChildNotDetected_0.setTrigger(None)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/ChildNotDetected"].addTransition(_FSA_DoSimulation_MicroStepProcessed_ChildNotDetected_0)
+        
+        # transition /FSA/DoSimulation/MicroStepProcessed/ChildDetected
+        _FSA_DoSimulation_MicroStepProcessed_ChildDetected_0 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/ChildDetected"], [self.states["/FSA/DoSimulation/MicroStepProcessed/ChildInitialized"]])
+        _FSA_DoSimulation_MicroStepProcessed_ChildDetected_0.setAction(self._FSA_DoSimulation_MicroStepProcessed_ChildDetected_0_exec)
+        _FSA_DoSimulation_MicroStepProcessed_ChildDetected_0.setTrigger(None)
+        _FSA_DoSimulation_MicroStepProcessed_ChildDetected_0.setGuard(self._FSA_DoSimulation_MicroStepProcessed_ChildDetected_0_guard)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/ChildDetected"].addTransition(_FSA_DoSimulation_MicroStepProcessed_ChildDetected_0)
+        
+        # transition /FSA/DoSimulation/MicroStepProcessed/ChildInitialized
+        _FSA_DoSimulation_MicroStepProcessed_ChildInitialized_0 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/ChildInitialized"], [self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/CheckTermination"]])
+        _FSA_DoSimulation_MicroStepProcessed_ChildInitialized_0.setAction(self._FSA_DoSimulation_MicroStepProcessed_ChildInitialized_0_exec)
+        _FSA_DoSimulation_MicroStepProcessed_ChildInitialized_0.setTrigger(None)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/ChildInitialized"].addTransition(_FSA_DoSimulation_MicroStepProcessed_ChildInitialized_0)
+        
+        # transition /FSA/DoSimulation/MicroStepProcessed/CBD/CheckTermination/MacroStepProcessed
+        _FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_0 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/CheckTermination/MacroStepProcessed"], [self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/Terminated"]])
+        _FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_0.setAction(self._FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_0_exec)
+        _FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_0.setTrigger(None)
+        _FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_0.setGuard(self._FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_0_guard)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/CheckTermination/MacroStepProcessed"].addTransition(_FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_0)
+        _FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_1 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/CheckTermination/MacroStepProcessed"], [self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation"]])
+        _FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_1.setAction(self._FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_1_exec)
+        _FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_1.setTrigger(None)
+        _FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_1.setGuard(self._FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_1_guard)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/CheckTermination/MacroStepProcessed"].addTransition(_FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_1)
+        
+        # transition /FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MacroStepPrepared
+        _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MacroStepPrepared_0 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MacroStepPrepared"], [self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepProcessed"]])
+        _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MacroStepPrepared_0.setAction(self._FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MacroStepPrepared_0_exec)
+        _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MacroStepPrepared_0.setTrigger(None)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MacroStepPrepared"].addTransition(_FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MacroStepPrepared_0)
+        
+        # transition /FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepProcessed
+        _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_0 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepProcessed"], [self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepPrepared"]])
+        _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_0.setAction(self._FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_0_exec)
+        _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_0.setTrigger(None)
+        _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_0.setGuard(self._FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_0_guard)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepProcessed"].addTransition(_FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_0)
+        _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_1 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepProcessed"], [self.states["/FSA/DoSimulation/MicroStepProcessed/ChildPaused"]])
+        _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_1.setAction(self._FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_1_exec)
+        _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_1.setTrigger(None)
+        _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_1.setGuard(self._FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_1_guard)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepProcessed"].addTransition(_FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_1)
+        
+        # transition /FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepPrepared
+        _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepPrepared_0 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepPrepared"], [self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepProcessed"]])
+        _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepPrepared_0.setAction(self._FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepPrepared_0_exec)
+        _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepPrepared_0.setTrigger(None)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/DoSimulation/MicroStepPrepared"].addTransition(_FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepPrepared_0)
+        
+        # transition /FSA/DoSimulation/MicroStepProcessed/CBD/Terminated
+        _FSA_DoSimulation_MicroStepProcessed_CBD_Terminated_0 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/Terminated"], [self.states["/HybridTerminated"]])
+        _FSA_DoSimulation_MicroStepProcessed_CBD_Terminated_0.setAction(self._FSA_DoSimulation_MicroStepProcessed_CBD_Terminated_0_exec)
+        _FSA_DoSimulation_MicroStepProcessed_CBD_Terminated_0.setTrigger(None)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/CBD/Terminated"].addTransition(_FSA_DoSimulation_MicroStepProcessed_CBD_Terminated_0)
+        
+        # transition /FSA/DoSimulation/MicroStepProcessed/ChildPaused
+        _FSA_DoSimulation_MicroStepProcessed_ChildPaused_0 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/ChildPaused"], [self.states["/FSA/DoSimulation/MicroStepProcessed/NoStateEventDetected"]])
+        _FSA_DoSimulation_MicroStepProcessed_ChildPaused_0.setAction(self._FSA_DoSimulation_MicroStepProcessed_ChildPaused_0_exec)
+        _FSA_DoSimulation_MicroStepProcessed_ChildPaused_0.setTrigger(None)
+        _FSA_DoSimulation_MicroStepProcessed_ChildPaused_0.setGuard(self._FSA_DoSimulation_MicroStepProcessed_ChildPaused_0_guard)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/ChildPaused"].addTransition(_FSA_DoSimulation_MicroStepProcessed_ChildPaused_0)
+        _FSA_DoSimulation_MicroStepProcessed_ChildPaused_1 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/ChildPaused"], [self.states["/FSA/DoSimulation/MicroStepProcessed/StateEventDetected"]])
+        _FSA_DoSimulation_MicroStepProcessed_ChildPaused_1.setAction(self._FSA_DoSimulation_MicroStepProcessed_ChildPaused_1_exec)
+        _FSA_DoSimulation_MicroStepProcessed_ChildPaused_1.setTrigger(None)
+        _FSA_DoSimulation_MicroStepProcessed_ChildPaused_1.setGuard(self._FSA_DoSimulation_MicroStepProcessed_ChildPaused_1_guard)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/ChildPaused"].addTransition(_FSA_DoSimulation_MicroStepProcessed_ChildPaused_1)
+        
+        # transition /FSA/DoSimulation/MicroStepProcessed/NoStateEventDetected
+        _FSA_DoSimulation_MicroStepProcessed_NoStateEventDetected_0 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/NoStateEventDetected"], [self.states["/FSA/DoSimulation/MicroStepProcessed/ChildProcessed"]])
+        _FSA_DoSimulation_MicroStepProcessed_NoStateEventDetected_0.setAction(self._FSA_DoSimulation_MicroStepProcessed_NoStateEventDetected_0_exec)
+        _FSA_DoSimulation_MicroStepProcessed_NoStateEventDetected_0.setTrigger(None)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/NoStateEventDetected"].addTransition(_FSA_DoSimulation_MicroStepProcessed_NoStateEventDetected_0)
+        
+        # transition /FSA/DoSimulation/MicroStepProcessed/StateEventDetected
+        _FSA_DoSimulation_MicroStepProcessed_StateEventDetected_0 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/StateEventDetected"], [self.states["/FSA/DoSimulation/MicroStepProcessed/ChildProcessed"]])
+        _FSA_DoSimulation_MicroStepProcessed_StateEventDetected_0.setAction(self._FSA_DoSimulation_MicroStepProcessed_StateEventDetected_0_exec)
+        _FSA_DoSimulation_MicroStepProcessed_StateEventDetected_0.setTrigger(None)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/StateEventDetected"].addTransition(_FSA_DoSimulation_MicroStepProcessed_StateEventDetected_0)
+        
+        # transition /FSA/DoSimulation/MicroStepProcessed/ChildProcessed
+        _FSA_DoSimulation_MicroStepProcessed_ChildProcessed_0 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/ChildProcessed"], [self.states["/FSA/DoSimulation/MicroStepPrepared"]])
+        _FSA_DoSimulation_MicroStepProcessed_ChildProcessed_0.setAction(self._FSA_DoSimulation_MicroStepProcessed_ChildProcessed_0_exec)
+        _FSA_DoSimulation_MicroStepProcessed_ChildProcessed_0.setTrigger(None)
+        _FSA_DoSimulation_MicroStepProcessed_ChildProcessed_0.setGuard(self._FSA_DoSimulation_MicroStepProcessed_ChildProcessed_0_guard)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/ChildProcessed"].addTransition(_FSA_DoSimulation_MicroStepProcessed_ChildProcessed_0)
+        _FSA_DoSimulation_MicroStepProcessed_ChildProcessed_1 = Transition(self, self.states["/FSA/DoSimulation/MicroStepProcessed/ChildProcessed"], [self.states["/FSA/CheckTermination"]])
+        _FSA_DoSimulation_MicroStepProcessed_ChildProcessed_1.setAction(self._FSA_DoSimulation_MicroStepProcessed_ChildProcessed_1_exec)
+        _FSA_DoSimulation_MicroStepProcessed_ChildProcessed_1.setTrigger(None)
+        _FSA_DoSimulation_MicroStepProcessed_ChildProcessed_1.setGuard(self._FSA_DoSimulation_MicroStepProcessed_ChildProcessed_1_guard)
+        self.states["/FSA/DoSimulation/MicroStepProcessed/ChildProcessed"].addTransition(_FSA_DoSimulation_MicroStepProcessed_ChildProcessed_1)
+        
+        # transition /FSA/DoSimulation/MicroStepPrepared
+        _FSA_DoSimulation_MicroStepPrepared_0 = Transition(self, self.states["/FSA/DoSimulation/MicroStepPrepared"], [self.states["/FSA/DoSimulation/ParentMicroStepProcessed"]])
+        _FSA_DoSimulation_MicroStepPrepared_0.setAction(self._FSA_DoSimulation_MicroStepPrepared_0_exec)
+        _FSA_DoSimulation_MicroStepPrepared_0.setTrigger(None)
+        self.states["/FSA/DoSimulation/MicroStepPrepared"].addTransition(_FSA_DoSimulation_MicroStepPrepared_0)
+        
+        # transition /FSA/DoSimulation/ParentMicroStepProcessed
+        _FSA_DoSimulation_ParentMicroStepProcessed_0 = Transition(self, self.states["/FSA/DoSimulation/ParentMicroStepProcessed"], [self.states["/FSA/DoSimulation/MacroStepPrepared"]])
+        _FSA_DoSimulation_ParentMicroStepProcessed_0.setAction(self._FSA_DoSimulation_ParentMicroStepProcessed_0_exec)
+        _FSA_DoSimulation_ParentMicroStepProcessed_0.setTrigger(None)
+        self.states["/FSA/DoSimulation/ParentMicroStepProcessed"].addTransition(_FSA_DoSimulation_ParentMicroStepProcessed_0)
+        
+        # transition /FSA/Terminated
+        _FSA_Terminated_0 = Transition(self, self.states["/FSA/Terminated"], [self.states["/HybridTerminated"]])
+        _FSA_Terminated_0.setAction(self._FSA_Terminated_0_exec)
+        _FSA_Terminated_0.setTrigger(None)
+        self.states["/FSA/Terminated"].addTransition(_FSA_Terminated_0)
+        
+        # transition /ParentStarted
+        _ParentStarted_0 = Transition(self, self.states["/ParentStarted"], [self.states["/FSA/Initialized"]])
+        _ParentStarted_0.setAction(self._ParentStarted_0_exec)
+        _ParentStarted_0.setTrigger(None)
+        self.states["/ParentStarted"].addTransition(_ParentStarted_0)
+    
+    def _FSA_Started_0_exec(self, parameters):
+        print('From FSA/Started to ParentStarted... ')
+        self.weaved_delta = min(self.fsa_timestep, self.cbd_delta)
+        self.fsa_logicalTime = 0.0
+        self.fsa_elapsed = 0
+        self.fsa_timestep = self.weaved_delta
+        self.fsa_currentState = self.weaved_model.initialState
+    
+    def _FSA_Initialized_0_exec(self, parameters):
+        print('From FSA/Initialized to FSA/CheckTermination... ')
+    
+    def _FSA_CheckTermination_MacroStepProcessed_0_exec(self, parameters):
+        print('From FSA/CheckTermination/MacroStepProcessed to FSA/DoSimulation and reading events... ')
+        self.fsa_currentEvent = self.fsa_getInputEventAt(self.fsa_logicalTime)
+        self.fsa_selectedTransition = self.weaved_model.getTransitionFrom(self.fsa_currentState, self.fsa_currentEvent, self.fsa_elapsed)
+        print('Current event:' + str(self.fsa_currentEvent))
+        print('Current transition:' + str(self.fsa_selectedTransition))
+        print('Child detected?:' + str(isinstance(self.fsa_currentState, CBDState)))
+    
+    def _FSA_CheckTermination_MacroStepProcessed_0_guard(self, parameters):
+        return not self.fsa_currentState.final
+    
+    def _FSA_CheckTermination_MacroStepProcessed_1_exec(self, parameters):
+        print('From FSA/CheckTermination/MacroStepProcessed to Terminated... ')
+    
+    def _FSA_CheckTermination_MacroStepProcessed_1_guard(self, parameters):
+        return self.fsa_currentState.final
+    
+    def _FSA_DoSimulation_MacroStepPrepared_ParentPaused_0_exec(self, parameters):
+        print('From FSA/ParentPaused to FSA/ChildDetected... ')
+        self.cbd_model = self.fsa_currentState.cbd
+    
+    def _FSA_DoSimulation_MacroStepPrepared_ParentPaused_0_guard(self, parameters):
+        return isinstance(self.fsa_currentState, CBDState)
+    
+    def _FSA_DoSimulation_MacroStepPrepared_ParentPaused_1_exec(self, parameters):
+        print('From ParentPaused to ChildNotDetected without any child to process... ')
+    
+    def _FSA_DoSimulation_MacroStepPrepared_ParentPaused_1_guard(self, parameters):
+        return not isinstance(self.fsa_currentState, CBDState)
+    
+    def _FSA_DoSimulation_MacroStepPrepared_ChildNotDetected_0_exec(self, parameters):
+        print('From ChildNotDetected to ChildProcessed... ')
+    
+    def _FSA_DoSimulation_MacroStepPrepared_ChildDetected_0_exec(self, parameters):
+        print('From ChildDetected to ChildInitialized... ')
+    
+    def _FSA_DoSimulation_MacroStepPrepared_ChildDetected_0_guard(self, parameters):
+        return self.woven_child_initialized
+    
+    def _FSA_DoSimulation_MacroStepPrepared_ChildDetected_1_exec(self, parameters):
+        print('From ChildDetected to ChildNotInitialized... ')
+    
+    def _FSA_DoSimulation_MacroStepPrepared_ChildDetected_1_guard(self, parameters):
+        return not self.woven_child_initialized
+    
+    def _FSA_DoSimulation_MacroStepPrepared_ChildInitialized_0_exec(self, parameters):
+        print('From ChildInitialized to ChildProcessed... ')
+    
+    def _FSA_DoSimulation_MacroStepPrepared_ChildNotInitialized_0_exec(self, parameters):
+        print('From ChildNotInitialized to CBD/Started... ')
+        self.cbd_delta = self.weaved_delta
+        self.updateCBDState()
+        self.woven_child_initialized = True
+    
+    def _FSA_DoSimulation_MacroStepPrepared_CBD_Started_0_exec(self, parameters):
+        print('From CBD/Started to Initialized... ')
+        print('Performing initialization...')
+        self.cbd_iteration = 0
+        self.cbd_clock = 0
+        self.cbd_controller = CBDController(self.cbd_model, self.cbd_delta)
+        self.cbd_controller.initSimulation()
+        print('Performing initialization... DONE')
+    
+    def _FSA_DoSimulation_MacroStepPrepared_CBD_Initialized_0_exec(self, parameters):
+        print('From CBD/Initialized to ChildInitialized... ')
+    
+    def _FSA_DoSimulation_MacroStepPrepared_ChildProcessed_0_exec(self, parameters):
+        print('From MacroStepPrepared/ChildProcessed to MicroStepProcessed... ')
+    
+    def _FSA_DoSimulation_MicroStepProcessed_ParentPaused_0_exec(self, parameters):
+        print('From FSA/ParentPaused to FSA/ChildDetected... ')
+        self.cbd_model = self.fsa_currentState.cbd
+    
+    def _FSA_DoSimulation_MicroStepProcessed_ParentPaused_0_guard(self, parameters):
+        return isinstance(self.fsa_currentState, CBDState)
+    
+    def _FSA_DoSimulation_MicroStepProcessed_ParentPaused_1_exec(self, parameters):
+        print('From ParentPaused to ChildNotDetected without any child to process... ')
+    
+    def _FSA_DoSimulation_MicroStepProcessed_ParentPaused_1_guard(self, parameters):
+        return not isinstance(self.fsa_currentState, CBDState)
+    
+    def _FSA_DoSimulation_MicroStepProcessed_ChildNotDetected_0_exec(self, parameters):
+        print('From ChildNotDetected to ChildProcessed... ')
+    
+    def _FSA_DoSimulation_MicroStepProcessed_ChildDetected_0_exec(self, parameters):
+        print('From ChildDetected to ChildInitialized... ')
+    
+    def _FSA_DoSimulation_MicroStepProcessed_ChildDetected_0_guard(self, parameters):
+        return self.woven_child_initialized
+    
+    def _FSA_DoSimulation_MicroStepProcessed_ChildInitialized_0_exec(self, parameters):
+        print('From ChildInitialized to ChildProcessed... ')
+    
+    def _FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_0_exec(self, parameters):
+        print('From CBD/MacroStepProcessed to Terminated... ')
+    
+    def _FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_0_guard(self, parameters):
+        return self.cbd_maxIterationsReached()
+    
+    def _FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_1_exec(self, parameters):
+        print('From CBD/MacroStepProcessed to MacroStepPrepared... ')
+        self.cbd_currentCompIdx = 0
+        self.cbd_depGraph = self.cbd_controller.createDepGraph(self.cbd_iteration)
+        self.cbd_strongComponentList = self.cbd_controller.createStrongComponents(self.cbd_depGraph, self.cbd_iteration)
+    
+    def _FSA_DoSimulation_MicroStepProcessed_CBD_CheckTermination_MacroStepProcessed_1_guard(self, parameters):
+        return not self.cbd_maxIterationsReached()
+    
+    def _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MacroStepPrepared_0_exec(self, parameters):
+        print('From CBD/MacroStepPrepared to MicroStepProcessed... ')
+    
+    def _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_0_exec(self, parameters):
+        print('From CBD/MicroStepProcessed to MicroStepPrepared')
+    
+    def _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_0_guard(self, parameters):
+        return self.cbd_hasNextStrongComponent()
+    
+    def _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_1_exec(self, parameters):
+        print('From CBD/MicroStepProcessed to ChildPaused and detecting triggered transitions... ')
+        self.updateGlobalState()
+        self.weaved_lib.dumpGlobalState(self.weaved_model, self.weaved_global_state, self.fsa_logicalTime, self.fsa_currentState)
+        self.weaved_triggered_when_transition = self.getTriggeredWhenTransition()
+        self.cbd_clock = self.cbd_clock + self.cbd_delta
+        self.cbd_iteration = self.cbd_iteration + 1
+        self.cbd_controller.advanceTimeStep()
+        print('CBD clock: ' + str(self.cbd_clock))
+        print('CBD iteration: ' + str(self.cbd_iteration))
+    
+    def _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepProcessed_1_guard(self, parameters):
+        return not self.cbd_hasNextStrongComponent()
+    
+    def _FSA_DoSimulation_MicroStepProcessed_CBD_DoSimulation_MicroStepPrepared_0_exec(self, parameters):
+        print('From CBD/MicroStepPrepared to MicroStepProcessed...')
+        self.cbd_computeBlock()
+        self.cbd_currentCompIdx = self.cbd_currentCompIdx + 1
+    
+    def _FSA_DoSimulation_MicroStepProcessed_CBD_Terminated_0_exec(self, parameters):
+        print('From CBD/Terminated to HybridTerminated... ')
+    
+    def _FSA_DoSimulation_MicroStepProcessed_ChildPaused_0_exec(self, parameters):
+        print('From ChildPaused to NoStateEventDetected... ')
+    
+    def _FSA_DoSimulation_MicroStepProcessed_ChildPaused_0_guard(self, parameters):
+        return self.weaved_triggered_when_transition == None
+    
+    def _FSA_DoSimulation_MicroStepProcessed_ChildPaused_1_exec(self, parameters):
+        print('From ChildPaused to StateEventDetected... ')
+    
+    def _FSA_DoSimulation_MicroStepProcessed_ChildPaused_1_guard(self, parameters):
+        return self.weaved_triggered_when_transition != None
+    
+    def _FSA_DoSimulation_MicroStepProcessed_NoStateEventDetected_0_exec(self, parameters):
+        print('From NoStateEventDetected to ChildProcessed... ')
+    
+    def _FSA_DoSimulation_MicroStepProcessed_StateEventDetected_0_exec(self, parameters):
+        print('From StateEventDetected to ChildProcessed... ')
+        if self.fsa_selectedTransition == None:
+        	self.fsa_selectedTransition = self.weaved_triggered_when_transition
+    
+    def _FSA_DoSimulation_MicroStepProcessed_ChildProcessed_0_exec(self, parameters):
+        print('From FSA/MicroStepProcessed/ChildProcessed to MicroStepPrepared... ')
+    
+    def _FSA_DoSimulation_MicroStepProcessed_ChildProcessed_0_guard(self, parameters):
+        return self.fsa_selectedTransition != None
+    
+    def _FSA_DoSimulation_MicroStepProcessed_ChildProcessed_1_exec(self, parameters):
+        print('From FSA/MicroStepProcessed/ChildProcessed to FSA/CheckTermination and advancing time... ')
+        self.fsa_logicalTime = self.fsa_logicalTime + self.fsa_timestep
+        self.fsa_elapsed = self.fsa_elapsed + self.fsa_timestep
+        print(self.fsa_logicalTime)
+        print(self.fsa_elapsed)
+    
+    def _FSA_DoSimulation_MicroStepProcessed_ChildProcessed_1_guard(self, parameters):
+        return self.fsa_selectedTransition == None
+    
+    def _FSA_DoSimulation_MicroStepPrepared_0_exec(self, parameters):
+        print('From FSA/MicroStepPrepared to ParentMicroStepProcessed and attempting to take transition... ')
+        print('Transition to be taken: ' + str(self.fsa_selectedTransition))
+        self.fsa_currentState = self.fsa_selectedTransition.target
+        self.fsa_elapsed = 0
+        self.fsa_processEvent(self.fsa_currentEvent)
+        self.weaved_lib.dumpDiscreteEvent(self.weaved_model, self.fsa_logicalTime, self.fsa_currentState, self.fsa_selectedTransition)
+        self.weaved_lib.dumpGlobalState(self.weaved_model, self.weaved_global_state, self.fsa_logicalTime, self.fsa_currentState)
+        print('New state: ' + str(self.fsa_currentState))
+        print('Reading events:')
+        self.fsa_currentEvent = self.fsa_getInputEventAt(self.fsa_logicalTime)
+        self.fsa_selectedTransition = self.weaved_model.getTransitionFrom(self.fsa_currentState, self.fsa_currentEvent, self.fsa_elapsed)
+        print(self.fsa_currentEvent)
+        print(self.fsa_selectedTransition)
+    
+    def _FSA_DoSimulation_ParentMicroStepProcessed_0_exec(self, parameters):
+        print('From ParentMicroStepProcessed to ParentPaused and resetting the child... ')
+        self.woven_child_initialized = False
+    
+    def _FSA_Terminated_0_exec(self, parameters):
+        print('From FSA/Terminated to HybridTerminated... ')
+    
+    def _ParentStarted_0_exec(self, parameters):
+        print('From ParentStarted to FSA/Initialized... ')
+        self.weaved_global_state = dict()
+        self.weaved_previous_global_state = dict()
+        self.woven_child_initialized = False
+    
+    def initializeStatechart(self):
+        # enter default state
+        self.default_targets = self.states["/FSA"].getEffectiveTargetStates()
+        RuntimeClassBase.initializeStatechart(self)
+
+class ObjectManager(ObjectManagerBase):
+    def __init__(self, controller):
+        ObjectManagerBase.__init__(self, controller)
+    
+    def instantiate(self, class_name, construct_params):
+        if class_name == "Weaved_CBD_FSA_Simulator":
+            instance = Weaved_CBD_FSA_Simulator(self.controller, construct_params[0], construct_params[1], construct_params[2])
+            instance.associations = {}
+        else:
+            raise Exception("Cannot instantiate class " + class_name)
+        return instance
+
+class Controller(ThreadsControllerBase):
+    def __init__(self, cbd_options, amodel, fsa_events, keep_running = None, behind_schedule_callback = None):
+        if keep_running == None: keep_running = True
+        if behind_schedule_callback == None: behind_schedule_callback = None
+        ThreadsControllerBase.__init__(self, ObjectManager(self), keep_running, behind_schedule_callback)
+        self.object_manager.createInstance("Weaved_CBD_FSA_Simulator", [cbd_options, amodel, fsa_events])

+ 73 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/weaved_runner.py

@@ -0,0 +1,73 @@
+'''
+Created on 10-sep.-2014
+
+@author: Bruno
+'''
+#from bokeh.plotting import figure, output_file, show
+from fsaclasses import State, Transition, After, Float, FSAModel, Event, RunTimeEvent, Events
+from fsa_cbd_weaved_classes import CBDState
+from CBDMultipleOutput.models.HarmonicOscilator import CircleCBDDerivative
+from weaved_cbd_fsa_simulator import Controller
+from Options import Options
+from models.bouncingball import BouncingBallFSA
+import os
+from weaved_cbd_fsa_lib import FSACBDLib
+
+CBD_DELTA = 0.01
+
+def buildModel():
+    statea = State("a")
+    stateb = State("b")
+    statec = CBDState("c", CircleCBDDerivative("Harmonic Oscilator", CBD_DELTA))
+    #statec = State("c")
+    stated = State("d")
+    statef = State("f", True)
+    
+    transitionab = Transition("a2b",statea,stateb)
+    transitionab.trigger = After(Float(5.0))
+    
+    transitionbc = Transition("b2c",stateb,statec)
+    transitionbc.trigger = After(Float(2.0))
+
+    transitioncd = Transition("c2d",statec,stated)
+    transitioncd.trigger = Event("c")
+
+    transitiondf = Transition("d2f",stated,statef)
+    transitiondf.trigger = After(Float(5.0))
+
+    fsamodel = FSAModel(
+                        [statea,stateb,statec,stated],
+                        [transitionab,transitionbc,transitioncd,transitiondf]
+                        )
+    fsamodel.initialState = statea
+    return fsamodel
+
+if __name__ == '__main__':
+    
+    if os.path.exists(FSACBDLib.OUTPUT_EVENTS):
+        os.remove(FSACBDLib.OUTPUT_EVENTS)
+    if os.path.exists(FSACBDLib.OUTPUT_SIGNALS):
+        os.remove(FSACBDLib.OUTPUT_SIGNALS)
+    
+    options = Options(delta = CBD_DELTA)
+    options.setMaxIterations(10000);
+    fsamodel = BouncingBallFSA()
+    events = Events([RunTimeEvent('kick',13.0), RunTimeEvent('kick',23.0), RunTimeEvent('kick',37.0) ,RunTimeEvent('enough',60.0)])
+    #events = Events([RunTimeEvent('enough',25.0)])
+    controller = Controller(options, fsamodel, events, keep_running=False)
+    controller.start()
+    
+    '''
+    cbdModel = fsamodel.states[2].cbd;
+    
+    times = []
+    values = []
+    for timeValuePair in cbdModel.getSignal("neg"):
+        times.append(timeValuePair.time)
+        values.append(timeValuePair.value)
+        
+    output_file("./plot.html", title="Plot")
+    p = figure(title="Something vs Otherthing", x_axis_label="Time", y_axis_label="Values")
+    p.line(times, values, legend="Something", line_width=1, line_color="red")
+    show(p)
+    '''

+ 532 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/woven_fsa_cbd_simulator_hierarchical.xml

@@ -0,0 +1,532 @@
+<?xml version="1.0" ?>
+<diagram name="Weaved_CBD_FSA_Simulator_Manual" author="Sadaf Mustafiz and Bruno Barroca and Claudio Gomes">
+	<description>
+		Automatically woven CBD and FSA simulators with the FSA being the dominant.
+	</description>
+	<top>
+		<![CDATA[
+			from sccd.runtime.libs.ui import *
+			from sccd.runtime.libs.utils import *
+			import copy
+			from CBD_Controller import CBDController
+			import Options
+			from fsa_cbd_weaved_classes import CBDState
+			from weaved_cbd_fsa_lib import FSACBDLib
+		]]>
+	</top>
+	<class name="Weaved_CBD_FSA_Simulator" default="True">
+		<attribute name="weaved_global_state"/>
+		<attribute name="fsa_elapsed"/>
+		<attribute name="cbd_options"/>
+		<attribute name="weaved_lib"/>
+		<attribute name="woven_child_initialized"/>
+		<attribute name="cbd_clock"/>
+		<attribute name="fsa_currentEvent"/>
+		<attribute name="weaved_delta"/>
+		<attribute name="weaved_model"/>
+		<attribute name="cbd_controller"/>
+		<attribute name="fsa_timestep"/>
+		<attribute name="cbd_currentCompIdx"/>
+		<attribute name="fsa_eventList"/>
+		<attribute name="cbd_depGraph"/>
+		<attribute name="fsa_selectedTransition"/>
+		<attribute name="cbd_strongComponentList"/>
+		<attribute name="weaved_previous_global_state"/>
+		<attribute name="cbd_delta"/>
+		<attribute name="weaved_triggered_when_transition"/>
+		<attribute name="cbd_iteration"/>
+		<attribute name="fsa_logicalTime"/>
+		<attribute name="fsa_currentState"/>
+		<method name="Weaved_CBD_FSA_Simulator">
+			<parameter name="cbd_options"/>
+			<parameter name="amodel"/>
+			<parameter name="fsa_events"/>
+			<body>
+			<![CDATA[
+				self.weaved_lib = FSACBDLib()
+				self.cbd_options = cbd_options
+				self.cbd_delta = self.cbd_options.getDeltaT()
+				self.weaved_model = amodel
+				self.fsa_eventList = fsa_events
+				self.fsa_timestep = 1.0
+			]]>
+			</body>
+		</method>
+		<method name="fsa_processEvent">
+			<parameter name="event"/>
+			<body>
+			<![CDATA[
+				if (event != None):
+					self.fsa_eventList.popEvent(event)
+					event.processed = True
+			]]>
+			</body>
+		</method>
+		<method name="updateCBDState">
+			<body>
+			<![CDATA[
+				self.weaved_lib.updateCBDState(self.weaved_global_state, self.fsa_currentState.cbd)
+			]]>
+			</body>
+		</method>
+		<method name="cbd_maxIterationsReached">
+			<body>
+			<![CDATA[
+				return self.cbd_iteration >= self.cbd_options.getMaxIterations()
+			]]>
+			</body>
+		</method>
+		<method name="fsa_getInputEventAt">
+			<parameter name="time"/>
+			<body>
+			<![CDATA[
+				return self.fsa_eventList.getInputAt(time)
+			]]>
+			</body>
+		</method>
+		<method name="cbd_computeBlock">
+			<body>
+			<![CDATA[
+				if self.cbd_currentComponentIsCycle():
+					self.cbd_controller.computeNextAlgebraicLoop(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_iteration)
+				else:
+					self.cbd_controller.computeNextBlock(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_iteration)
+			]]>
+			</body>
+		</method>
+		<method name="updateGlobalState">
+			<body>
+			<![CDATA[
+				self.weaved_previous_global_state = copy.deepcopy(self.weaved_global_state)
+				self.weaved_lib.updateGlobalState(self.weaved_global_state, self.fsa_currentState.cbd, self.cbd_clock)
+			]]>
+			</body>
+		</method>
+		<method name="cbd_currentComponentIsCycle">
+			<body>
+			<![CDATA[
+				return self.cbd_controller.componentIsCycle(self.cbd_strongComponentList[self.cbd_currentCompIdx], self.cbd_depGraph)
+			]]>
+			</body>
+		</method>
+		<method name="cbd_hasNextStrongComponent">
+			<body>
+			<![CDATA[
+				return (self.cbd_currentCompIdx) < len(self.cbd_strongComponentList)
+			]]>
+			</body>
+		</method>
+		<method name="getTriggeredWhenTransition">
+			<body>
+			<![CDATA[
+				return self.weaved_lib.getTriggeredWhenTransition(self.weaved_model, self.fsa_currentState, self.weaved_global_state, self.weaved_previous_global_state)
+			]]>
+			</body>
+		</method>
+		<scxml initial="FSA" final="HybridTerminated">
+			<state id="FSA" initial="Started">
+				<state id="Started">
+					<transition target="../../ParentStarted">
+						<script>
+							<![CDATA[
+								print('From FSA/Started to ParentStarted... ')
+								self.weaved_delta = min(self.fsa_timestep, self.cbd_delta)
+								self.fsa_logicalTime = 0.0
+								self.fsa_elapsed = 0
+								self.fsa_timestep = self.weaved_delta
+								self.fsa_currentState = self.weaved_model.initialState
+							]]>
+						</script>
+					</transition>
+				</state>
+				<state id="Initialized">
+					<transition target="../CheckTermination">
+						<script>
+							<![CDATA[
+								print('From FSA/Initialized to FSA/CheckTermination... ')
+							]]>
+						</script>
+					</transition>
+				</state>
+				<state id="CheckTermination" initial="MacroStepProcessed">
+					<state id="MacroStepProcessed">
+						<transition target="../../DoSimulation" cond="not self.fsa_currentState.final">
+							<script>
+								<![CDATA[
+									print('From FSA/CheckTermination/MacroStepProcessed to FSA/DoSimulation and reading events... ')
+									self.fsa_currentEvent = self.fsa_getInputEventAt(self.fsa_logicalTime)
+									self.fsa_selectedTransition = self.weaved_model.getTransitionFrom(self.fsa_currentState, self.fsa_currentEvent, self.fsa_elapsed)
+									print('Current event:' + str(self.fsa_currentEvent))
+									print('Current transition:' + str(self.fsa_selectedTransition))
+									print('Child detected?:' + str(isinstance(self.fsa_currentState, CBDState)))
+								]]>
+							</script>
+						</transition>
+						<transition target="../../Terminated" cond="self.fsa_currentState.final">
+							<script>
+								<![CDATA[
+									print('From FSA/CheckTermination/MacroStepProcessed to Terminated... ')
+								]]>
+							</script>
+						</transition>
+					</state>
+				</state>
+				<state id="DoSimulation" initial="MacroStepPrepared">
+					<state id="MacroStepPrepared" initial="ParentPaused">
+						<state id="ParentPaused">
+							<transition target="../ChildDetected" cond="isinstance(self.fsa_currentState, CBDState)">
+								<script>
+									<![CDATA[
+										print('From FSA/ParentPaused to FSA/ChildDetected... ')
+										self.cbd_model = self.fsa_currentState.cbd
+									]]>
+								</script>
+							</transition>
+							<transition target="../ChildNotDetected" cond="not isinstance(self.fsa_currentState, CBDState)">
+								<script>
+									<![CDATA[
+										print('From ParentPaused to ChildNotDetected without any child to process... ')
+									]]>
+								</script>
+							</transition>
+						</state>
+						<state id="ChildNotDetected">
+							<transition target="../ChildProcessed">
+								<script>
+									<![CDATA[
+										print('From ChildNotDetected to ChildProcessed... ')
+									]]>
+								</script>
+							</transition>
+						</state>
+						<state id="ChildDetected">
+							<transition target="../ChildInitialized" cond="self.woven_child_initialized">
+								<script>
+									<![CDATA[
+										print('From ChildDetected to ChildInitialized... ')
+									]]>
+								</script>
+							</transition>
+							<transition target="../ChildNotInitialized" cond="not self.woven_child_initialized">
+								<script>
+									<![CDATA[
+										print('From ChildDetected to ChildNotInitialized... ')
+									]]>
+								</script>
+							</transition>
+						</state>
+						<state id="ChildInitialized">
+							<transition target="../ChildProcessed">
+								<script>
+									<![CDATA[
+										print('From ChildInitialized to ChildProcessed... ')
+									]]>
+								</script>
+							</transition>
+						</state>
+						<state id="ChildNotInitialized">
+							<transition target="../CBD/Started">
+								<script>
+									<![CDATA[
+										print('From ChildNotInitialized to CBD/Started... ')
+										self.cbd_delta = self.weaved_delta
+										self.updateCBDState()
+										self.woven_child_initialized = True
+									]]>
+								</script>
+							</transition>
+						</state>
+						<state id="CBD" initial="Started">
+							<state id="Started">
+								<transition target="../Initialized">
+									<script>
+										<![CDATA[
+											print('From CBD/Started to Initialized... ')
+											print('Performing initialization...')
+											self.cbd_iteration = 0
+											self.cbd_clock = 0
+											self.cbd_controller = CBDController(self.cbd_model, self.cbd_delta)
+											self.cbd_controller.initSimulation()
+											print('Performing initialization... DONE')
+										]]>
+									</script>
+								</transition>
+							</state>
+							<state id="Initialized">
+								<transition target="../../ChildInitialized">
+									<script>
+										<![CDATA[
+											print('From CBD/Initialized to ChildInitialized... ')
+										]]>
+									</script>
+								</transition>
+							</state>
+						</state>
+						<state id="ChildProcessed">
+							<transition target="../../MicroStepProcessed">
+								<script>
+									<![CDATA[
+										print('From MacroStepPrepared/ChildProcessed to MicroStepProcessed... ')
+									]]>
+								</script>
+							</transition>
+						</state>
+					</state>
+					<state id="MicroStepProcessed" initial="ParentPaused">
+						<state id="ParentPaused">
+							<transition target="../ChildDetected" cond="isinstance(self.fsa_currentState, CBDState)">
+								<script>
+									<![CDATA[
+										print('From FSA/ParentPaused to FSA/ChildDetected... ')
+										self.cbd_model = self.fsa_currentState.cbd
+									]]>
+								</script>
+							</transition>
+							<transition target="../ChildNotDetected" cond="not isinstance(self.fsa_currentState, CBDState)">
+								<script>
+									<![CDATA[
+										print('From ParentPaused to ChildNotDetected without any child to process... ')
+									]]>
+								</script>
+							</transition>
+						</state>
+						<state id="ChildNotDetected">
+							<transition target="../ChildProcessed">
+								<script>
+									<![CDATA[
+										print('From ChildNotDetected to ChildProcessed... ')
+									]]>
+								</script>
+							</transition>
+						</state>
+						<state id="ChildDetected">
+							<transition target="../ChildInitialized" cond="self.woven_child_initialized">
+								<script>
+									<![CDATA[
+										print('From ChildDetected to ChildInitialized... ')
+									]]>
+								</script>
+							</transition>
+						</state>
+						<state id="ChildInitialized">
+							<transition target="../CBD/CheckTermination">
+								<script>
+									<![CDATA[
+										print('From ChildInitialized to ChildProcessed... ')
+									]]>
+								</script>
+							</transition>
+						</state>
+						<state id="CBD" initial="CheckTermination">
+							<state id="CheckTermination" initial="MacroStepProcessed">
+								<state id="MacroStepProcessed">
+									<transition target="../../Terminated" cond="self.cbd_maxIterationsReached()">
+										<script>
+											<![CDATA[
+												print('From CBD/MacroStepProcessed to Terminated... ')
+											]]>
+										</script>
+									</transition>
+									<transition target="../../DoSimulation" cond="not self.cbd_maxIterationsReached()">
+										<script>
+											<![CDATA[
+												print('From CBD/MacroStepProcessed to MacroStepPrepared... ')
+												self.cbd_currentCompIdx = 0
+												self.cbd_depGraph = self.cbd_controller.createDepGraph(self.cbd_iteration)
+												self.cbd_strongComponentList = self.cbd_controller.createStrongComponents(self.cbd_depGraph, self.cbd_iteration)
+											]]>
+										</script>
+									</transition>
+								</state>
+							</state>
+							<state id="DoSimulation" initial="MacroStepPrepared">
+								<state id="MacroStepPrepared">
+									<transition target="../MicroStepProcessed">
+										<script>
+											<![CDATA[
+												print('From CBD/MacroStepPrepared to MicroStepProcessed... ')
+											]]>
+										</script>
+									</transition>
+								</state>
+								<state id="MicroStepProcessed">
+									<transition target="../MicroStepPrepared" cond="self.cbd_hasNextStrongComponent()">
+										<script>
+											<![CDATA[
+												print('From CBD/MicroStepProcessed to MicroStepPrepared')
+											]]>
+										</script>
+									</transition>
+									<transition target="../../../ChildPaused" cond="not self.cbd_hasNextStrongComponent()">
+										<script>
+											<![CDATA[
+												print('From CBD/MicroStepProcessed to ChildPaused and detecting triggered transitions... ')
+												self.updateGlobalState()
+												self.weaved_lib.dumpGlobalState(self.weaved_model, self.weaved_global_state, self.fsa_logicalTime, self.fsa_currentState)
+												self.weaved_triggered_when_transition = self.getTriggeredWhenTransition()
+												self.cbd_clock = self.cbd_clock + self.cbd_delta
+												self.cbd_iteration = self.cbd_iteration + 1
+												self.cbd_controller.advanceTimeStep()
+												print('CBD clock: ' + str(self.cbd_clock))
+												print('CBD iteration: ' + str(self.cbd_iteration))
+											]]>
+										</script>
+									</transition>
+								</state>
+								<state id="MicroStepPrepared">
+									<transition target="../MicroStepProcessed">
+										<script>
+											<![CDATA[
+												print('From CBD/MicroStepPrepared to MicroStepProcessed...')
+												self.cbd_computeBlock()
+												self.cbd_currentCompIdx = self.cbd_currentCompIdx + 1
+											]]>
+										</script>
+									</transition>
+								</state>
+							</state>
+							<state id="Terminated">
+								<transition target="../../../../../HybridTerminated">
+									<script>
+										<![CDATA[
+											print('From CBD/Terminated to HybridTerminated... ')
+										]]>
+									</script>
+								</transition>
+							</state>
+						</state>
+						<state id="ChildPaused">
+							<transition target="../NoStateEventDetected" cond="self.weaved_triggered_when_transition == None">
+								<script>
+									<![CDATA[
+										print('From ChildPaused to NoStateEventDetected... ')
+									]]>
+								</script>
+							</transition>
+							<transition target="../StateEventDetected" cond="self.weaved_triggered_when_transition != None">
+								<script>
+									<![CDATA[
+										print('From ChildPaused to StateEventDetected... ')
+									]]>
+								</script>
+							</transition>
+						</state>
+						<state id="NoStateEventDetected">
+							<transition target="../ChildProcessed">
+								<script>
+									<![CDATA[
+										print('From NoStateEventDetected to ChildProcessed... ')
+									]]>
+								</script>
+							</transition>
+						</state>
+						<state id="StateEventDetected">
+							<transition target="../ChildProcessed">
+								<script>
+									<![CDATA[
+										print('From StateEventDetected to ChildProcessed... ')
+										if self.fsa_selectedTransition == None:
+											self.fsa_selectedTransition = self.weaved_triggered_when_transition
+									]]>
+								</script>
+							</transition>
+						</state>
+						<state id="ChildProcessed">
+							<transition target="../../MicroStepPrepared" cond="self.fsa_selectedTransition != None">
+								<script>
+									<![CDATA[
+										print('From FSA/MicroStepProcessed/ChildProcessed to MicroStepPrepared... ')
+									]]>
+								</script>
+							</transition>
+							<transition target="../../../CheckTermination" cond="self.fsa_selectedTransition == None">
+								<script>
+									<![CDATA[
+										print('From FSA/MicroStepProcessed/ChildProcessed to FSA/CheckTermination and advancing time... ')
+										self.fsa_logicalTime = self.fsa_logicalTime + self.fsa_timestep
+										self.fsa_elapsed = self.fsa_elapsed + self.fsa_timestep
+										print(self.fsa_logicalTime)
+										print(self.fsa_elapsed)
+									]]>
+								</script>
+							</transition>
+						</state>
+					</state>
+					<state id="MicroStepPrepared">
+						<transition target="../ParentMicroStepProcessed">
+							<script>
+								<![CDATA[
+									print('From FSA/MicroStepPrepared to ParentMicroStepProcessed and attempting to take transition... ')
+									print('Transition to be taken: ' + str(self.fsa_selectedTransition))
+									self.fsa_currentState = self.fsa_selectedTransition.target
+									self.fsa_elapsed = 0
+									self.fsa_processEvent(self.fsa_currentEvent)
+									self.weaved_lib.dumpDiscreteEvent(self.weaved_model, self.fsa_logicalTime, self.fsa_currentState, self.fsa_selectedTransition)
+									self.weaved_lib.dumpGlobalState(self.weaved_model, self.weaved_global_state, self.fsa_logicalTime, self.fsa_currentState)
+									print('New state: ' + str(self.fsa_currentState))
+									print('Reading events:')
+									self.fsa_currentEvent = self.fsa_getInputEventAt(self.fsa_logicalTime)
+									self.fsa_selectedTransition = self.weaved_model.getTransitionFrom(self.fsa_currentState, self.fsa_currentEvent, self.fsa_elapsed)
+									print(self.fsa_currentEvent)
+									print(self.fsa_selectedTransition)
+								]]>
+							</script>
+						</transition>
+						<transition target="../MicroStepProcessed" cond="False">
+							<script>
+								<![CDATA[
+									print('From FSA/MicroStepPrepared to MicroStepProcessed and attempting to take transition... ')
+									print('Transition to be taken: ' + str(self.fsa_selectedTransition))
+									self.fsa_currentState = self.fsa_selectedTransition.target
+									self.fsa_elapsed = 0
+									self.fsa_processEvent(self.fsa_currentEvent)
+									self.weaved_lib.dumpDiscreteEvent(self.weaved_model, self.fsa_logicalTime, self.fsa_currentState, self.fsa_selectedTransition)
+									self.weaved_lib.dumpGlobalState(self.weaved_model, self.weaved_global_state, self.fsa_logicalTime, self.fsa_currentState)
+									print('New state: ' + str(self.fsa_currentState))
+									print('Reading events:')
+									self.fsa_currentEvent = self.fsa_getInputEventAt(self.fsa_logicalTime)
+									self.fsa_selectedTransition = self.weaved_model.getTransitionFrom(self.fsa_currentState, self.fsa_currentEvent, self.fsa_elapsed)
+									print(self.fsa_currentEvent)
+									print(self.fsa_selectedTransition)
+								]]>
+							</script>
+						</transition>
+					</state>
+					<state id="ParentMicroStepProcessed">
+						<transition target="../MacroStepPrepared">
+							<script>
+								<![CDATA[
+									print('From ParentMicroStepProcessed to ParentPaused and resetting the child... ')
+									self.woven_child_initialized = False
+								]]>
+							</script>
+						</transition>
+					</state>
+				</state>
+				<state id="Terminated">
+					<transition target="../../HybridTerminated">
+						<script>
+							<![CDATA[
+								print('From FSA/Terminated to HybridTerminated... ')
+							]]>
+						</script>
+					</transition>
+				</state>
+			</state>
+			<state id="ParentStarted">
+				<transition target="../FSA/Initialized">
+					<script>
+						<![CDATA[
+							print('From ParentStarted to FSA/Initialized... ')
+							self.weaved_global_state = dict()
+							self.weaved_previous_global_state = dict()
+							self.woven_child_initialized = False
+						]]>
+					</script>
+				</transition>
+			</state>
+			<state id="HybridTerminated">
+			</state>
+		</scxml>
+	</class>
+</diagram>

BIN
debugging_fsa_cbd_composition/fsasimulator/fsasimulator_debugging.py.pdf