Przeglądaj źródła

Provided much more options for trace verifier

sampieters 1 rok temu
rodzic
commit
610ead5606
100 zmienionych plików z 14229 dodań i 100203 usunięć
  1. 2 1
      .gitignore
  2. 49 5
      README.md
  3. 0 0
      TraceVerifier/DEVSTesterUnit.py
  4. 36 21
      TraceComparison/TraceChecker.py
  5. 1 1
      TraceComparison/clear.py
  6. 34 24
      TraceComparison/process_tests.py
  7. 41 24414
      examples/BouncingBalls/PyDEVS/log.txt
  8. 3 1
      examples/BouncingBalls/Python/target.py
  9. 0 36
      examples/BouncingBalls/Python/test_runner.py
  10. 13570 68488
      examples/BouncingBalls/Python/trace.txt
  11. 0 117
      examples/BouncingBalls/Python/widget.py
  12. 3 1
      examples/BouncingBalls/sccd.xml
  13. 3 0
      tests/0) NarrowCastTest/config.json
  14. 0 12
      tests/4.0) NarrowCastTest/expected_trace.txt
  15. 0 0
      tests/0) NarrowCastTest/sccd.xml
  16. 0 0
      tests/1.0) EventlessTransitionTest/PyDEVS/faulty_log.txt
  17. 0 56
      tests/1.0) EventlessTransitionTest/PyDEVS/log.txt
  18. 0 110
      tests/1.0) EventlessTransitionTest/PyDEVS/target.py
  19. 0 0
      tests/1.0) EventlessTransitionTest/Python/faulty_log.txt
  20. 0 11
      tests/1.0) EventlessTransitionTest/Python/log.txt
  21. 0 87
      tests/1.0) EventlessTransitionTest/Python/target.py
  22. 0 3
      tests/1.1) AfterTransitionTest/PyDEVS/faulty_log.txt
  23. 0 76
      tests/1.1) AfterTransitionTest/PyDEVS/log.txt
  24. 0 118
      tests/1.1) AfterTransitionTest/PyDEVS/target.py
  25. 0 0
      tests/1.1) AfterTransitionTest/Python/faulty_log.txt
  26. 0 13
      tests/1.1) AfterTransitionTest/Python/log.txt
  27. 0 95
      tests/1.1) AfterTransitionTest/Python/target.py
  28. 0 24
      tests/1.10) ShallowHistoryTest/PyDEVS/faulty_log.txt
  29. 0 240
      tests/1.10) ShallowHistoryTest/PyDEVS/log.txt
  30. 0 229
      tests/1.10) ShallowHistoryTest/PyDEVS/target.py
  31. 0 24
      tests/1.10) ShallowHistoryTest/Python/faulty_log.txt
  32. 0 86
      tests/1.10) ShallowHistoryTest/Python/log.txt
  33. 0 203
      tests/1.10) ShallowHistoryTest/Python/target.py
  34. 0 29
      tests/1.11) DeepHistoryTest/PyDEVS/faulty_log.txt
  35. 0 275
      tests/1.11) DeepHistoryTest/PyDEVS/log.txt
  36. 0 233
      tests/1.11) DeepHistoryTest/PyDEVS/target.py
  37. 0 29
      tests/1.11) DeepHistoryTest/Python/faulty_log.txt
  38. 0 103
      tests/1.11) DeepHistoryTest/Python/log.txt
  39. 0 207
      tests/1.11) DeepHistoryTest/Python/target.py
  40. 0 3
      tests/1.2) GuardConditionTest/PyDEVS/faulty_log.txt
  41. 0 56
      tests/1.2) GuardConditionTest/PyDEVS/log.txt
  42. 0 122
      tests/1.2) GuardConditionTest/PyDEVS/target.py
  43. 0 3
      tests/1.2) GuardConditionTest/Python/faulty_log.txt
  44. 0 11
      tests/1.2) GuardConditionTest/Python/log.txt
  45. 0 99
      tests/1.2) GuardConditionTest/Python/target.py
  46. 0 6
      tests/1.3) TransitionToItselfTest/PyDEVS/faulty_log.txt
  47. 0 65
      tests/1.3) TransitionToItselfTest/PyDEVS/log.txt
  48. 0 121
      tests/1.3) TransitionToItselfTest/PyDEVS/target.py
  49. 0 6
      tests/1.3) TransitionToItselfTest/Python/faulty_log.txt
  50. 0 20
      tests/1.3) TransitionToItselfTest/Python/log.txt
  51. 0 98
      tests/1.3) TransitionToItselfTest/Python/target.py
  52. 0 9
      tests/1.4) ScriptTransitionTest/PyDEVS/faulty_log.txt
  53. 0 114
      tests/1.4) ScriptTransitionTest/PyDEVS/log.txt
  54. 0 125
      tests/1.4) ScriptTransitionTest/PyDEVS/target.py
  55. 0 9
      tests/1.4) ScriptTransitionTest/Python/faulty_log.txt
  56. 0 33
      tests/1.4) ScriptTransitionTest/Python/log.txt
  57. 0 102
      tests/1.4) ScriptTransitionTest/Python/target.py
  58. 0 6
      tests/1.5) ScriptEntryTest/PyDEVS/faulty_log.txt
  59. 0 65
      tests/1.5) ScriptEntryTest/PyDEVS/log.txt
  60. 0 121
      tests/1.5) ScriptEntryTest/PyDEVS/target.py
  61. 0 6
      tests/1.5) ScriptEntryTest/Python/faulty_log.txt
  62. 0 20
      tests/1.5) ScriptEntryTest/Python/log.txt
  63. 0 98
      tests/1.5) ScriptEntryTest/Python/target.py
  64. 0 18
      tests/1.6) ScriptExitTest/PyDEVS/faulty_log.txt
  65. 0 101
      tests/1.6) ScriptExitTest/PyDEVS/log.txt
  66. 0 121
      tests/1.6) ScriptExitTest/PyDEVS/target.py
  67. 0 18
      tests/1.6) ScriptExitTest/Python/faulty_log.txt
  68. 0 56
      tests/1.6) ScriptExitTest/Python/log.txt
  69. 0 98
      tests/1.6) ScriptExitTest/Python/target.py
  70. 0 7
      tests/1.7) CompositeStateTest/PyDEVS/faulty_log.txt
  71. 0 68
      tests/1.7) CompositeStateTest/PyDEVS/log.txt
  72. 0 129
      tests/1.7) CompositeStateTest/PyDEVS/target.py
  73. 0 7
      tests/1.7) CompositeStateTest/Python/faulty_log.txt
  74. 0 23
      tests/1.7) CompositeStateTest/Python/log.txt
  75. 0 106
      tests/1.7) CompositeStateTest/Python/target.py
  76. 0 7
      tests/1.8) ParallelStateTest/PyDEVS/faulty_log.txt
  77. 0 68
      tests/1.8) ParallelStateTest/PyDEVS/log.txt
  78. 0 150
      tests/1.8) ParallelStateTest/PyDEVS/target.py
  79. 0 7
      tests/1.8) ParallelStateTest/Python/faulty_log.txt
  80. 0 23
      tests/1.8) ParallelStateTest/Python/log.txt
  81. 0 127
      tests/1.8) ParallelStateTest/Python/target.py
  82. 0 43
      tests/10.0) TrafficLightTest/PyDEVS/faulty_log.txt
  83. 0 751
      tests/10.0) TrafficLightTest/PyDEVS/log.txt
  84. 0 409
      tests/10.0) TrafficLightTest/PyDEVS/target.py
  85. 0 43
      tests/10.0) TrafficLightTest/Python/faulty_log.txt
  86. 0 282
      tests/10.0) TrafficLightTest/Python/log.txt
  87. 0 381
      tests/10.0) TrafficLightTest/Python/target.py
  88. 4 0
      tests/10.1) BouncingBallsTest/input.txt
  89. 483 0
      tests/10.1) BouncingBallsTest/sccd.xml
  90. 0 3
      tests/2.0) GlobalInputTest/PyDEVS/faulty_log.txt
  91. 0 97
      tests/2.0) GlobalInputTest/PyDEVS/log.txt
  92. 0 110
      tests/2.0) GlobalInputTest/PyDEVS/target.py
  93. 0 3
      tests/2.0) GlobalInputTest/Python/faulty_log.txt
  94. 0 19
      tests/2.0) GlobalInputTest/Python/log.txt
  95. 0 84
      tests/2.0) GlobalInputTest/Python/target.py
  96. 0 0
      tests/2.1) GlobalOutputTest/PyDEVS/faulty_log.txt
  97. 0 50
      tests/2.1) GlobalOutputTest/PyDEVS/log.txt
  98. 0 104
      tests/2.1) GlobalOutputTest/PyDEVS/target.py
  99. 0 0
      tests/2.1) GlobalOutputTest/Python/faulty_log.txt
  100. 0 0
      tests/2.1) GlobalOutputTest/Python/log.txt

+ 2 - 1
.gitignore

@@ -1,4 +1,4 @@
-/tests/**/PyDEVS/
+/tests/**/ClassicDEVS/
 /tests/**/Python/
 
 # Byte-compiled / optimized Python files
@@ -8,6 +8,7 @@ __pycache__/
 *.pyd
 
 # Virtual environment
+.venv/
 venv/
 env/
 ENV/

+ 49 - 5
README.md

@@ -3,7 +3,7 @@ This project focuses on the conversion of SCCD XML files into a format compatibl
 
 In this thesis project, we explore the process of transforming SCCD XML files into pypDEVS models, enabling seamless integration of SCCD-based system descriptions into the PypDEVS simulation environment. By leveraging the capabilities of both SCCD and pypDEVS, we aim to facilitate the analysis and simulation of intricate systems, contributing to the advancement of modeling and simulation techniques in various domains.
 
-A small documentation for the project can be found here, providing insights into the conversion methodology, implementation details, and examples of utilizing the converted models within the PypDEVS framework. Through this work, we endeavor to bridge the gap between SCCD-based system specifications and the pypDEVS simulation paradigm, fostering greater flexibility and efficiency in system analysis and design processes.
+A small documentation for the project can be found here. For a more detailed explaination we refer to the paper published with this project.
 
 ## Compiler
 To compile a conforming SCCD XML file, the provided Python compiler can be used. The compiler can compile conforming SCCD models to two languages: Python and Javascript. Four platforms are supported:
@@ -14,7 +14,7 @@ To compile a conforming SCCD XML file, the provided Python compiler can be used.
 - classicdevs (**NEW**): Classical Hierarchical DEVS, for simulating in discrete time.
 
 The compiler can be used from the command line as follows:
-```
+```bash
 $python -m sccd.compiler.sccdc --help
 usage: python -m sccd.compiler.sccdc [-h] [-o OUTPUT] [-v VERBOSE]
                                      [-p PLATFORM] [-l LANGUAGE]
@@ -43,9 +43,37 @@ optional arguments:
 The ```classicdevs``` platform works only in the Python language. The platform works both with and without combination of a UI system that allows for scheduling events. Default implementations are provided for the Tkinter UI library on Python.
 
 ## Testing Framework
-To check if the translation approach from SCCD constructs to classical, hierarchical DEVS constructs is good. 
+To check if the translation approach from SCCD constructs to classical, hierarchical DEVS constructs is good, a testing framework is provided to check trace files of SCCD against the DEVS implementation of SCCD or a user created trace. This framework can be found in the ```TraceVerifier``` folder.
+
+### SCCD Tracer
+Before this could be done, a new tracer is proposed in this project which is loosely based on the PypDEVS tracer. The following events will be traced:
+
+- Statechart exit state
+- Statechart enter state
+- Statechart transition state
+- Global output events
+- Internal events (events sent to the object manager and private ports)
+
+Up untill this point only a verbose tracer is implemented, resulting in the traces to be printed either to the terminal or a provided text file. However, the tracer constructs are implmented in such a way that new tracers could be added by adding a new class to the tracer folder and inheriting from the base tracer.
+
+### Comparing traces
+To compare the traces between the SCCD and DEVS models, the ```tests``` folder can be used. This folder created several predefined tests which can be run by the following command:
+```bash
+python3 ./TraceVerifier/process_tests.py
+```
+If the user wants to create its own test, the user can create a new subfolder with a name. In this folder three things need to be present.
 
+- An SCCDXML file which provides the model that needs to be tested.
+- An expected trace file called ```expected_trace.txt``` which consists of traces in a chronological order the tracer of the model should output them.
+- (Optional) A ```config.json``` file which provides a configuration file for the test. Up to this point the file is a json with one parameter called ```trace``` and could be three options. These options could be used together.
+    - external: check global outputs of the model
+    - internal: check internal events of the model
+    - statechart: check statechart dynamics (exit state, enter state, and transition)
 
+For each test, the script will return a result in the terminal:
+- Passed: The test passed, meaning the trace of the model is the same as the expected trace.
+- Failed: The test failed, the trace of the model is different as the expected trace.
+- Warning: Either the expected trace or the output trace is empty.
 
 ## How to run?
 For an example to be run, two files need to be provided: A runner file (usually called ```runner.py```) which will provide the necessary logic to execute a model and a SSCDXML file (.xml extension) which defines the model. To properly run an example, the following needs to be done:
@@ -106,11 +134,11 @@ if __name__ == '__main__':
 
 Transmitting event becomes a lot more complex as the user should know the id of the private port over which he wants to send the event, if he know this he has to sent over the general port with a realtime interrupt but keep the port of the event the private port. For example, if the user wants to sent to the following private port:
 ```
-# TODO
+private_2_<test_port>
 ```
 The user needs to define the following realtime interrupt
 ```
-# TODO
+test_port Event(event name: an_event; port: private_2_<test_port>; parameters: [...])
 ```
 Of course a global input port can also be used. To simplify this, a new class is created which provides a wrapper around the simulator class of PypDEVS to automatically. A modeller needs to add the following to the runner file:
 ```python
@@ -133,6 +161,21 @@ Further all platforms provides in the PypDEVS package can be used to execute the
 The ```TrafficLight``` example is one of the most simple examples. This example illustrates the dynamics of the statechart in a SCCD class. The example defines one SCCD class with a corresponding statechart
 
 ### Timer
+There are 3 different ```Timer``` examples. These 3 examples do the same thing, printing the simulated and actual clock time when the model is running. This allows the modeller to check that both times do not grow away from each other. This means that the simulated time is closely realted to the actual clock time meaning the simulated time is corrrectly implemented.  
+
+The ```TimerThread``` example implements a runner to print the times to the terminal. The runner also provides a user to input raw text into the terminal. If the user types:
+```
+interrupt
+```
+Both clocks will halt. If the user enters the following:
+```
+continue
+```
+Both timers will start again from the time it was stopped. 
+
+The ```TimerEventloop``` example does the same as the ```TimerThread``` example but with a Tkinter UI. The raw input is replaced by a button called ```continue/interrupt``` which will start and stop the timers.
+
+The ```TimerParallel``` leverages the use of a parallel state. Both timers are run in a unique component of the parrallel state. This is to test if the parallel state executes it components in an ewually timed manner.
 
 ### BouncingBalls
 The ```BouncingBalls``` example used Tkinter to simulate the behaviour of balls bouncing around in a window. A user can create a ball in the window by right clicking in the window field. The ball will be given a random velocity on the clicked position and will never leave the confines of the window. This creation of a ball illustrates the dynamic creation of SCCD classes and their corresponding statechart.
@@ -142,6 +185,7 @@ To further illustrate this, a button on the bottom of the window can be clicked
 A window can also be deleted by clicking on the close window button on the top right of the screen. Visualizing the dynamic deletion of the earlier created SCCD classes.
 
 ### BouncingBallsCollision
+```BouncingBallsCollision``` is an extension on the ```BouncingBalls```example where the balls will collide and change velocity when a collision occurs. This provides yet another example of the dynamic creation and deletion of classes only in a faster way. Each time a collision occurs, a new object of class ```CollisionPhysics```is created, this object calculates the new velocities, sent it back to the colliding objects, and delete the ```CollisionPhysics```object.
 
 ### ElevatorBalls
 

TraceComparison/DEVSTesterUnit.py → TraceVerifier/DEVSTesterUnit.py


+ 36 - 21
TraceComparison/TraceChecker.py

@@ -3,7 +3,7 @@ import subprocess
 import importlib.util
 import re
 from sccd.runtime.DEVSSimulatorWrapper import DEVSSimulator
-import TraceComparison.DEVSTesterUnit as DEVSTesterUnit
+import TraceVerifier.DEVSTesterUnit as DEVSTesterUnit
 from sccd.runtime.DEVS_statecharts_core import Event
 
 def import_target_module(module_name, file_path):
@@ -22,6 +22,7 @@ def extract_pattern(log_file_path, pattern):
 def parse_event(line):
     # Regular expression to match the desired parts of the line
     pattern = re.compile(r'\(event name: (.*?); port: (.*?); parameters: (.*?)\)$')
+
     match = pattern.match(line)
     if match:
         event_name = match.group(1)
@@ -59,7 +60,7 @@ class PythonSCCDTraceChecker(SCCDTraceChecker):
         """
         Convert sccd.xml to target.py for the specified tool.
         """
-        sccd_file = os.path.join(self.directory, 'sccd.xml')
+        sccd_file = os.path.join(self.directory, self.config['model'])
         output_file = os.path.join(self.directory, 'Python', 'target.py')
 
         os.makedirs(os.path.join(self.directory, 'Python'), exist_ok=True)
@@ -89,7 +90,7 @@ class PythonSCCDTraceChecker(SCCDTraceChecker):
         controller.keep_running = False
 
         # Check if there is an input file
-        input_file = os.path.join(self.directory, "input.txt")
+        input_file = os.path.join(self.directory, self.config["input"])
         if os.path.exists(input_file):
             # add the inputs before the simulation is started  
             with open(input_file, 'r') as file:
@@ -106,7 +107,7 @@ class PythonSCCDTraceChecker(SCCDTraceChecker):
                 event_part = event[space_pos + 1:].strip()  # Strip to remove any leading/trailing whitespace
 
                 name, port, parameters = parse_event(event_part)
-                # list is as string, convert it to actaul list
+                # list is as string, convert it to actual list
                 parameters = eval(parameters)
 
                 actual_event = Event(name, port, parameters)
@@ -137,6 +138,9 @@ class PythonSCCDTraceChecker(SCCDTraceChecker):
     def extract_internalio(self, line, context):
         event_pattern = re.compile(r'^\s*\\Event: \(event name:.*\)$')
         event_match = event_pattern.match(line)
+
+        if "test_narrow" in line:
+            pass
         if event_match and context["context"] is not None:
             if context["context"] == "internal input" or context["context"] == "internal output":
                 event = line.strip()
@@ -291,7 +295,7 @@ class PythonSCCDTraceChecker(SCCDTraceChecker):
     def check(self):
         log = os.path.join(self.directory, "Python", "log.txt")
 
-        expected_log = os.path.join(self.directory, "expected_trace.txt")
+        expected_log = os.path.join(self.directory, self.config["check_file"])
 
         expected_events = []
 
@@ -324,16 +328,16 @@ class ClassicDevsSCCDTraceChecker(SCCDTraceChecker):
         super().__init__()
 
     def __str__(self):
-        return "PyDEVS"
+        return "ClassicDEVS"
     
     def compile(self):
         """
         Convert sccd.xml to target.py.
         """
-        sccd_file = os.path.join(self.directory, 'sccd.xml')
-        output_file = os.path.join(self.directory, "PyDEVS", 'target.py')
+        sccd_file = os.path.join(self.directory, self.config["model"])
+        output_file = os.path.join(self.directory, "ClassicDEVS", 'target.py')
 
-        os.makedirs(os.path.join(self.directory, "PyDEVS"), exist_ok=True)
+        os.makedirs(os.path.join(self.directory, "ClassicDEVS"), exist_ok=True)
 
         command = [
             "python", 
@@ -346,16 +350,16 @@ class ClassicDevsSCCDTraceChecker(SCCDTraceChecker):
         env = os.environ.copy()
         result = subprocess.run(command, env=env, capture_output=True, text=True)
         if result.returncode != 0:
-            print(f"Error converting {sccd_file} for PyDEVS: {result.stderr}")
+            print(f"Error converting {sccd_file} for ClassicDEVS: {result.stderr}")
         return result.returncode
 
     def run(self):
         # Dynamically import the target module
-        pydevs_target = os.path.join(self.directory, "PyDEVS", "target.py")
+        pydevs_target = os.path.join(self.directory, "ClassicDEVS", "target.py")
         target = import_target_module("target", pydevs_target)
 
         # Check if there is an input file
-        input_file = os.path.join(self.directory, "input.txt")
+        input_file = os.path.join(self.directory, self.config["input"])
         if not os.path.exists(input_file):
             input_file = None
 
@@ -383,7 +387,7 @@ class ClassicDevsSCCDTraceChecker(SCCDTraceChecker):
         sim.setRealTime(False)
         
         # Create the full path for the log file
-        log_file_path = os.path.join(self.directory, "PyDEVS", "log.txt")
+        log_file_path = os.path.join(self.directory, "ClassicDEVS", "log.txt")
         # Set verbose to the log file path
         sim.setVerbose(log_file_path)
         sim.setClassicDEVS()
@@ -400,6 +404,8 @@ class ClassicDevsSCCDTraceChecker(SCCDTraceChecker):
         return None
         
     def extract_internalio(self, line, context):
+        if "private_2_<narrow_cast>" in line:
+            pass
         if (context["extra_info"] == "obj_manager_out" and context['transition_type'] == 'internal'):
             # Pattern to match the outermost '(event name: ...)' including a single nested '(event name: ...)'
             event_pattern = re.compile(r'\(event name:.*?(?:\(event name:.*?\))?.*?\)')
@@ -412,13 +418,22 @@ class ClassicDevsSCCDTraceChecker(SCCDTraceChecker):
                 return f"{context["time"]:.2f} {event}"
             
         elif (context["extra_info"] == "obj_manager_in" and context['transition_type'] == 'external') and ("<narrow_cast>" in line):
-            event_pattern = re.compile(r'\(event name:.*\)$')
+            #event_pattern = re.compile(r'\(event name:.*\)$')
             event_pattern = r'\(event name.*?\)'
-            event_match = re.search(event_pattern, line)
 
-            if event_match and context["time"] is not None:
-                event = event_match.group(0)
-                return f"{context["time"]:.2f} {event}"
+            event_matches = re.findall(event_pattern, line)
+
+            if event_matches and context["time"] is not None:
+                if len(event_matches) > 1:
+                    pass
+                # Get the last match
+                event = event_matches[-1]
+                return f"{context['time']:.2f} {event}"
+            #event_match = re.search(event_pattern, line)
+
+            #if event_match and context["time"] is not None:
+            #    event = event_match.group(0)
+            #    return f"{context["time"]:.2f} {event}"
         return None
 
     def extract_statechart(self, line, context):
@@ -526,8 +541,8 @@ class ClassicDevsSCCDTraceChecker(SCCDTraceChecker):
         return output_events
 
     def check(self):
-        log = os.path.join(self.directory, "PyDEVS", "log.txt")
-        expected_log = os.path.join(self.directory, "expected_trace.txt")
+        log = os.path.join(self.directory, "ClassicDEVS", "log.txt")
+        expected_log = os.path.join(self.directory, self.config["check_file"])
 
         expected_events = []
         if os.path.exists(expected_log):
@@ -549,7 +564,7 @@ class ClassicDevsSCCDTraceChecker(SCCDTraceChecker):
 
         if return_code == 0:
             # Write actual events to a file
-            with open(os.path.join(self.directory, "PyDEVS", "faulty_log.txt"), 'w') as file:
+            with open(os.path.join(self.directory, "ClassicDEVS", "faulty_log.txt"), 'w') as file:
                 file.writelines([event + '\n' for event in actual_events])
 
         return return_code

+ 1 - 1
TraceComparison/clear.py

@@ -11,7 +11,7 @@ for folder_name in os.listdir(parent_directory):
     # Check if the path is a directory and not a file
     if os.path.isdir(folder_path):
         # Delete PyDEVS folder if it exists
-        pydevs_path = os.path.join(folder_path, 'PyDEVS')
+        pydevs_path = os.path.join(folder_path, 'ClassicDEVS')
         if os.path.exists(pydevs_path):
             shutil.rmtree(pydevs_path)
             print(f"Deleted {pydevs_path}")

+ 34 - 24
TraceComparison/process_tests.py

@@ -27,12 +27,16 @@ if __name__ == '__main__':
     tests_directory = "./tests"
 
     default_config = {
-        "trace": "external"
+        "model": "sccd.xml",
+        "input": "input.txt",
+        "trace": "external",
+        "platforms": ["Python", "ClassicDEVS"],
+        "check_file": "expected_trace.txt"
     }
 
     checkers = {
         "Python": TraceChecker.PythonSCCDTraceChecker(),
-        "Pydevs": TraceChecker.ClassicDevsSCCDTraceChecker()
+        "ClassicDEVS": TraceChecker.ClassicDevsSCCDTraceChecker()
     }
 
     sorted_dirs = sort_directories(tests_directory)
@@ -42,30 +46,36 @@ if __name__ == '__main__':
         full_directory = os.path.join(tests_directory, directory_name)
         if os.path.isdir(full_directory):
             print(f"Processing {directory_name}...")
-            for checker_name, checker in checkers.items():
-                # Path to your JSON file
-                config_file = os.path.join(full_directory, 'config.json')
-                # Open and read the JSON file
-                if os.path.exists(config_file):
-                    with open(config_file, 'r') as file:
-                        config_data = json.load(file)
-                else:
-                    config_data = default_config
 
-                checker.directory = full_directory
-                checker.config = config_data
+            # Path to your JSON file
+            config_file = os.path.join(full_directory, 'config.json')
+            # Open and read the JSON file
+            if os.path.exists(config_file):
+                with open(config_file, 'r') as file:
+                    config_data = json.load(file)
+
+                    # Update the defined dict with any key from the default dict that is not already in the user defined dict
+                    for key, value in default_config.items():
+                        if key not in config_data:
+                            config_data[key] = value
+            else:
+                config_data = default_config
+            for checker_name, checker in checkers.items():
+                if checker_name in config_data['platforms']:
+                    checker.directory = full_directory
+                    checker.config = config_data
 
-                checker.compile()
-                checker.run()
-                result = checker.check()
-                
-                results[checker_name].append(result)
-                if result == 0:
-                    print(f"{checker_name}: ", RED + "Failed" + ENDC)
-                elif result == 1:
-                    print(f"{checker_name}: ", GREEN + "Passed" + ENDC)
-                else:
-                    print(f"{checker_name}: ", YELLOW + "Need more detailed testing" + ENDC)
+                    checker.compile()
+                    checker.run()
+                    result = checker.check()
+                    
+                    results[checker_name].append(result)
+                    if result == 0:
+                        print(f"{checker_name}: ", RED + "Failed" + ENDC)
+                    elif result == 1:
+                        print(f"{checker_name}: ", GREEN + "Passed" + ENDC)
+                    else:
+                        print(f"{checker_name}: ", YELLOW + "Need more detailed testing" + ENDC)
 
     # Print summary
     print("\nTest Summary:")

Plik diff jest za duży
+ 41 - 24414
examples/BouncingBalls/PyDEVS/log.txt


+ 3 - 1
examples/BouncingBalls/Python/target.py

@@ -557,7 +557,9 @@ class Ball(RuntimeClassBase):
     def user_defined_constructor(self, canvas_id, x, y):
         self.canvas_id = canvas_id;
         self.r = 20.0;
-        self.vel = {'x': random.uniform(-5.0, 5.0), 'y': random.uniform(-5.0, 5.0)};
+        
+        self.vel = {'x': 1, 'y': 1};
+        #self.vel = {'x': random.uniform(-5.0, 5.0), 'y': random.uniform(-5.0, 5.0)};
         self.pos = {'x': x, 'y': y};
         self.smooth = 0.6; # value between 0 and 1
     

+ 0 - 36
examples/BouncingBalls/Python/test_runner.py

@@ -1,36 +0,0 @@
-'''
-Created on 27-jul.-2014
-
-@author: Simon
-'''
-import tkinter as tk
-import target as target
-from sccd.runtime.libs.ui_v2 import UI
-from sccd.runtime.tkinter_eventloop import TkEventLoop
-import time
-
-class OutputListener:
-	def __init__(self, controller, ui, log_file):
-		self.ui = ui
-		self.controller = controller
-		self.log_file = log_file
-
-	def add(self, event):
-		with open(self.log_file, 'a') as file:
-			file.write(f'{self.controller.getSimulatedTime()/1000} {event}\n')
-		if event.port == "ui":
-			method = getattr(self.ui, event.name)
-			method(*event.parameters)
-
-
-if __name__ == '__main__':
-	tkroot = tk.Tk()
-	tkroot.withdraw()
-	controller = target.Controller(TkEventLoop(tkroot))
-	ui = UI(tkroot, controller)
-	controller.addMyOwnOutputListener(OutputListener(controller, ui, "./examples/BouncingBalls/Python/output.txt"))
-
-	controller.setVerbose("./examples/BouncingBalls/Python/trace.txt")
-
-	controller.start()
-	tkroot.mainloop()

Plik diff jest za duży
+ 13570 - 68488
examples/BouncingBalls/Python/trace.txt


+ 0 - 117
examples/BouncingBalls/Python/widget.py

@@ -1,117 +0,0 @@
-import tkinter as tk
-from sccd.runtime.statecharts_core import Event
-
-class Widget:
-	controller = None
-
-	def __init__(self, configure_later=False):
-		if not configure_later:
-			self.set_bindable_and_tagorid(None, None)
-
-	def set_bindable_and_tagorid(self, bindable=None, tagorid=None):
-		if bindable is None:
-			bindable = self
-		self.bindable = bindable
-		self.mytagorid = tagorid
-		if isinstance(self, tk.Toplevel):
-			self.protocol("WM_DELETE_WINDOW", self.window_close)
-		if tagorid is not None:
-			if not isinstance(tagorid, list):
-				tagorid = [tagorid]
-			for t in tagorid:
-				self.bindable.tag_bind(t, "<Button>", self.on_click)
-				self.bindable.tag_bind(t, "<ButtonRelease>", self.on_release)
-				self.bindable.tag_bind(t, "<Motion>", self.on_motion)
-				self.bindable.tag_bind(t, "<Enter>", self.on_enter)
-				self.bindable.tag_bind(t, "<Leave>", self.on_leave)
-				self.bindable.tag_bind(t, "<Key>", self.on_key)
-				self.bindable.tag_bind(t, "<KeyRelease>", self.on_key_release)
-		else:
-			self.bindable.bind("<Button>", self.on_click)
-			self.bindable.bind("<ButtonRelease>", self.on_release)
-			self.bindable.bind("<Motion>", self.on_motion)
-			self.bindable.bind("<Enter>", self.on_enter)
-			self.bindable.bind("<Leave>", self.on_leave)
-			self.bindable.bind("<Key>", self.on_key)
-			self.bindable.bind("<KeyRelease>", self.on_key_release)
-		self.last_x = 50
-		self.last_y = 50
-		self.selected_type = None
-
-	def on_click(self, event):
-		event_name = None
-
-		if event.num == 1:
-			event_name = "left-click"
-		elif event.num == 2:
-			event_name = "middle-click"
-		elif event.num == 3:
-			event_name = "right-click"
-
-		if event_name:
-			self.last_x = event.x
-			self.last_y = event.y
-			Widget.controller.addInput(Event(event_name, "input", [id(self)]))
-
-	def on_release(self, event):
-		event_name = None
-
-		if event.num == 1:
-			event_name = "left-release"
-		elif event.num == 2:
-			event_name = "middle-release"
-		elif event.num == 3:
-			event_name = "right-release"
-
-		if event_name:
-			self.last_x = event.x
-			self.last_y = event.y
-			Widget.controller.addInput(Event(event_name, "input", [id(self)]))
-
-	def on_motion(self, event):
-		self.last_x = event.x
-		self.last_y = event.y
-		Widget.controller.addInput(Event("motion", "input", [id(self)]))
-
-	def on_enter(self, event):
-		Widget.controller.addInput(Event("enter", "input", [id(self)]))
-
-	def on_leave(self, event):
-		Widget.controller.addInput(Event("leave", "input", [id(self)]))
-
-	def on_key(self, event):
-		event_name = None
-
-		if event.keysym == 'Escape':
-			event_name = "escape"
-		elif event.keysym == 'Return':
-			event_name = "return"
-		elif event.keysym == 'Delete':
-			event_name = "delete"
-		elif event.keysym == 'Shift_L':
-			event_name = "shift"
-		elif event.keysym == 'Control_L':
-			event_name = "control"
-
-		if event_name:
-			Widget.controller.addInput(Event(event_name, "input", [id(self)]))
-
-	def on_key_release(self, event):
-		event_name = None
-
-		if event.keysym == 'Escape':
-			event_name = "escape-release"
-		elif event.keysym == 'Return':
-			event_name = "return-release"
-		elif event.keysym == 'Delete':
-			event_name = "delete-release"
-		elif event.keysym == 'Shift_L':
-			event_name = "shift-release"
-		elif event.keysym == 'Control_L':
-			event_name = "control-release"
-
-		if event_name:
-			Widget.controller.addInput(Event(event_name, "input", [id(self)]))
-
-	def window_close(self):
-		Widget.controller.addInput(Event("window-close", "input", [id(self)]))

+ 3 - 1
examples/BouncingBalls/sccd.xml

@@ -330,7 +330,9 @@
             <body>
                 self.canvas_id = canvas_id;
                 self.r = 20.0;
-                self.vel = {'x': random.uniform(-5.0, 5.0), 'y': random.uniform(-5.0, 5.0)};
+
+                self.vel = {'x': 1, 'y': 1};
+                #self.vel = {'x': random.uniform(-5.0, 5.0), 'y': random.uniform(-5.0, 5.0)};
                 self.pos = {'x': x, 'y': y};
                 self.smooth = 0.6; # value between 0 and 1
             </body>

+ 3 - 0
tests/0) NarrowCastTest/config.json

@@ -0,0 +1,3 @@
+{
+    "trace": ["internal"]
+}

+ 0 - 12
tests/4.0) NarrowCastTest/expected_trace.txt

@@ -1,26 +1,14 @@
 0.00 (event name: create_instance; port: None; parameters: [0, 'linkA', 'A'])
 0.00 (event name: instance_created; port: None; parameters: ['linkA[0]'])
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state2)
-0.00 MainApp: enter /state2
 0.00 (event name: start_instance; port: None; parameters: [0, 'linkA[0]'])
 0.00 (event name: create_instance; port: None; parameters: [0, 'linkA', 'A'])
 0.00 (event name: instance_started; port: None; parameters: ['linkA[0]'])
 0.00 (event name: instance_created; port: None; parameters: ['linkA[1]'])
-0.00 MainApp: exit /state2
-0.00 MainApp: transition (/state2 -> /state3)
-0.00 MainApp: enter /state3
 0.00 (event name: start_instance; port: None; parameters: [0, 'linkA[1]'])
 0.00 (event name: create_instance; port: None; parameters: [0, 'linkA', 'A'])
 0.00 (event name: instance_started; port: None; parameters: ['linkA[1]'])
 0.00 (event name: instance_created; port: None; parameters: ['linkA[2]'])
-0.00 MainApp: exit /state3
-0.00 MainApp: transition (/state3 -> /state4)
-0.00 MainApp: enter /state4
 0.00 (event name: start_instance; port: None; parameters: [0, 'linkA[2]'])
 0.00 (event name: narrow_cast; port: None; parameters: [0, 'linkA[1]', (event name: test_narrow; port: None)])
 0.00 (event name: instance_started; port: None; parameters: ['linkA[2]'])
 0.00 (event name: test_narrow; port: private_2_<narrow_cast>)
-0.00 A: exit /state1
-0.00 A: transition (/state1 -> /state1)
-0.00 A: enter /state1

tests/4.0) NarrowCastTest/sccd.xml → tests/0) NarrowCastTest/sccd.xml


+ 0 - 0
tests/1.0) EventlessTransitionTest/PyDEVS/faulty_log.txt


+ 0 - 56
tests/1.0) EventlessTransitionTest/PyDEVS/log.txt

@@ -1,56 +0,0 @@
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INITIAL CONDITIONS in model <Controller.MainApp>
-		Initial State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INITIAL CONDITIONS in model <Controller.ObjectManager>
-		Initial State: <sccd.runtime.DEVS_statecharts_core.ObjectManagerState object at 0x104a6fa40>
-		Next scheduled internal transition at time inf
-
-
-	INITIAL CONDITIONS in model <Controller.Tester>
-		Initial State: None
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state3)
-
-			ENTER STATE in model <MainApp>
-			State: State(3) (name: /state3)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-		Next scheduled internal transition at time inf
-

+ 0 - 110
tests/1.0) EventlessTransitionTest/PyDEVS/target.py

@@ -1,110 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration) and Sam Pieters (DEVS)
-
-Model author: Sam Pieters
-Model name:   EventlessTransitionTest
-Model description:
-Test 1: Check if a statechart directly transitions without an event being raised.
-"""
-
-from sccd.runtime.DEVS_statecharts_core import *
-
-# package "EventlessTransitionTest"
-
-class MainAppInstance(RuntimeClassBase):
-    def __init__(self, atomdevs, id, start_port_id):
-        RuntimeClassBase.__init__(self, atomdevs, id)
-        
-        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()
-        
-        # call user defined constructor
-        MainAppInstance.user_defined_constructor(self)
-        port_name = addInputPort("<narrow_cast>", start_port_id)
-        atomdevs.state.port_mappings[port_name] = id
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        
-        # state /state2
-        self.states["/state2"] = State(2, "/state2", self)
-        
-        # state /state3
-        self.states["/state3"] = State(3, "/state3", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states[""].addChild(self.states["/state3"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/state3"]])
-        _state1_0.setTrigger(None)
-        self.states["/state1"].addTransition(_state1_0)
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class MainApp(ClassBase):
-    def __init__(self, name):
-        ClassBase.__init__(self, name)
-        self.input = self.addInPort("input")
-        new_instance = self.constructObject(0, 0, [])
-        self.state.instances[new_instance.instance_id] = new_instance
-        new_instance.start()
-        self.state.next_time = 0
-    
-    def constructObject(self, id, start_port_id, parameters):
-        new_instance = MainAppInstance(self, id, start_port_id)
-        return new_instance
-
-def instantiate(self, class_name, construct_params):
-    instance = {}
-    instance["name"] = class_name
-    if class_name == "MainApp":
-        self.narrow_cast_id = self.narrow_cast_id + 0
-        instance["associations"] = {}
-    else:
-        raise Exception("Cannot instantiate class " + class_name)
-    return instance
-ObjectManagerState.instantiate = instantiate
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
-        self.state = ObjectManagerState()
-        self.input = self.addInPort("input")
-        self.output["MainApp"] = self.addOutPort()
-        self.state.createInstance("MainApp", [])
-
-class Controller(CoupledDEVS):
-    def __init__(self, name):
-        CoupledDEVS.__init__(self, name)
-        self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomics = []
-        self.atomics.append(self.addSubModel(MainApp("MainApp")))
-        self.connectPorts(self.atomics[0].obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomics[0].obj_manager_in)

+ 0 - 0
tests/1.0) EventlessTransitionTest/Python/faulty_log.txt


+ 0 - 11
tests/1.0) EventlessTransitionTest/Python/log.txt

@@ -1,11 +0,0 @@
-__  Current Time:   0.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state3)
-
-ENTER STATE in model <MainApp>
-		State: /state3
-

+ 0 - 87
tests/1.0) EventlessTransitionTest/Python/target.py

@@ -1,87 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Model author: Sam Pieters
-Model name:   EventlessTransitionTest
-Model description:
-Test 1: Check if a statechart directly transitions without an event being raised.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "EventlessTransitionTest"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        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()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        
-        # state /state2
-        self.states["/state2"] = State(2, "/state2", self)
-        
-        # state /state3
-        self.states["/state3"] = State(3, "/state3", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states[""].addChild(self.states["/state3"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/state3"]])
-        _state1_0.setTrigger(None)
-        self.states["/state1"].addTransition(_state1_0)
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].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 == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, 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("MainApp", [])

+ 0 - 3
tests/1.1) AfterTransitionTest/PyDEVS/faulty_log.txt

@@ -1,3 +0,0 @@
-1.00 MainApp: exit /state1
-1.00 MainApp: transition (/state1 -> /state3)
-1.00 MainApp: enter /state3

+ 0 - 76
tests/1.1) AfterTransitionTest/PyDEVS/log.txt

@@ -1,76 +0,0 @@
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INITIAL CONDITIONS in model <Controller.MainApp>
-		Initial State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INITIAL CONDITIONS in model <Controller.ObjectManager>
-		Initial State: <sccd.runtime.DEVS_statecharts_core.ObjectManagerState object at 0x104a69bb0>
-		Next scheduled internal transition at time inf
-
-
-	INITIAL CONDITIONS in model <Controller.Tester>
-		Initial State: None
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 1.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   1.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state3)
-
-			ENTER STATE in model <MainApp>
-			State: State(3) (name: /state3)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 1.000000
-
-
-__  Current Time:   1.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time inf
-

+ 0 - 118
tests/1.1) AfterTransitionTest/PyDEVS/target.py

@@ -1,118 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration) and Sam Pieters (DEVS)
-
-Model author: Sam Pieters
-Model name:   AfterTransitionTest
-Model description:
-Test 2: Check if a statechart transitions after a certain time.
-"""
-
-from sccd.runtime.DEVS_statecharts_core import *
-
-# package "AfterTransitionTest"
-
-class MainAppInstance(RuntimeClassBase):
-    def __init__(self, atomdevs, id, start_port_id):
-        RuntimeClassBase.__init__(self, atomdevs, id)
-        
-        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()
-        
-        # call user defined constructor
-        MainAppInstance.user_defined_constructor(self)
-        port_name = addInputPort("<narrow_cast>", start_port_id)
-        atomdevs.state.port_mappings[port_name] = id
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        self.states["/state1"].setEnter(self._state1_enter)
-        self.states["/state1"].setExit(self._state1_exit)
-        
-        # state /state2
-        self.states["/state2"] = State(2, "/state2", self)
-        
-        # state /state3
-        self.states["/state3"] = State(3, "/state3", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states[""].addChild(self.states["/state3"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/state3"]])
-        _state1_0.setTrigger(Event("_0after"))
-        self.states["/state1"].addTransition(_state1_0)
-    
-    def _state1_enter(self):
-        self.addTimer(0, 1)
-    
-    def _state1_exit(self):
-        self.removeTimer(0)
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class MainApp(ClassBase):
-    def __init__(self, name):
-        ClassBase.__init__(self, name)
-        self.input = self.addInPort("input")
-        new_instance = self.constructObject(0, 0, [])
-        self.state.instances[new_instance.instance_id] = new_instance
-        new_instance.start()
-        self.state.next_time = 0
-    
-    def constructObject(self, id, start_port_id, parameters):
-        new_instance = MainAppInstance(self, id, start_port_id)
-        return new_instance
-
-def instantiate(self, class_name, construct_params):
-    instance = {}
-    instance["name"] = class_name
-    if class_name == "MainApp":
-        self.narrow_cast_id = self.narrow_cast_id + 0
-        instance["associations"] = {}
-    else:
-        raise Exception("Cannot instantiate class " + class_name)
-    return instance
-ObjectManagerState.instantiate = instantiate
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
-        self.state = ObjectManagerState()
-        self.input = self.addInPort("input")
-        self.output["MainApp"] = self.addOutPort()
-        self.state.createInstance("MainApp", [])
-
-class Controller(CoupledDEVS):
-    def __init__(self, name):
-        CoupledDEVS.__init__(self, name)
-        self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomics = []
-        self.atomics.append(self.addSubModel(MainApp("MainApp")))
-        self.connectPorts(self.atomics[0].obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomics[0].obj_manager_in)

+ 0 - 0
tests/1.1) AfterTransitionTest/Python/faulty_log.txt


+ 0 - 13
tests/1.1) AfterTransitionTest/Python/log.txt

@@ -1,13 +0,0 @@
-__  Current Time:   0.000000 __________________________________________ 
-
-__  Current Time:   1.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state3)
-
-ENTER STATE in model <MainApp>
-		State: /state3
-

+ 0 - 95
tests/1.1) AfterTransitionTest/Python/target.py

@@ -1,95 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Model author: Sam Pieters
-Model name:   AfterTransitionTest
-Model description:
-Test 2: Check if a statechart transitions after a certain time.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "AfterTransitionTest"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        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()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        self.states["/state1"].setEnter(self._state1_enter)
-        self.states["/state1"].setExit(self._state1_exit)
-        
-        # state /state2
-        self.states["/state2"] = State(2, "/state2", self)
-        
-        # state /state3
-        self.states["/state3"] = State(3, "/state3", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states[""].addChild(self.states["/state3"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/state3"]])
-        _state1_0.setTrigger(Event("_0after"))
-        self.states["/state1"].addTransition(_state1_0)
-    
-    def _state1_enter(self):
-        self.addTimer(0, 1)
-    
-    def _state1_exit(self):
-        self.removeTimer(0)
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].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 == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, 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("MainApp", [])

+ 0 - 24
tests/1.10) ShallowHistoryTest/PyDEVS/faulty_log.txt

@@ -1,24 +0,0 @@
-3.00 MainApp: exit /on/normal/red
-3.00 MainApp: transition (/on/normal/red -> /on/normal/green)
-3.00 MainApp: enter /on/normal/green
-3.50 MainApp: exit /on/normal/green
-3.50 MainApp: exit /on/normal
-3.50 MainApp: transition (/on/normal -> /on/interrupted)
-3.50 MainApp: enter /on/interrupted
-3.50 MainApp: enter /on/interrupted/yellow
-4.00 MainApp: exit /on/interrupted/yellow
-4.00 MainApp: transition (/on/interrupted/yellow -> /on/interrupted/black)
-4.00 MainApp: enter /on/interrupted/black
-4.50 MainApp: exit /on/interrupted/black
-4.50 MainApp: exit /on/interrupted
-4.50 MainApp: transition (/on/interrupted -> /on/normal/history)
-4.50 MainApp: enter /on/normal
-4.50 MainApp: enter /on/normal/green
-6.50 MainApp: exit /on/normal/green
-6.50 MainApp: transition (/on/normal/green -> /on/normal/yellow)
-6.50 MainApp: enter /on/normal/yellow
-7.50 MainApp: exit /on/normal/yellow
-7.50 MainApp: exit /on/normal
-7.50 MainApp: exit /on
-7.50 MainApp: transition (/on/normal/yellow -> /off)
-7.50 MainApp: enter /off

+ 0 - 240
tests/1.10) ShallowHistoryTest/PyDEVS/log.txt

@@ -1,240 +0,0 @@
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INITIAL CONDITIONS in model <Controller.MainApp>
-		Initial State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INITIAL CONDITIONS in model <Controller.ObjectManager>
-		Initial State: <sccd.runtime.DEVS_statecharts_core.ObjectManagerState object at 0x104aba900>
-		Next scheduled internal transition at time inf
-
-
-	INITIAL CONDITIONS in model <Controller.Tester>
-		Initial State: None
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 3.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-			port <Test_ui>:
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   3.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(3) (name: /on/normal/red)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on/normal/red -> /on/normal/green)
-
-			ENTER STATE in model <MainApp>
-			State: State(4) (name: /on/normal/green)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 3.000000
-
-
-__  Current Time:   3.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 3.500000
-
-
-__  Current Time:   3.500000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(4) (name: /on/normal/green)
-
-			EXIT STATE in model <MainApp>
-			State: State(2) (name: /on/normal)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on/normal -> /on/interrupted)
-
-			ENTER STATE in model <MainApp>
-			State: State(7) (name: /on/interrupted)
-
-			ENTER STATE in model <MainApp>
-			State: State(8) (name: /on/interrupted/yellow)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 3.500000
-
-
-__  Current Time:   3.500000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 4.000000
-
-
-__  Current Time:   4.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(8) (name: /on/interrupted/yellow)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on/interrupted/yellow -> /on/interrupted/black)
-
-			ENTER STATE in model <MainApp>
-			State: State(9) (name: /on/interrupted/black)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 4.000000
-
-
-__  Current Time:   4.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 4.500000
-
-
-__  Current Time:   4.500000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(9) (name: /on/interrupted/black)
-
-			EXIT STATE in model <MainApp>
-			State: State(7) (name: /on/interrupted)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on/interrupted -> /on/normal/history)
-
-			ENTER STATE in model <MainApp>
-			State: State(2) (name: /on/normal)
-
-			ENTER STATE in model <MainApp>
-			State: State(4) (name: /on/normal/green)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 4.500000
-
-
-__  Current Time:   4.500000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 6.500000
-
-
-__  Current Time:   6.500000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(4) (name: /on/normal/green)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on/normal/green -> /on/normal/yellow)
-
-			ENTER STATE in model <MainApp>
-			State: State(5) (name: /on/normal/yellow)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 6.500000
-
-
-__  Current Time:   6.500000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 7.500000
-
-
-__  Current Time:   7.500000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(5) (name: /on/normal/yellow)
-
-			EXIT STATE in model <MainApp>
-			State: State(2) (name: /on/normal)
-
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /on)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on/normal/yellow -> /off)
-
-			ENTER STATE in model <MainApp>
-			State: State(10) (name: /off)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 7.500000
-
-
-__  Current Time:   7.500000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time inf
-

+ 0 - 229
tests/1.10) ShallowHistoryTest/PyDEVS/target.py

@@ -1,229 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration) and Sam Pieters (DEVS)
-
-Model author: Raphael Mannadiar
-
-"""
-
-from sccd.runtime.DEVS_statecharts_core import *
-
-# package ""
-
-class MainAppInstance(RuntimeClassBase):
-    def __init__(self, atomdevs, id, start_port_id):
-        RuntimeClassBase.__init__(self, atomdevs, id)
-        
-        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()
-        
-        # call user defined constructor
-        MainAppInstance.user_defined_constructor(self)
-        port_name = addInputPort("ui", start_port_id, True)
-        atomdevs.state.port_mappings[port_name] = id
-        port_name = addInputPort("<narrow_cast>", start_port_id)
-        atomdevs.state.port_mappings[port_name] = id
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /on
-        self.states["/on"] = State(1, "/on", self)
-        
-        # state /on/normal
-        self.states["/on/normal"] = State(2, "/on/normal", self)
-        self.states["/on/normal"].setEnter(self._on_normal_enter)
-        self.states["/on/normal"].setExit(self._on_normal_exit)
-        
-        # state /on/normal/red
-        self.states["/on/normal/red"] = State(3, "/on/normal/red", self)
-        self.states["/on/normal/red"].setEnter(self._on_normal_red_enter)
-        self.states["/on/normal/red"].setExit(self._on_normal_red_exit)
-        
-        # state /on/normal/green
-        self.states["/on/normal/green"] = State(4, "/on/normal/green", self)
-        self.states["/on/normal/green"].setEnter(self._on_normal_green_enter)
-        self.states["/on/normal/green"].setExit(self._on_normal_green_exit)
-        
-        # state /on/normal/yellow
-        self.states["/on/normal/yellow"] = State(5, "/on/normal/yellow", self)
-        self.states["/on/normal/yellow"].setEnter(self._on_normal_yellow_enter)
-        self.states["/on/normal/yellow"].setExit(self._on_normal_yellow_exit)
-        
-        # state /on/normal/history
-        self.states["/on/normal/history"] = ShallowHistoryState(6, "/on/normal/history", self)
-        
-        # state /on/interrupted
-        self.states["/on/interrupted"] = State(7, "/on/interrupted", self)
-        self.states["/on/interrupted"].setEnter(self._on_interrupted_enter)
-        self.states["/on/interrupted"].setExit(self._on_interrupted_exit)
-        
-        # state /on/interrupted/yellow
-        self.states["/on/interrupted/yellow"] = State(8, "/on/interrupted/yellow", self)
-        self.states["/on/interrupted/yellow"].setEnter(self._on_interrupted_yellow_enter)
-        self.states["/on/interrupted/yellow"].setExit(self._on_interrupted_yellow_exit)
-        
-        # state /on/interrupted/black
-        self.states["/on/interrupted/black"] = State(9, "/on/interrupted/black", self)
-        self.states["/on/interrupted/black"].setEnter(self._on_interrupted_black_enter)
-        self.states["/on/interrupted/black"].setExit(self._on_interrupted_black_exit)
-        
-        # state /off
-        self.states["/off"] = State(10, "/off", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/on"])
-        self.states[""].addChild(self.states["/off"])
-        self.states["/on"].addChild(self.states["/on/normal"])
-        self.states["/on"].addChild(self.states["/on/interrupted"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/red"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/green"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/yellow"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/history"])
-        self.states["/on/interrupted"].addChild(self.states["/on/interrupted/yellow"])
-        self.states["/on/interrupted"].addChild(self.states["/on/interrupted/black"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/on"]
-        self.states["/on"].default_state = self.states["/on/normal"]
-        self.states["/on/normal"].default_state = self.states["/on/normal/red"]
-        self.states["/on/interrupted"].default_state = self.states["/on/interrupted/yellow"]
-        
-        # transition /on/normal/red
-        _on_normal_red_0 = Transition(self, self.states["/on/normal/red"], [self.states["/on/normal/green"]])
-        _on_normal_red_0.setTrigger(Event("_1after"))
-        self.states["/on/normal/red"].addTransition(_on_normal_red_0)
-        
-        # transition /on/normal/green
-        _on_normal_green_0 = Transition(self, self.states["/on/normal/green"], [self.states["/on/normal/yellow"]])
-        _on_normal_green_0.setTrigger(Event("_2after"))
-        self.states["/on/normal/green"].addTransition(_on_normal_green_0)
-        
-        # transition /on/normal/yellow
-        _on_normal_yellow_0 = Transition(self, self.states["/on/normal/yellow"], [self.states["/off"]])
-        _on_normal_yellow_0.setTrigger(Event("_3after"))
-        self.states["/on/normal/yellow"].addTransition(_on_normal_yellow_0)
-        
-        # transition /on/interrupted/yellow
-        _on_interrupted_yellow_0 = Transition(self, self.states["/on/interrupted/yellow"], [self.states["/on/interrupted/black"]])
-        _on_interrupted_yellow_0.setTrigger(Event("_5after"))
-        self.states["/on/interrupted/yellow"].addTransition(_on_interrupted_yellow_0)
-        
-        # transition /on/interrupted/black
-        _on_interrupted_black_0 = Transition(self, self.states["/on/interrupted/black"], [self.states["/on/interrupted/yellow"]])
-        _on_interrupted_black_0.setTrigger(Event("_6after"))
-        self.states["/on/interrupted/black"].addTransition(_on_interrupted_black_0)
-        
-        # transition /on/normal
-        _on_normal_0 = Transition(self, self.states["/on/normal"], [self.states["/on/interrupted"]])
-        _on_normal_0.setTrigger(Event("_0after"))
-        self.states["/on/normal"].addTransition(_on_normal_0)
-        
-        # transition /on/interrupted
-        _on_interrupted_0 = Transition(self, self.states["/on/interrupted"], [self.states["/on/normal/history"]])
-        _on_interrupted_0.setTrigger(Event("_4after"))
-        self.states["/on/interrupted"].addTransition(_on_interrupted_0)
-    
-    def _on_normal_enter(self):
-        self.addTimer(0, 3.5)
-    
-    def _on_normal_exit(self):
-        self.removeTimer(0)
-    
-    def _on_interrupted_enter(self):
-        self.addTimer(4, 1)
-    
-    def _on_interrupted_exit(self):
-        self.removeTimer(4)
-    
-    def _on_normal_red_enter(self):
-        self.addTimer(1, 3)
-    
-    def _on_normal_red_exit(self):
-        self.removeTimer(1)
-    
-    def _on_normal_green_enter(self):
-        self.addTimer(2, 2)
-    
-    def _on_normal_green_exit(self):
-        self.removeTimer(2)
-    
-    def _on_normal_yellow_enter(self):
-        self.addTimer(3, 1)
-    
-    def _on_normal_yellow_exit(self):
-        self.removeTimer(3)
-    
-    def _on_interrupted_yellow_enter(self):
-        self.addTimer(5, .5)
-    
-    def _on_interrupted_yellow_exit(self):
-        self.removeTimer(5)
-    
-    def _on_interrupted_black_enter(self):
-        self.addTimer(6, .5)
-    
-    def _on_interrupted_black_exit(self):
-        self.removeTimer(6)
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/on"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class MainApp(ClassBase):
-    def __init__(self, name):
-        ClassBase.__init__(self, name)
-        self.input = self.addInPort("input")
-        new_instance = self.constructObject(0, 0, [])
-        self.state.instances[new_instance.instance_id] = new_instance
-        new_instance.start()
-        self.state.next_time = 0
-    
-    def constructObject(self, id, start_port_id, parameters):
-        new_instance = MainAppInstance(self, id, start_port_id)
-        return new_instance
-
-def instantiate(self, class_name, construct_params):
-    instance = {}
-    instance["name"] = class_name
-    if class_name == "MainApp":
-        self.narrow_cast_id = self.narrow_cast_id + 0
-        instance["associations"] = {}
-    else:
-        raise Exception("Cannot instantiate class " + class_name)
-    return instance
-ObjectManagerState.instantiate = instantiate
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
-        self.state = ObjectManagerState()
-        self.input = self.addInPort("input")
-        self.output["MainApp"] = self.addOutPort()
-        self.state.createInstance("MainApp", [])
-
-class Controller(CoupledDEVS):
-    def __init__(self, name):
-        CoupledDEVS.__init__(self, name)
-        self.in_ui = self.addInPort("ui")
-        self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomics = []
-        self.atomics.append(self.addSubModel(MainApp("MainApp")))
-        self.connectPorts(self.atomics[0].obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomics[0].obj_manager_in)
-        self.connectPorts(self.in_ui, self.atomics[0].input)

+ 0 - 24
tests/1.10) ShallowHistoryTest/Python/faulty_log.txt

@@ -1,24 +0,0 @@
-3.00 MainApp: exit /on/normal/red
-3.00 MainApp: transition (/on/normal/red -> /on/normal/green)
-3.00 MainApp: enter /on/normal/green
-3.50 MainApp: exit /on/normal/green
-3.50 MainApp: exit /on/normal
-3.50 MainApp: transition (/on/normal -> /on/interrupted)
-3.50 MainApp: enter /on/interrupted
-3.50 MainApp: enter /on/interrupted/yellow
-4.00 MainApp: exit /on/interrupted/yellow
-4.00 MainApp: transition (/on/interrupted/yellow -> /on/interrupted/black)
-4.00 MainApp: enter /on/interrupted/black
-4.50 MainApp: exit /on/interrupted/black
-4.50 MainApp: exit /on/interrupted
-4.50 MainApp: transition (/on/interrupted -> /on/normal/history)
-4.50 MainApp: enter /on/normal
-4.50 MainApp: enter /on/normal/green
-6.50 MainApp: exit /on/normal/green
-6.50 MainApp: transition (/on/normal/green -> /on/normal/yellow)
-6.50 MainApp: enter /on/normal/yellow
-7.50 MainApp: exit /on/normal/yellow
-7.50 MainApp: exit /on/normal
-7.50 MainApp: exit /on
-7.50 MainApp: transition (/on/normal/yellow -> /off)
-7.50 MainApp: enter /off

+ 0 - 86
tests/1.10) ShallowHistoryTest/Python/log.txt

@@ -1,86 +0,0 @@
-__  Current Time:   0.000000 __________________________________________ 
-
-__  Current Time:   3.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/normal/red
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on/normal/red -> /on/normal/green)
-
-ENTER STATE in model <MainApp>
-		State: /on/normal/green
-
-__  Current Time:   3.500000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/normal/green
-
-EXIT STATE in model <MainApp>
-		State: /on/normal
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on/normal -> /on/interrupted)
-
-ENTER STATE in model <MainApp>
-		State: /on/interrupted
-
-ENTER STATE in model <MainApp>
-		State: /on/interrupted/yellow
-
-__  Current Time:   4.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/interrupted/yellow
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on/interrupted/yellow -> /on/interrupted/black)
-
-ENTER STATE in model <MainApp>
-		State: /on/interrupted/black
-
-__  Current Time:   4.500000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/interrupted/black
-
-EXIT STATE in model <MainApp>
-		State: /on/interrupted
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on/interrupted -> /on/normal/history)
-
-ENTER STATE in model <MainApp>
-		State: /on/normal
-
-ENTER STATE in model <MainApp>
-		State: /on/normal/green
-
-__  Current Time:   6.500000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/normal/green
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on/normal/green -> /on/normal/yellow)
-
-ENTER STATE in model <MainApp>
-		State: /on/normal/yellow
-
-__  Current Time:   7.500000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/normal/yellow
-
-EXIT STATE in model <MainApp>
-		State: /on/normal
-
-EXIT STATE in model <MainApp>
-		State: /on
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on/normal/yellow -> /off)
-
-ENTER STATE in model <MainApp>
-		State: /off
-

+ 0 - 203
tests/1.10) ShallowHistoryTest/Python/target.py

@@ -1,203 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Model author: Raphael Mannadiar
-
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package ""
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        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()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /on
-        self.states["/on"] = State(1, "/on", self)
-        
-        # state /on/normal
-        self.states["/on/normal"] = State(2, "/on/normal", self)
-        self.states["/on/normal"].setEnter(self._on_normal_enter)
-        self.states["/on/normal"].setExit(self._on_normal_exit)
-        
-        # state /on/normal/red
-        self.states["/on/normal/red"] = State(3, "/on/normal/red", self)
-        self.states["/on/normal/red"].setEnter(self._on_normal_red_enter)
-        self.states["/on/normal/red"].setExit(self._on_normal_red_exit)
-        
-        # state /on/normal/green
-        self.states["/on/normal/green"] = State(4, "/on/normal/green", self)
-        self.states["/on/normal/green"].setEnter(self._on_normal_green_enter)
-        self.states["/on/normal/green"].setExit(self._on_normal_green_exit)
-        
-        # state /on/normal/yellow
-        self.states["/on/normal/yellow"] = State(5, "/on/normal/yellow", self)
-        self.states["/on/normal/yellow"].setEnter(self._on_normal_yellow_enter)
-        self.states["/on/normal/yellow"].setExit(self._on_normal_yellow_exit)
-        
-        # state /on/normal/history
-        self.states["/on/normal/history"] = ShallowHistoryState(6, "/on/normal/history", self)
-        
-        # state /on/interrupted
-        self.states["/on/interrupted"] = State(7, "/on/interrupted", self)
-        self.states["/on/interrupted"].setEnter(self._on_interrupted_enter)
-        self.states["/on/interrupted"].setExit(self._on_interrupted_exit)
-        
-        # state /on/interrupted/yellow
-        self.states["/on/interrupted/yellow"] = State(8, "/on/interrupted/yellow", self)
-        self.states["/on/interrupted/yellow"].setEnter(self._on_interrupted_yellow_enter)
-        self.states["/on/interrupted/yellow"].setExit(self._on_interrupted_yellow_exit)
-        
-        # state /on/interrupted/black
-        self.states["/on/interrupted/black"] = State(9, "/on/interrupted/black", self)
-        self.states["/on/interrupted/black"].setEnter(self._on_interrupted_black_enter)
-        self.states["/on/interrupted/black"].setExit(self._on_interrupted_black_exit)
-        
-        # state /off
-        self.states["/off"] = State(10, "/off", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/on"])
-        self.states[""].addChild(self.states["/off"])
-        self.states["/on"].addChild(self.states["/on/normal"])
-        self.states["/on"].addChild(self.states["/on/interrupted"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/red"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/green"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/yellow"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/history"])
-        self.states["/on/interrupted"].addChild(self.states["/on/interrupted/yellow"])
-        self.states["/on/interrupted"].addChild(self.states["/on/interrupted/black"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/on"]
-        self.states["/on"].default_state = self.states["/on/normal"]
-        self.states["/on/normal"].default_state = self.states["/on/normal/red"]
-        self.states["/on/interrupted"].default_state = self.states["/on/interrupted/yellow"]
-        
-        # transition /on/normal/red
-        _on_normal_red_0 = Transition(self, self.states["/on/normal/red"], [self.states["/on/normal/green"]])
-        _on_normal_red_0.setTrigger(Event("_1after"))
-        self.states["/on/normal/red"].addTransition(_on_normal_red_0)
-        
-        # transition /on/normal/green
-        _on_normal_green_0 = Transition(self, self.states["/on/normal/green"], [self.states["/on/normal/yellow"]])
-        _on_normal_green_0.setTrigger(Event("_2after"))
-        self.states["/on/normal/green"].addTransition(_on_normal_green_0)
-        
-        # transition /on/normal/yellow
-        _on_normal_yellow_0 = Transition(self, self.states["/on/normal/yellow"], [self.states["/off"]])
-        _on_normal_yellow_0.setTrigger(Event("_3after"))
-        self.states["/on/normal/yellow"].addTransition(_on_normal_yellow_0)
-        
-        # transition /on/interrupted/yellow
-        _on_interrupted_yellow_0 = Transition(self, self.states["/on/interrupted/yellow"], [self.states["/on/interrupted/black"]])
-        _on_interrupted_yellow_0.setTrigger(Event("_5after"))
-        self.states["/on/interrupted/yellow"].addTransition(_on_interrupted_yellow_0)
-        
-        # transition /on/interrupted/black
-        _on_interrupted_black_0 = Transition(self, self.states["/on/interrupted/black"], [self.states["/on/interrupted/yellow"]])
-        _on_interrupted_black_0.setTrigger(Event("_6after"))
-        self.states["/on/interrupted/black"].addTransition(_on_interrupted_black_0)
-        
-        # transition /on/normal
-        _on_normal_0 = Transition(self, self.states["/on/normal"], [self.states["/on/interrupted"]])
-        _on_normal_0.setTrigger(Event("_0after"))
-        self.states["/on/normal"].addTransition(_on_normal_0)
-        
-        # transition /on/interrupted
-        _on_interrupted_0 = Transition(self, self.states["/on/interrupted"], [self.states["/on/normal/history"]])
-        _on_interrupted_0.setTrigger(Event("_4after"))
-        self.states["/on/interrupted"].addTransition(_on_interrupted_0)
-    
-    def _on_normal_enter(self):
-        self.addTimer(0, 3.5)
-    
-    def _on_normal_exit(self):
-        self.removeTimer(0)
-    
-    def _on_interrupted_enter(self):
-        self.addTimer(4, 1)
-    
-    def _on_interrupted_exit(self):
-        self.removeTimer(4)
-    
-    def _on_normal_red_enter(self):
-        self.addTimer(1, 3)
-    
-    def _on_normal_red_exit(self):
-        self.removeTimer(1)
-    
-    def _on_normal_green_enter(self):
-        self.addTimer(2, 2)
-    
-    def _on_normal_green_exit(self):
-        self.removeTimer(2)
-    
-    def _on_normal_yellow_enter(self):
-        self.addTimer(3, 1)
-    
-    def _on_normal_yellow_exit(self):
-        self.removeTimer(3)
-    
-    def _on_interrupted_yellow_enter(self):
-        self.addTimer(5, .5)
-    
-    def _on_interrupted_yellow_exit(self):
-        self.removeTimer(5)
-    
-    def _on_interrupted_black_enter(self):
-        self.addTimer(6, .5)
-    
-    def _on_interrupted_black_exit(self):
-        self.removeTimer(6)
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/on"].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 == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, 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.addInputPort("ui")
-        self.object_manager.createInstance("MainApp", [])

+ 0 - 29
tests/1.11) DeepHistoryTest/PyDEVS/faulty_log.txt

@@ -1,29 +0,0 @@
-2.00 MainApp: exit /on/normal/red
-2.00 MainApp: transition (/on/normal/red -> /on/normal/green)
-2.00 MainApp: enter /on/normal/green
-3.00 MainApp: exit /on/normal/green
-3.00 MainApp: transition (/on/normal/green -> /on/normal/yellow)
-3.00 MainApp: enter /on/normal/yellow
-3.00 MainApp: enter /on/normal/yellow/yellow1
-3.10 MainApp: exit /on/normal/yellow/yellow1
-3.10 MainApp: transition (/on/normal/yellow/yellow1 -> /on/normal/yellow/yellow2)
-3.10 MainApp: enter /on/normal/yellow/yellow2
-3.50 MainApp: exit /on/normal/yellow/yellow2
-3.50 MainApp: exit /on/normal/yellow
-3.50 MainApp: exit /on/normal
-3.50 MainApp: transition (/on/normal -> /on/interrupted)
-3.50 MainApp: enter /on/interrupted
-4.50 MainApp: exit /on/interrupted
-4.50 MainApp: transition (/on/interrupted -> /on/normal/history)
-4.50 MainApp: enter /on/normal
-4.50 MainApp: enter /on/normal/yellow
-4.50 MainApp: enter /on/normal/yellow/yellow2
-5.00 MainApp: exit /on/normal/yellow/yellow2
-5.00 MainApp: transition (/on/normal/yellow/yellow2 -> /on/normal/yellow/yellow3)
-5.00 MainApp: enter /on/normal/yellow/yellow3
-5.10 MainApp: exit /on/normal/yellow/yellow3
-5.10 MainApp: exit /on/normal/yellow
-5.10 MainApp: exit /on/normal
-5.10 MainApp: exit /on
-5.10 MainApp: transition (/on/normal/yellow/yellow3 -> /off)
-5.10 MainApp: enter /off

+ 0 - 275
tests/1.11) DeepHistoryTest/PyDEVS/log.txt

@@ -1,275 +0,0 @@
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INITIAL CONDITIONS in model <Controller.MainApp>
-		Initial State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INITIAL CONDITIONS in model <Controller.ObjectManager>
-		Initial State: <sccd.runtime.DEVS_statecharts_core.ObjectManagerState object at 0x104d42ab0>
-		Next scheduled internal transition at time inf
-
-
-	INITIAL CONDITIONS in model <Controller.Tester>
-		Initial State: None
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 2.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-			port <Test_ui>:
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   2.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(3) (name: /on/normal/red)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on/normal/red -> /on/normal/green)
-
-			ENTER STATE in model <MainApp>
-			State: State(4) (name: /on/normal/green)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 2.000000
-
-
-__  Current Time:   2.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 3.000000
-
-
-__  Current Time:   3.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(4) (name: /on/normal/green)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on/normal/green -> /on/normal/yellow)
-
-			ENTER STATE in model <MainApp>
-			State: State(5) (name: /on/normal/yellow)
-
-			ENTER STATE in model <MainApp>
-			State: State(6) (name: /on/normal/yellow/yellow1)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 3.000000
-
-
-__  Current Time:   3.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 3.100000
-
-
-__  Current Time:   3.100000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(6) (name: /on/normal/yellow/yellow1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on/normal/yellow/yellow1 -> /on/normal/yellow/yellow2)
-
-			ENTER STATE in model <MainApp>
-			State: State(7) (name: /on/normal/yellow/yellow2)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 3.100000
-
-
-__  Current Time:   3.100000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 3.500000
-
-
-__  Current Time:   3.500000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(7) (name: /on/normal/yellow/yellow2)
-
-			EXIT STATE in model <MainApp>
-			State: State(5) (name: /on/normal/yellow)
-
-			EXIT STATE in model <MainApp>
-			State: State(2) (name: /on/normal)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on/normal -> /on/interrupted)
-
-			ENTER STATE in model <MainApp>
-			State: State(10) (name: /on/interrupted)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 3.500000
-
-
-__  Current Time:   3.500000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 4.500000
-
-
-__  Current Time:   4.500000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(10) (name: /on/interrupted)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on/interrupted -> /on/normal/history)
-
-			ENTER STATE in model <MainApp>
-			State: State(2) (name: /on/normal)
-
-			ENTER STATE in model <MainApp>
-			State: State(5) (name: /on/normal/yellow)
-
-			ENTER STATE in model <MainApp>
-			State: State(7) (name: /on/normal/yellow/yellow2)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 4.500000
-
-
-__  Current Time:   4.500000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 5.000000
-
-
-__  Current Time:   5.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(7) (name: /on/normal/yellow/yellow2)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on/normal/yellow/yellow2 -> /on/normal/yellow/yellow3)
-
-			ENTER STATE in model <MainApp>
-			State: State(8) (name: /on/normal/yellow/yellow3)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 5.000000
-
-
-__  Current Time:   5.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 5.100000
-
-
-__  Current Time:   5.100000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(8) (name: /on/normal/yellow/yellow3)
-
-			EXIT STATE in model <MainApp>
-			State: State(5) (name: /on/normal/yellow)
-
-			EXIT STATE in model <MainApp>
-			State: State(2) (name: /on/normal)
-
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /on)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on/normal/yellow/yellow3 -> /off)
-
-			ENTER STATE in model <MainApp>
-			State: State(11) (name: /off)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 5.100000
-
-
-__  Current Time:   5.100000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time inf
-

+ 0 - 233
tests/1.11) DeepHistoryTest/PyDEVS/target.py

@@ -1,233 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration) and Sam Pieters (DEVS)
-
-Model author: Raphael Mannadiar
-
-"""
-
-from sccd.runtime.DEVS_statecharts_core import *
-
-# package ""
-
-class MainAppInstance(RuntimeClassBase):
-    def __init__(self, atomdevs, id, start_port_id):
-        RuntimeClassBase.__init__(self, atomdevs, id)
-        
-        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()
-        
-        # call user defined constructor
-        MainAppInstance.user_defined_constructor(self)
-        port_name = addInputPort("ui", start_port_id, True)
-        atomdevs.state.port_mappings[port_name] = id
-        port_name = addInputPort("<narrow_cast>", start_port_id)
-        atomdevs.state.port_mappings[port_name] = id
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /on
-        self.states["/on"] = State(1, "/on", self)
-        
-        # state /on/normal
-        self.states["/on/normal"] = State(2, "/on/normal", self)
-        self.states["/on/normal"].setEnter(self._on_normal_enter)
-        self.states["/on/normal"].setExit(self._on_normal_exit)
-        
-        # state /on/normal/red
-        self.states["/on/normal/red"] = State(3, "/on/normal/red", self)
-        self.states["/on/normal/red"].setEnter(self._on_normal_red_enter)
-        self.states["/on/normal/red"].setExit(self._on_normal_red_exit)
-        
-        # state /on/normal/green
-        self.states["/on/normal/green"] = State(4, "/on/normal/green", self)
-        self.states["/on/normal/green"].setEnter(self._on_normal_green_enter)
-        self.states["/on/normal/green"].setExit(self._on_normal_green_exit)
-        
-        # state /on/normal/yellow
-        self.states["/on/normal/yellow"] = State(5, "/on/normal/yellow", self)
-        
-        # state /on/normal/yellow/yellow1
-        self.states["/on/normal/yellow/yellow1"] = State(6, "/on/normal/yellow/yellow1", self)
-        self.states["/on/normal/yellow/yellow1"].setEnter(self._on_normal_yellow_yellow1_enter)
-        self.states["/on/normal/yellow/yellow1"].setExit(self._on_normal_yellow_yellow1_exit)
-        
-        # state /on/normal/yellow/yellow2
-        self.states["/on/normal/yellow/yellow2"] = State(7, "/on/normal/yellow/yellow2", self)
-        self.states["/on/normal/yellow/yellow2"].setEnter(self._on_normal_yellow_yellow2_enter)
-        self.states["/on/normal/yellow/yellow2"].setExit(self._on_normal_yellow_yellow2_exit)
-        
-        # state /on/normal/yellow/yellow3
-        self.states["/on/normal/yellow/yellow3"] = State(8, "/on/normal/yellow/yellow3", self)
-        self.states["/on/normal/yellow/yellow3"].setEnter(self._on_normal_yellow_yellow3_enter)
-        self.states["/on/normal/yellow/yellow3"].setExit(self._on_normal_yellow_yellow3_exit)
-        
-        # state /on/normal/history
-        self.states["/on/normal/history"] = DeepHistoryState(9, "/on/normal/history", self)
-        
-        # state /on/interrupted
-        self.states["/on/interrupted"] = State(10, "/on/interrupted", self)
-        self.states["/on/interrupted"].setEnter(self._on_interrupted_enter)
-        self.states["/on/interrupted"].setExit(self._on_interrupted_exit)
-        
-        # state /off
-        self.states["/off"] = State(11, "/off", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/on"])
-        self.states[""].addChild(self.states["/off"])
-        self.states["/on"].addChild(self.states["/on/normal"])
-        self.states["/on"].addChild(self.states["/on/interrupted"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/red"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/green"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/yellow"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/history"])
-        self.states["/on/normal/yellow"].addChild(self.states["/on/normal/yellow/yellow1"])
-        self.states["/on/normal/yellow"].addChild(self.states["/on/normal/yellow/yellow2"])
-        self.states["/on/normal/yellow"].addChild(self.states["/on/normal/yellow/yellow3"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/on"]
-        self.states["/on"].default_state = self.states["/on/normal"]
-        self.states["/on/normal"].default_state = self.states["/on/normal/red"]
-        self.states["/on/normal/yellow"].default_state = self.states["/on/normal/yellow/yellow1"]
-        
-        # transition /on/normal/red
-        _on_normal_red_0 = Transition(self, self.states["/on/normal/red"], [self.states["/on/normal/green"]])
-        _on_normal_red_0.setTrigger(Event("_1after"))
-        self.states["/on/normal/red"].addTransition(_on_normal_red_0)
-        
-        # transition /on/normal/green
-        _on_normal_green_0 = Transition(self, self.states["/on/normal/green"], [self.states["/on/normal/yellow"]])
-        _on_normal_green_0.setTrigger(Event("_2after"))
-        self.states["/on/normal/green"].addTransition(_on_normal_green_0)
-        
-        # transition /on/normal/yellow/yellow1
-        _on_normal_yellow_yellow1_0 = Transition(self, self.states["/on/normal/yellow/yellow1"], [self.states["/on/normal/yellow/yellow2"]])
-        _on_normal_yellow_yellow1_0.setTrigger(Event("_3after"))
-        self.states["/on/normal/yellow/yellow1"].addTransition(_on_normal_yellow_yellow1_0)
-        
-        # transition /on/normal/yellow/yellow2
-        _on_normal_yellow_yellow2_0 = Transition(self, self.states["/on/normal/yellow/yellow2"], [self.states["/on/normal/yellow/yellow3"]])
-        _on_normal_yellow_yellow2_0.setTrigger(Event("_4after"))
-        self.states["/on/normal/yellow/yellow2"].addTransition(_on_normal_yellow_yellow2_0)
-        
-        # transition /on/normal/yellow/yellow3
-        _on_normal_yellow_yellow3_0 = Transition(self, self.states["/on/normal/yellow/yellow3"], [self.states["/off"]])
-        _on_normal_yellow_yellow3_0.setTrigger(Event("_5after"))
-        self.states["/on/normal/yellow/yellow3"].addTransition(_on_normal_yellow_yellow3_0)
-        
-        # transition /on/interrupted
-        _on_interrupted_0 = Transition(self, self.states["/on/interrupted"], [self.states["/on/normal/history"]])
-        _on_interrupted_0.setTrigger(Event("_6after"))
-        self.states["/on/interrupted"].addTransition(_on_interrupted_0)
-        
-        # transition /on/normal
-        _on_normal_0 = Transition(self, self.states["/on/normal"], [self.states["/on/interrupted"]])
-        _on_normal_0.setTrigger(Event("_0after"))
-        self.states["/on/normal"].addTransition(_on_normal_0)
-    
-    def _on_normal_enter(self):
-        self.addTimer(0, 3.5)
-    
-    def _on_normal_exit(self):
-        self.removeTimer(0)
-    
-    def _on_normal_red_enter(self):
-        self.addTimer(1, 2)
-    
-    def _on_normal_red_exit(self):
-        self.removeTimer(1)
-    
-    def _on_normal_green_enter(self):
-        self.addTimer(2, 1)
-    
-    def _on_normal_green_exit(self):
-        self.removeTimer(2)
-    
-    def _on_normal_yellow_yellow1_enter(self):
-        self.addTimer(3, 0.1)
-    
-    def _on_normal_yellow_yellow1_exit(self):
-        self.removeTimer(3)
-    
-    def _on_normal_yellow_yellow2_enter(self):
-        self.addTimer(4, 0.5)
-    
-    def _on_normal_yellow_yellow2_exit(self):
-        self.removeTimer(4)
-    
-    def _on_normal_yellow_yellow3_enter(self):
-        self.addTimer(5, 0.1)
-    
-    def _on_normal_yellow_yellow3_exit(self):
-        self.removeTimer(5)
-    
-    def _on_interrupted_enter(self):
-        self.addTimer(6, 1)
-    
-    def _on_interrupted_exit(self):
-        self.removeTimer(6)
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/on"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class MainApp(ClassBase):
-    def __init__(self, name):
-        ClassBase.__init__(self, name)
-        self.input = self.addInPort("input")
-        new_instance = self.constructObject(0, 0, [])
-        self.state.instances[new_instance.instance_id] = new_instance
-        new_instance.start()
-        self.state.next_time = 0
-    
-    def constructObject(self, id, start_port_id, parameters):
-        new_instance = MainAppInstance(self, id, start_port_id)
-        return new_instance
-
-def instantiate(self, class_name, construct_params):
-    instance = {}
-    instance["name"] = class_name
-    if class_name == "MainApp":
-        self.narrow_cast_id = self.narrow_cast_id + 0
-        instance["associations"] = {}
-    else:
-        raise Exception("Cannot instantiate class " + class_name)
-    return instance
-ObjectManagerState.instantiate = instantiate
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
-        self.state = ObjectManagerState()
-        self.input = self.addInPort("input")
-        self.output["MainApp"] = self.addOutPort()
-        self.state.createInstance("MainApp", [])
-
-class Controller(CoupledDEVS):
-    def __init__(self, name):
-        CoupledDEVS.__init__(self, name)
-        self.in_ui = self.addInPort("ui")
-        self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomics = []
-        self.atomics.append(self.addSubModel(MainApp("MainApp")))
-        self.connectPorts(self.atomics[0].obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomics[0].obj_manager_in)
-        self.connectPorts(self.in_ui, self.atomics[0].input)

+ 0 - 29
tests/1.11) DeepHistoryTest/Python/faulty_log.txt

@@ -1,29 +0,0 @@
-2.00 MainApp: exit /on/normal/red
-2.00 MainApp: transition (/on/normal/red -> /on/normal/green)
-2.00 MainApp: enter /on/normal/green
-3.00 MainApp: exit /on/normal/green
-3.00 MainApp: transition (/on/normal/green -> /on/normal/yellow)
-3.00 MainApp: enter /on/normal/yellow
-3.00 MainApp: enter /on/normal/yellow/yellow1
-3.10 MainApp: exit /on/normal/yellow/yellow1
-3.10 MainApp: transition (/on/normal/yellow/yellow1 -> /on/normal/yellow/yellow2)
-3.10 MainApp: enter /on/normal/yellow/yellow2
-3.50 MainApp: exit /on/normal/yellow/yellow2
-3.50 MainApp: exit /on/normal/yellow
-3.50 MainApp: exit /on/normal
-3.50 MainApp: transition (/on/normal -> /on/interrupted)
-3.50 MainApp: enter /on/interrupted
-4.50 MainApp: exit /on/interrupted
-4.50 MainApp: transition (/on/interrupted -> /on/normal/history)
-4.50 MainApp: enter /on/normal
-4.50 MainApp: enter /on/normal/yellow
-4.50 MainApp: enter /on/normal/yellow/yellow2
-5.00 MainApp: exit /on/normal/yellow/yellow2
-5.00 MainApp: transition (/on/normal/yellow/yellow2 -> /on/normal/yellow/yellow3)
-5.00 MainApp: enter /on/normal/yellow/yellow3
-5.10 MainApp: exit /on/normal/yellow/yellow3
-5.10 MainApp: exit /on/normal/yellow
-5.10 MainApp: exit /on/normal
-5.10 MainApp: exit /on
-5.10 MainApp: transition (/on/normal/yellow/yellow3 -> /off)
-5.10 MainApp: enter /off

+ 0 - 103
tests/1.11) DeepHistoryTest/Python/log.txt

@@ -1,103 +0,0 @@
-__  Current Time:   0.000000 __________________________________________ 
-
-__  Current Time:   2.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/normal/red
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on/normal/red -> /on/normal/green)
-
-ENTER STATE in model <MainApp>
-		State: /on/normal/green
-
-__  Current Time:   3.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/normal/green
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on/normal/green -> /on/normal/yellow)
-
-ENTER STATE in model <MainApp>
-		State: /on/normal/yellow
-
-ENTER STATE in model <MainApp>
-		State: /on/normal/yellow/yellow1
-
-__  Current Time:   3.100000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/normal/yellow/yellow1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on/normal/yellow/yellow1 -> /on/normal/yellow/yellow2)
-
-ENTER STATE in model <MainApp>
-		State: /on/normal/yellow/yellow2
-
-__  Current Time:   3.500000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/normal/yellow/yellow2
-
-EXIT STATE in model <MainApp>
-		State: /on/normal/yellow
-
-EXIT STATE in model <MainApp>
-		State: /on/normal
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on/normal -> /on/interrupted)
-
-ENTER STATE in model <MainApp>
-		State: /on/interrupted
-
-__  Current Time:   4.500000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/interrupted
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on/interrupted -> /on/normal/history)
-
-ENTER STATE in model <MainApp>
-		State: /on/normal
-
-ENTER STATE in model <MainApp>
-		State: /on/normal/yellow
-
-ENTER STATE in model <MainApp>
-		State: /on/normal/yellow/yellow2
-
-__  Current Time:   5.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/normal/yellow/yellow2
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on/normal/yellow/yellow2 -> /on/normal/yellow/yellow3)
-
-ENTER STATE in model <MainApp>
-		State: /on/normal/yellow/yellow3
-
-__  Current Time:   5.100000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/normal/yellow/yellow3
-
-EXIT STATE in model <MainApp>
-		State: /on/normal/yellow
-
-EXIT STATE in model <MainApp>
-		State: /on/normal
-
-EXIT STATE in model <MainApp>
-		State: /on
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on/normal/yellow/yellow3 -> /off)
-
-ENTER STATE in model <MainApp>
-		State: /off
-

+ 0 - 207
tests/1.11) DeepHistoryTest/Python/target.py

@@ -1,207 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Model author: Raphael Mannadiar
-
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package ""
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        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()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /on
-        self.states["/on"] = State(1, "/on", self)
-        
-        # state /on/normal
-        self.states["/on/normal"] = State(2, "/on/normal", self)
-        self.states["/on/normal"].setEnter(self._on_normal_enter)
-        self.states["/on/normal"].setExit(self._on_normal_exit)
-        
-        # state /on/normal/red
-        self.states["/on/normal/red"] = State(3, "/on/normal/red", self)
-        self.states["/on/normal/red"].setEnter(self._on_normal_red_enter)
-        self.states["/on/normal/red"].setExit(self._on_normal_red_exit)
-        
-        # state /on/normal/green
-        self.states["/on/normal/green"] = State(4, "/on/normal/green", self)
-        self.states["/on/normal/green"].setEnter(self._on_normal_green_enter)
-        self.states["/on/normal/green"].setExit(self._on_normal_green_exit)
-        
-        # state /on/normal/yellow
-        self.states["/on/normal/yellow"] = State(5, "/on/normal/yellow", self)
-        
-        # state /on/normal/yellow/yellow1
-        self.states["/on/normal/yellow/yellow1"] = State(6, "/on/normal/yellow/yellow1", self)
-        self.states["/on/normal/yellow/yellow1"].setEnter(self._on_normal_yellow_yellow1_enter)
-        self.states["/on/normal/yellow/yellow1"].setExit(self._on_normal_yellow_yellow1_exit)
-        
-        # state /on/normal/yellow/yellow2
-        self.states["/on/normal/yellow/yellow2"] = State(7, "/on/normal/yellow/yellow2", self)
-        self.states["/on/normal/yellow/yellow2"].setEnter(self._on_normal_yellow_yellow2_enter)
-        self.states["/on/normal/yellow/yellow2"].setExit(self._on_normal_yellow_yellow2_exit)
-        
-        # state /on/normal/yellow/yellow3
-        self.states["/on/normal/yellow/yellow3"] = State(8, "/on/normal/yellow/yellow3", self)
-        self.states["/on/normal/yellow/yellow3"].setEnter(self._on_normal_yellow_yellow3_enter)
-        self.states["/on/normal/yellow/yellow3"].setExit(self._on_normal_yellow_yellow3_exit)
-        
-        # state /on/normal/history
-        self.states["/on/normal/history"] = DeepHistoryState(9, "/on/normal/history", self)
-        
-        # state /on/interrupted
-        self.states["/on/interrupted"] = State(10, "/on/interrupted", self)
-        self.states["/on/interrupted"].setEnter(self._on_interrupted_enter)
-        self.states["/on/interrupted"].setExit(self._on_interrupted_exit)
-        
-        # state /off
-        self.states["/off"] = State(11, "/off", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/on"])
-        self.states[""].addChild(self.states["/off"])
-        self.states["/on"].addChild(self.states["/on/normal"])
-        self.states["/on"].addChild(self.states["/on/interrupted"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/red"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/green"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/yellow"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/history"])
-        self.states["/on/normal/yellow"].addChild(self.states["/on/normal/yellow/yellow1"])
-        self.states["/on/normal/yellow"].addChild(self.states["/on/normal/yellow/yellow2"])
-        self.states["/on/normal/yellow"].addChild(self.states["/on/normal/yellow/yellow3"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/on"]
-        self.states["/on"].default_state = self.states["/on/normal"]
-        self.states["/on/normal"].default_state = self.states["/on/normal/red"]
-        self.states["/on/normal/yellow"].default_state = self.states["/on/normal/yellow/yellow1"]
-        
-        # transition /on/normal/red
-        _on_normal_red_0 = Transition(self, self.states["/on/normal/red"], [self.states["/on/normal/green"]])
-        _on_normal_red_0.setTrigger(Event("_1after"))
-        self.states["/on/normal/red"].addTransition(_on_normal_red_0)
-        
-        # transition /on/normal/green
-        _on_normal_green_0 = Transition(self, self.states["/on/normal/green"], [self.states["/on/normal/yellow"]])
-        _on_normal_green_0.setTrigger(Event("_2after"))
-        self.states["/on/normal/green"].addTransition(_on_normal_green_0)
-        
-        # transition /on/normal/yellow/yellow1
-        _on_normal_yellow_yellow1_0 = Transition(self, self.states["/on/normal/yellow/yellow1"], [self.states["/on/normal/yellow/yellow2"]])
-        _on_normal_yellow_yellow1_0.setTrigger(Event("_3after"))
-        self.states["/on/normal/yellow/yellow1"].addTransition(_on_normal_yellow_yellow1_0)
-        
-        # transition /on/normal/yellow/yellow2
-        _on_normal_yellow_yellow2_0 = Transition(self, self.states["/on/normal/yellow/yellow2"], [self.states["/on/normal/yellow/yellow3"]])
-        _on_normal_yellow_yellow2_0.setTrigger(Event("_4after"))
-        self.states["/on/normal/yellow/yellow2"].addTransition(_on_normal_yellow_yellow2_0)
-        
-        # transition /on/normal/yellow/yellow3
-        _on_normal_yellow_yellow3_0 = Transition(self, self.states["/on/normal/yellow/yellow3"], [self.states["/off"]])
-        _on_normal_yellow_yellow3_0.setTrigger(Event("_5after"))
-        self.states["/on/normal/yellow/yellow3"].addTransition(_on_normal_yellow_yellow3_0)
-        
-        # transition /on/interrupted
-        _on_interrupted_0 = Transition(self, self.states["/on/interrupted"], [self.states["/on/normal/history"]])
-        _on_interrupted_0.setTrigger(Event("_6after"))
-        self.states["/on/interrupted"].addTransition(_on_interrupted_0)
-        
-        # transition /on/normal
-        _on_normal_0 = Transition(self, self.states["/on/normal"], [self.states["/on/interrupted"]])
-        _on_normal_0.setTrigger(Event("_0after"))
-        self.states["/on/normal"].addTransition(_on_normal_0)
-    
-    def _on_normal_enter(self):
-        self.addTimer(0, 3.5)
-    
-    def _on_normal_exit(self):
-        self.removeTimer(0)
-    
-    def _on_normal_red_enter(self):
-        self.addTimer(1, 2)
-    
-    def _on_normal_red_exit(self):
-        self.removeTimer(1)
-    
-    def _on_normal_green_enter(self):
-        self.addTimer(2, 1)
-    
-    def _on_normal_green_exit(self):
-        self.removeTimer(2)
-    
-    def _on_normal_yellow_yellow1_enter(self):
-        self.addTimer(3, 0.1)
-    
-    def _on_normal_yellow_yellow1_exit(self):
-        self.removeTimer(3)
-    
-    def _on_normal_yellow_yellow2_enter(self):
-        self.addTimer(4, 0.5)
-    
-    def _on_normal_yellow_yellow2_exit(self):
-        self.removeTimer(4)
-    
-    def _on_normal_yellow_yellow3_enter(self):
-        self.addTimer(5, 0.1)
-    
-    def _on_normal_yellow_yellow3_exit(self):
-        self.removeTimer(5)
-    
-    def _on_interrupted_enter(self):
-        self.addTimer(6, 1)
-    
-    def _on_interrupted_exit(self):
-        self.removeTimer(6)
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/on"].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 == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, 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.addInputPort("ui")
-        self.object_manager.createInstance("MainApp", [])

+ 0 - 3
tests/1.2) GuardConditionTest/PyDEVS/faulty_log.txt

@@ -1,3 +0,0 @@
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state3)
-0.00 MainApp: enter /state3

+ 0 - 56
tests/1.2) GuardConditionTest/PyDEVS/log.txt

@@ -1,56 +0,0 @@
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INITIAL CONDITIONS in model <Controller.MainApp>
-		Initial State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INITIAL CONDITIONS in model <Controller.ObjectManager>
-		Initial State: <sccd.runtime.DEVS_statecharts_core.ObjectManagerState object at 0x104ab9520>
-		Next scheduled internal transition at time inf
-
-
-	INITIAL CONDITIONS in model <Controller.Tester>
-		Initial State: None
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state3)
-
-			ENTER STATE in model <MainApp>
-			State: State(3) (name: /state3)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-		Next scheduled internal transition at time inf
-

+ 0 - 122
tests/1.2) GuardConditionTest/PyDEVS/target.py

@@ -1,122 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration) and Sam Pieters (DEVS)
-
-Model author: Sam Pieters
-Model name:   GuardConditionTest
-Model description:
-Test 5: Test if the guard condition for a transition works
-"""
-
-from sccd.runtime.DEVS_statecharts_core import *
-VALUE = 5
-
-# package "GuardConditionTest"
-
-class MainAppInstance(RuntimeClassBase):
-    def __init__(self, atomdevs, id, start_port_id):
-        RuntimeClassBase.__init__(self, atomdevs, id)
-        
-        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()
-        
-        # call user defined constructor
-        MainAppInstance.user_defined_constructor(self)
-        port_name = addInputPort("<narrow_cast>", start_port_id)
-        atomdevs.state.port_mappings[port_name] = id
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        
-        # state /state2
-        self.states["/state2"] = State(2, "/state2", self)
-        
-        # state /state3
-        self.states["/state3"] = State(3, "/state3", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states[""].addChild(self.states["/state3"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/state2"]])
-        _state1_0.setTrigger(None)
-        _state1_0.setGuard(self._state1_0_guard)
-        self.states["/state1"].addTransition(_state1_0)
-        _state1_1 = Transition(self, self.states["/state1"], [self.states["/state3"]])
-        _state1_1.setTrigger(None)
-        _state1_1.setGuard(self._state1_1_guard)
-        self.states["/state1"].addTransition(_state1_1)
-    
-    def _state1_0_guard(self, parameters):
-        return VALUE == 3
-    
-    def _state1_1_guard(self, parameters):
-        return VALUE == 5
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class MainApp(ClassBase):
-    def __init__(self, name):
-        ClassBase.__init__(self, name)
-        self.input = self.addInPort("input")
-        new_instance = self.constructObject(0, 0, [])
-        self.state.instances[new_instance.instance_id] = new_instance
-        new_instance.start()
-        self.state.next_time = 0
-    
-    def constructObject(self, id, start_port_id, parameters):
-        new_instance = MainAppInstance(self, id, start_port_id)
-        return new_instance
-
-def instantiate(self, class_name, construct_params):
-    instance = {}
-    instance["name"] = class_name
-    if class_name == "MainApp":
-        self.narrow_cast_id = self.narrow_cast_id + 0
-        instance["associations"] = {}
-    else:
-        raise Exception("Cannot instantiate class " + class_name)
-    return instance
-ObjectManagerState.instantiate = instantiate
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
-        self.state = ObjectManagerState()
-        self.input = self.addInPort("input")
-        self.output["MainApp"] = self.addOutPort()
-        self.state.createInstance("MainApp", [])
-
-class Controller(CoupledDEVS):
-    def __init__(self, name):
-        CoupledDEVS.__init__(self, name)
-        self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomics = []
-        self.atomics.append(self.addSubModel(MainApp("MainApp")))
-        self.connectPorts(self.atomics[0].obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomics[0].obj_manager_in)

+ 0 - 3
tests/1.2) GuardConditionTest/Python/faulty_log.txt

@@ -1,3 +0,0 @@
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state3)
-0.00 MainApp: enter /state3

+ 0 - 11
tests/1.2) GuardConditionTest/Python/log.txt

@@ -1,11 +0,0 @@
-__  Current Time:   0.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state3)
-
-ENTER STATE in model <MainApp>
-		State: /state3
-

+ 0 - 99
tests/1.2) GuardConditionTest/Python/target.py

@@ -1,99 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Model author: Sam Pieters
-Model name:   GuardConditionTest
-Model description:
-Test 5: Test if the guard condition for a transition works
-"""
-
-from sccd.runtime.statecharts_core import *
-VALUE = 5
-
-# package "GuardConditionTest"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        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()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        
-        # state /state2
-        self.states["/state2"] = State(2, "/state2", self)
-        
-        # state /state3
-        self.states["/state3"] = State(3, "/state3", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states[""].addChild(self.states["/state3"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/state2"]])
-        _state1_0.setTrigger(None)
-        _state1_0.setGuard(self._state1_0_guard)
-        self.states["/state1"].addTransition(_state1_0)
-        _state1_1 = Transition(self, self.states["/state1"], [self.states["/state3"]])
-        _state1_1.setTrigger(None)
-        _state1_1.setGuard(self._state1_1_guard)
-        self.states["/state1"].addTransition(_state1_1)
-    
-    def _state1_0_guard(self, parameters):
-        return VALUE == 3
-    
-    def _state1_1_guard(self, parameters):
-        return VALUE == 5
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].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 == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, 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("MainApp", [])

+ 0 - 6
tests/1.3) TransitionToItselfTest/PyDEVS/faulty_log.txt

@@ -1,6 +0,0 @@
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state1)
-0.00 MainApp: enter /state1
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state2)
-0.00 MainApp: enter /state2

+ 0 - 65
tests/1.3) TransitionToItselfTest/PyDEVS/log.txt

@@ -1,65 +0,0 @@
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INITIAL CONDITIONS in model <Controller.MainApp>
-		Initial State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INITIAL CONDITIONS in model <Controller.ObjectManager>
-		Initial State: <sccd.runtime.DEVS_statecharts_core.ObjectManagerState object at 0x10401eb10>
-		Next scheduled internal transition at time inf
-
-
-	INITIAL CONDITIONS in model <Controller.Tester>
-		Initial State: None
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state1)
-
-			ENTER STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state2)
-
-			ENTER STATE in model <MainApp>
-			State: State(2) (name: /state2)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-		Next scheduled internal transition at time inf
-

+ 0 - 121
tests/1.3) TransitionToItselfTest/PyDEVS/target.py

@@ -1,121 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration) and Sam Pieters (DEVS)
-
-Model author: Sam Pieters
-Model name:   AfterTransitionTest
-Model description:
-Test 3: Check if a state can transition to itself
-"""
-
-from sccd.runtime.DEVS_statecharts_core import *
-
-# package "AfterTransitionTest"
-
-class MainAppInstance(RuntimeClassBase):
-    def __init__(self, atomdevs, id, start_port_id):
-        RuntimeClassBase.__init__(self, atomdevs, id)
-        
-        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()
-        
-        # call user defined constructor
-        MainAppInstance.user_defined_constructor(self)
-        port_name = addInputPort("<narrow_cast>", start_port_id)
-        atomdevs.state.port_mappings[port_name] = id
-    
-    def user_defined_constructor(self):
-        self.value = 0
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        
-        # state /state2
-        self.states["/state2"] = State(2, "/state2", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/state1"]])
-        _state1_0.setAction(self._state1_0_exec)
-        _state1_0.setTrigger(None)
-        _state1_0.setGuard(self._state1_0_guard)
-        self.states["/state1"].addTransition(_state1_0)
-        _state1_1 = Transition(self, self.states["/state1"], [self.states["/state2"]])
-        _state1_1.setTrigger(None)
-        _state1_1.setGuard(self._state1_1_guard)
-        self.states["/state1"].addTransition(_state1_1)
-    
-    def _state1_0_exec(self, parameters):
-        self.value = 1
-    
-    def _state1_0_guard(self, parameters):
-        return self.value == 0
-    
-    def _state1_1_guard(self, parameters):
-        return self.value == 1
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class MainApp(ClassBase):
-    def __init__(self, name):
-        ClassBase.__init__(self, name)
-        self.input = self.addInPort("input")
-        new_instance = self.constructObject(0, 0, [])
-        self.state.instances[new_instance.instance_id] = new_instance
-        new_instance.start()
-        self.state.next_time = 0
-    
-    def constructObject(self, id, start_port_id, parameters):
-        new_instance = MainAppInstance(self, id, start_port_id)
-        return new_instance
-
-def instantiate(self, class_name, construct_params):
-    instance = {}
-    instance["name"] = class_name
-    if class_name == "MainApp":
-        self.narrow_cast_id = self.narrow_cast_id + 0
-        instance["associations"] = {}
-    else:
-        raise Exception("Cannot instantiate class " + class_name)
-    return instance
-ObjectManagerState.instantiate = instantiate
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
-        self.state = ObjectManagerState()
-        self.input = self.addInPort("input")
-        self.output["MainApp"] = self.addOutPort()
-        self.state.createInstance("MainApp", [])
-
-class Controller(CoupledDEVS):
-    def __init__(self, name):
-        CoupledDEVS.__init__(self, name)
-        self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomics = []
-        self.atomics.append(self.addSubModel(MainApp("MainApp")))
-        self.connectPorts(self.atomics[0].obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomics[0].obj_manager_in)

+ 0 - 6
tests/1.3) TransitionToItselfTest/Python/faulty_log.txt

@@ -1,6 +0,0 @@
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state1)
-0.00 MainApp: enter /state1
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state2)
-0.00 MainApp: enter /state2

+ 0 - 20
tests/1.3) TransitionToItselfTest/Python/log.txt

@@ -1,20 +0,0 @@
-__  Current Time:   0.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state1)
-
-ENTER STATE in model <MainApp>
-		State: /state1
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state2)
-
-ENTER STATE in model <MainApp>
-		State: /state2
-

+ 0 - 98
tests/1.3) TransitionToItselfTest/Python/target.py

@@ -1,98 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Model author: Sam Pieters
-Model name:   AfterTransitionTest
-Model description:
-Test 3: Check if a state can transition to itself
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "AfterTransitionTest"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        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()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        self.value = 0
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        
-        # state /state2
-        self.states["/state2"] = State(2, "/state2", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/state1"]])
-        _state1_0.setAction(self._state1_0_exec)
-        _state1_0.setTrigger(None)
-        _state1_0.setGuard(self._state1_0_guard)
-        self.states["/state1"].addTransition(_state1_0)
-        _state1_1 = Transition(self, self.states["/state1"], [self.states["/state2"]])
-        _state1_1.setTrigger(None)
-        _state1_1.setGuard(self._state1_1_guard)
-        self.states["/state1"].addTransition(_state1_1)
-    
-    def _state1_0_exec(self, parameters):
-        self.value = 1
-    
-    def _state1_0_guard(self, parameters):
-        return self.value == 0
-    
-    def _state1_1_guard(self, parameters):
-        return self.value == 1
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].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 == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, 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("MainApp", [])

+ 0 - 9
tests/1.4) ScriptTransitionTest/PyDEVS/faulty_log.txt

@@ -1,9 +0,0 @@
-1.00 MainApp: exit /state1
-1.00 MainApp: transition (/state1 -> /state1)
-1.00 MainApp: enter /state1
-2.00 MainApp: exit /state1
-2.00 MainApp: transition (/state1 -> /state1)
-2.00 MainApp: enter /state1
-2.00 MainApp: exit /state1
-2.00 MainApp: transition (/state1 -> /state2)
-2.00 MainApp: enter /state2

+ 0 - 114
tests/1.4) ScriptTransitionTest/PyDEVS/log.txt

@@ -1,114 +0,0 @@
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INITIAL CONDITIONS in model <Controller.MainApp>
-		Initial State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INITIAL CONDITIONS in model <Controller.ObjectManager>
-		Initial State: <sccd.runtime.DEVS_statecharts_core.ObjectManagerState object at 0x1048af6b0>
-		Next scheduled internal transition at time inf
-
-
-	INITIAL CONDITIONS in model <Controller.Tester>
-		Initial State: None
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 1.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   1.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state1)
-
-			ENTER STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 1.000000
-
-
-__  Current Time:   1.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 2.000000
-
-
-__  Current Time:   2.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state1)
-
-			ENTER STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state2)
-
-			ENTER STATE in model <MainApp>
-			State: State(2) (name: /state2)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 2.000000
-
-
-__  Current Time:   2.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time inf
-

+ 0 - 125
tests/1.4) ScriptTransitionTest/PyDEVS/target.py

@@ -1,125 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration) and Sam Pieters (DEVS)
-
-Model author: Sam Pieters
-Model name:   AfterTransitionTest
-Model description:
-Test 3: Check if a script works by updating parameters.
-"""
-
-from sccd.runtime.DEVS_statecharts_core import *
-
-# package "AfterTransitionTest"
-
-class MainAppInstance(RuntimeClassBase):
-    def __init__(self, atomdevs, id, start_port_id):
-        RuntimeClassBase.__init__(self, atomdevs, id)
-        
-        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()
-        
-        # call user defined constructor
-        MainAppInstance.user_defined_constructor(self)
-        port_name = addInputPort("<narrow_cast>", start_port_id)
-        atomdevs.state.port_mappings[port_name] = id
-    
-    def user_defined_constructor(self):
-        self.value = 0
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        self.states["/state1"].setEnter(self._state1_enter)
-        self.states["/state1"].setExit(self._state1_exit)
-        
-        # state /state2
-        self.states["/state2"] = State(2, "/state2", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/state1"]])
-        _state1_0.setAction(self._state1_0_exec)
-        _state1_0.setTrigger(Event("_0after"))
-        self.states["/state1"].addTransition(_state1_0)
-        _state1_1 = Transition(self, self.states["/state1"], [self.states["/state2"]])
-        _state1_1.setTrigger(None)
-        _state1_1.setGuard(self._state1_1_guard)
-        self.states["/state1"].addTransition(_state1_1)
-    
-    def _state1_enter(self):
-        self.addTimer(0, 1)
-    
-    def _state1_exit(self):
-        self.removeTimer(0)
-    
-    def _state1_0_exec(self, parameters):
-        self.value += 1
-    
-    def _state1_1_guard(self, parameters):
-        return self.value == 2
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class MainApp(ClassBase):
-    def __init__(self, name):
-        ClassBase.__init__(self, name)
-        self.input = self.addInPort("input")
-        new_instance = self.constructObject(0, 0, [])
-        self.state.instances[new_instance.instance_id] = new_instance
-        new_instance.start()
-        self.state.next_time = 0
-    
-    def constructObject(self, id, start_port_id, parameters):
-        new_instance = MainAppInstance(self, id, start_port_id)
-        return new_instance
-
-def instantiate(self, class_name, construct_params):
-    instance = {}
-    instance["name"] = class_name
-    if class_name == "MainApp":
-        self.narrow_cast_id = self.narrow_cast_id + 0
-        instance["associations"] = {}
-    else:
-        raise Exception("Cannot instantiate class " + class_name)
-    return instance
-ObjectManagerState.instantiate = instantiate
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
-        self.state = ObjectManagerState()
-        self.input = self.addInPort("input")
-        self.output["MainApp"] = self.addOutPort()
-        self.state.createInstance("MainApp", [])
-
-class Controller(CoupledDEVS):
-    def __init__(self, name):
-        CoupledDEVS.__init__(self, name)
-        self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomics = []
-        self.atomics.append(self.addSubModel(MainApp("MainApp")))
-        self.connectPorts(self.atomics[0].obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomics[0].obj_manager_in)

+ 0 - 9
tests/1.4) ScriptTransitionTest/Python/faulty_log.txt

@@ -1,9 +0,0 @@
-1.00 MainApp: exit /state1
-1.00 MainApp: transition (/state1 -> /state1)
-1.00 MainApp: enter /state1
-2.00 MainApp: exit /state1
-2.00 MainApp: transition (/state1 -> /state1)
-2.00 MainApp: enter /state1
-2.00 MainApp: exit /state1
-2.00 MainApp: transition (/state1 -> /state2)
-2.00 MainApp: enter /state2

+ 0 - 33
tests/1.4) ScriptTransitionTest/Python/log.txt

@@ -1,33 +0,0 @@
-__  Current Time:   0.000000 __________________________________________ 
-
-__  Current Time:   1.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state1)
-
-ENTER STATE in model <MainApp>
-		State: /state1
-
-__  Current Time:   2.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state1)
-
-ENTER STATE in model <MainApp>
-		State: /state1
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state2)
-
-ENTER STATE in model <MainApp>
-		State: /state2
-

+ 0 - 102
tests/1.4) ScriptTransitionTest/Python/target.py

@@ -1,102 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Model author: Sam Pieters
-Model name:   AfterTransitionTest
-Model description:
-Test 3: Check if a script works by updating parameters.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "AfterTransitionTest"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        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()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        self.value = 0
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        self.states["/state1"].setEnter(self._state1_enter)
-        self.states["/state1"].setExit(self._state1_exit)
-        
-        # state /state2
-        self.states["/state2"] = State(2, "/state2", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/state1"]])
-        _state1_0.setAction(self._state1_0_exec)
-        _state1_0.setTrigger(Event("_0after"))
-        self.states["/state1"].addTransition(_state1_0)
-        _state1_1 = Transition(self, self.states["/state1"], [self.states["/state2"]])
-        _state1_1.setTrigger(None)
-        _state1_1.setGuard(self._state1_1_guard)
-        self.states["/state1"].addTransition(_state1_1)
-    
-    def _state1_enter(self):
-        self.addTimer(0, 1)
-    
-    def _state1_exit(self):
-        self.removeTimer(0)
-    
-    def _state1_0_exec(self, parameters):
-        self.value += 1
-    
-    def _state1_1_guard(self, parameters):
-        return self.value == 2
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].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 == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, 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("MainApp", [])

+ 0 - 6
tests/1.5) ScriptEntryTest/PyDEVS/faulty_log.txt

@@ -1,6 +0,0 @@
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state1)
-0.00 MainApp: enter /state1
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state2)
-0.00 MainApp: enter /state2

+ 0 - 65
tests/1.5) ScriptEntryTest/PyDEVS/log.txt

@@ -1,65 +0,0 @@
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INITIAL CONDITIONS in model <Controller.MainApp>
-		Initial State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INITIAL CONDITIONS in model <Controller.ObjectManager>
-		Initial State: <sccd.runtime.DEVS_statecharts_core.ObjectManagerState object at 0x104a43980>
-		Next scheduled internal transition at time inf
-
-
-	INITIAL CONDITIONS in model <Controller.Tester>
-		Initial State: None
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state1)
-
-			ENTER STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state2)
-
-			ENTER STATE in model <MainApp>
-			State: State(2) (name: /state2)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-		Next scheduled internal transition at time inf
-

+ 0 - 121
tests/1.5) ScriptEntryTest/PyDEVS/target.py

@@ -1,121 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration) and Sam Pieters (DEVS)
-
-Model author: Sam Pieters
-Model name:   AfterTransitionTest
-Model description:
-Test 3: Check if a script works by updating parameters.
-"""
-
-from sccd.runtime.DEVS_statecharts_core import *
-
-# package "AfterTransitionTest"
-
-class MainAppInstance(RuntimeClassBase):
-    def __init__(self, atomdevs, id, start_port_id):
-        RuntimeClassBase.__init__(self, atomdevs, id)
-        
-        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()
-        
-        # call user defined constructor
-        MainAppInstance.user_defined_constructor(self)
-        port_name = addInputPort("<narrow_cast>", start_port_id)
-        atomdevs.state.port_mappings[port_name] = id
-    
-    def user_defined_constructor(self):
-        self.value = 0
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        self.states["/state1"].setEnter(self._state1_enter)
-        
-        # state /state2
-        self.states["/state2"] = State(2, "/state2", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/state2"]])
-        _state1_0.setTrigger(None)
-        _state1_0.setGuard(self._state1_0_guard)
-        self.states["/state1"].addTransition(_state1_0)
-        _state1_1 = Transition(self, self.states["/state1"], [self.states["/state1"]])
-        _state1_1.setTrigger(None)
-        _state1_1.setGuard(self._state1_1_guard)
-        self.states["/state1"].addTransition(_state1_1)
-    
-    def _state1_enter(self):
-        self.value += 1
-    
-    def _state1_0_guard(self, parameters):
-        return self.value == 2
-    
-    def _state1_1_guard(self, parameters):
-        return self.value < 2
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class MainApp(ClassBase):
-    def __init__(self, name):
-        ClassBase.__init__(self, name)
-        self.input = self.addInPort("input")
-        new_instance = self.constructObject(0, 0, [])
-        self.state.instances[new_instance.instance_id] = new_instance
-        new_instance.start()
-        self.state.next_time = 0
-    
-    def constructObject(self, id, start_port_id, parameters):
-        new_instance = MainAppInstance(self, id, start_port_id)
-        return new_instance
-
-def instantiate(self, class_name, construct_params):
-    instance = {}
-    instance["name"] = class_name
-    if class_name == "MainApp":
-        self.narrow_cast_id = self.narrow_cast_id + 0
-        instance["associations"] = {}
-    else:
-        raise Exception("Cannot instantiate class " + class_name)
-    return instance
-ObjectManagerState.instantiate = instantiate
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
-        self.state = ObjectManagerState()
-        self.input = self.addInPort("input")
-        self.output["MainApp"] = self.addOutPort()
-        self.state.createInstance("MainApp", [])
-
-class Controller(CoupledDEVS):
-    def __init__(self, name):
-        CoupledDEVS.__init__(self, name)
-        self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomics = []
-        self.atomics.append(self.addSubModel(MainApp("MainApp")))
-        self.connectPorts(self.atomics[0].obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomics[0].obj_manager_in)

+ 0 - 6
tests/1.5) ScriptEntryTest/Python/faulty_log.txt

@@ -1,6 +0,0 @@
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state1)
-0.00 MainApp: enter /state1
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state2)
-0.00 MainApp: enter /state2

+ 0 - 20
tests/1.5) ScriptEntryTest/Python/log.txt

@@ -1,20 +0,0 @@
-__  Current Time:   0.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state1)
-
-ENTER STATE in model <MainApp>
-		State: /state1
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state2)
-
-ENTER STATE in model <MainApp>
-		State: /state2
-

+ 0 - 98
tests/1.5) ScriptEntryTest/Python/target.py

@@ -1,98 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Model author: Sam Pieters
-Model name:   AfterTransitionTest
-Model description:
-Test 3: Check if a script works by updating parameters.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "AfterTransitionTest"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        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()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        self.value = 0
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        self.states["/state1"].setEnter(self._state1_enter)
-        
-        # state /state2
-        self.states["/state2"] = State(2, "/state2", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/state2"]])
-        _state1_0.setTrigger(None)
-        _state1_0.setGuard(self._state1_0_guard)
-        self.states["/state1"].addTransition(_state1_0)
-        _state1_1 = Transition(self, self.states["/state1"], [self.states["/state1"]])
-        _state1_1.setTrigger(None)
-        _state1_1.setGuard(self._state1_1_guard)
-        self.states["/state1"].addTransition(_state1_1)
-    
-    def _state1_enter(self):
-        self.value += 1
-    
-    def _state1_0_guard(self, parameters):
-        return self.value == 2
-    
-    def _state1_1_guard(self, parameters):
-        return self.value < 2
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].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 == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, 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("MainApp", [])

+ 0 - 18
tests/1.6) ScriptExitTest/PyDEVS/faulty_log.txt

@@ -1,18 +0,0 @@
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state1)
-0.00 MainApp: enter /state1
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state1)
-0.00 MainApp: enter /state1
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state1)
-0.00 MainApp: enter /state1
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state1)
-0.00 MainApp: enter /state1
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state1)
-0.00 MainApp: enter /state1
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state2)
-0.00 MainApp: enter /state2

+ 0 - 101
tests/1.6) ScriptExitTest/PyDEVS/log.txt

@@ -1,101 +0,0 @@
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INITIAL CONDITIONS in model <Controller.MainApp>
-		Initial State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INITIAL CONDITIONS in model <Controller.ObjectManager>
-		Initial State: <sccd.runtime.DEVS_statecharts_core.ObjectManagerState object at 0x104a6db80>
-		Next scheduled internal transition at time inf
-
-
-	INITIAL CONDITIONS in model <Controller.Tester>
-		Initial State: None
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state1)
-
-			ENTER STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state1)
-
-			ENTER STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state1)
-
-			ENTER STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state1)
-
-			ENTER STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state1)
-
-			ENTER STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state2)
-
-			ENTER STATE in model <MainApp>
-			State: State(2) (name: /state2)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-		Next scheduled internal transition at time inf
-

+ 0 - 121
tests/1.6) ScriptExitTest/PyDEVS/target.py

@@ -1,121 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration) and Sam Pieters (DEVS)
-
-Model author: Sam Pieters
-Model name:   AfterTransitionTest
-Model description:
-Test 3: Check if a script works by updating parameters.
-"""
-
-from sccd.runtime.DEVS_statecharts_core import *
-
-# package "AfterTransitionTest"
-
-class MainAppInstance(RuntimeClassBase):
-    def __init__(self, atomdevs, id, start_port_id):
-        RuntimeClassBase.__init__(self, atomdevs, id)
-        
-        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()
-        
-        # call user defined constructor
-        MainAppInstance.user_defined_constructor(self)
-        port_name = addInputPort("<narrow_cast>", start_port_id)
-        atomdevs.state.port_mappings[port_name] = id
-    
-    def user_defined_constructor(self):
-        self.value = 0
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        self.states["/state1"].setExit(self._state1_exit)
-        
-        # state /state2
-        self.states["/state2"] = State(2, "/state2", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/state1"]])
-        _state1_0.setTrigger(None)
-        _state1_0.setGuard(self._state1_0_guard)
-        self.states["/state1"].addTransition(_state1_0)
-        _state1_1 = Transition(self, self.states["/state1"], [self.states["/state2"]])
-        _state1_1.setTrigger(None)
-        _state1_1.setGuard(self._state1_1_guard)
-        self.states["/state1"].addTransition(_state1_1)
-    
-    def _state1_exit(self):
-        self.value += 1
-    
-    def _state1_0_guard(self, parameters):
-        return self.value < 5
-    
-    def _state1_1_guard(self, parameters):
-        return self.value == 5
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class MainApp(ClassBase):
-    def __init__(self, name):
-        ClassBase.__init__(self, name)
-        self.input = self.addInPort("input")
-        new_instance = self.constructObject(0, 0, [])
-        self.state.instances[new_instance.instance_id] = new_instance
-        new_instance.start()
-        self.state.next_time = 0
-    
-    def constructObject(self, id, start_port_id, parameters):
-        new_instance = MainAppInstance(self, id, start_port_id)
-        return new_instance
-
-def instantiate(self, class_name, construct_params):
-    instance = {}
-    instance["name"] = class_name
-    if class_name == "MainApp":
-        self.narrow_cast_id = self.narrow_cast_id + 0
-        instance["associations"] = {}
-    else:
-        raise Exception("Cannot instantiate class " + class_name)
-    return instance
-ObjectManagerState.instantiate = instantiate
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
-        self.state = ObjectManagerState()
-        self.input = self.addInPort("input")
-        self.output["MainApp"] = self.addOutPort()
-        self.state.createInstance("MainApp", [])
-
-class Controller(CoupledDEVS):
-    def __init__(self, name):
-        CoupledDEVS.__init__(self, name)
-        self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomics = []
-        self.atomics.append(self.addSubModel(MainApp("MainApp")))
-        self.connectPorts(self.atomics[0].obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomics[0].obj_manager_in)

+ 0 - 18
tests/1.6) ScriptExitTest/Python/faulty_log.txt

@@ -1,18 +0,0 @@
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state1)
-0.00 MainApp: enter /state1
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state1)
-0.00 MainApp: enter /state1
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state1)
-0.00 MainApp: enter /state1
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state1)
-0.00 MainApp: enter /state1
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state1)
-0.00 MainApp: enter /state1
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state2)
-0.00 MainApp: enter /state2

+ 0 - 56
tests/1.6) ScriptExitTest/Python/log.txt

@@ -1,56 +0,0 @@
-__  Current Time:   0.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state1)
-
-ENTER STATE in model <MainApp>
-		State: /state1
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state1)
-
-ENTER STATE in model <MainApp>
-		State: /state1
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state1)
-
-ENTER STATE in model <MainApp>
-		State: /state1
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state1)
-
-ENTER STATE in model <MainApp>
-		State: /state1
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state1)
-
-ENTER STATE in model <MainApp>
-		State: /state1
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state2)
-
-ENTER STATE in model <MainApp>
-		State: /state2
-

+ 0 - 98
tests/1.6) ScriptExitTest/Python/target.py

@@ -1,98 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Model author: Sam Pieters
-Model name:   AfterTransitionTest
-Model description:
-Test 3: Check if a script works by updating parameters.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "AfterTransitionTest"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        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()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        self.value = 0
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        self.states["/state1"].setExit(self._state1_exit)
-        
-        # state /state2
-        self.states["/state2"] = State(2, "/state2", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/state1"]])
-        _state1_0.setTrigger(None)
-        _state1_0.setGuard(self._state1_0_guard)
-        self.states["/state1"].addTransition(_state1_0)
-        _state1_1 = Transition(self, self.states["/state1"], [self.states["/state2"]])
-        _state1_1.setTrigger(None)
-        _state1_1.setGuard(self._state1_1_guard)
-        self.states["/state1"].addTransition(_state1_1)
-    
-    def _state1_exit(self):
-        self.value += 1
-    
-    def _state1_0_guard(self, parameters):
-        return self.value < 5
-    
-    def _state1_1_guard(self, parameters):
-        return self.value == 5
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].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 == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, 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("MainApp", [])

+ 0 - 7
tests/1.7) CompositeStateTest/PyDEVS/faulty_log.txt

@@ -1,7 +0,0 @@
-0.00 MainApp: exit /state1/state11
-0.00 MainApp: transition (/state1/state11 -> /state1/state12)
-0.00 MainApp: enter /state1/state12
-0.00 MainApp: exit /state1/state12
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1/state12 -> /state2)
-0.00 MainApp: enter /state2

+ 0 - 68
tests/1.7) CompositeStateTest/PyDEVS/log.txt

@@ -1,68 +0,0 @@
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INITIAL CONDITIONS in model <Controller.MainApp>
-		Initial State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INITIAL CONDITIONS in model <Controller.ObjectManager>
-		Initial State: <sccd.runtime.DEVS_statecharts_core.ObjectManagerState object at 0x104ab9850>
-		Next scheduled internal transition at time inf
-
-
-	INITIAL CONDITIONS in model <Controller.Tester>
-		Initial State: None
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(3) (name: /state1/state11)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1/state11 -> /state1/state12)
-
-			ENTER STATE in model <MainApp>
-			State: State(4) (name: /state1/state12)
-
-			EXIT STATE in model <MainApp>
-			State: State(4) (name: /state1/state12)
-
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1/state12 -> /state2)
-
-			ENTER STATE in model <MainApp>
-			State: State(5) (name: /state2)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-		Next scheduled internal transition at time inf
-

+ 0 - 129
tests/1.7) CompositeStateTest/PyDEVS/target.py

@@ -1,129 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration) and Sam Pieters (DEVS)
-
-Model author: Sam Pieters
-Model name:   AfterTransitionTest
-Model description:
-Test 3: Test if the composite state works as expected
-"""
-
-from sccd.runtime.DEVS_statecharts_core import *
-
-# package "AfterTransitionTest"
-
-class MainAppInstance(RuntimeClassBase):
-    def __init__(self, atomdevs, id, start_port_id):
-        RuntimeClassBase.__init__(self, atomdevs, id)
-        
-        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()
-        
-        # call user defined constructor
-        MainAppInstance.user_defined_constructor(self)
-        port_name = addInputPort("<narrow_cast>", start_port_id)
-        atomdevs.state.port_mappings[port_name] = id
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        
-        # state /state1/state10
-        self.states["/state1/state10"] = State(2, "/state1/state10", self)
-        
-        # state /state1/state11
-        self.states["/state1/state11"] = State(3, "/state1/state11", self)
-        
-        # state /state1/state12
-        self.states["/state1/state12"] = State(4, "/state1/state12", self)
-        
-        # state /state2
-        self.states["/state2"] = State(5, "/state2", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states["/state1"].addChild(self.states["/state1/state10"])
-        self.states["/state1"].addChild(self.states["/state1/state11"])
-        self.states["/state1"].addChild(self.states["/state1/state12"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        self.states["/state1"].default_state = self.states["/state1/state11"]
-        
-        # transition /state1/state10
-        _state1_state10_0 = Transition(self, self.states["/state1/state10"], [self.states["/state1/state10"]])
-        _state1_state10_0.setTrigger(None)
-        self.states["/state1/state10"].addTransition(_state1_state10_0)
-        
-        # transition /state1/state11
-        _state1_state11_0 = Transition(self, self.states["/state1/state11"], [self.states["/state1/state12"]])
-        _state1_state11_0.setTrigger(None)
-        self.states["/state1/state11"].addTransition(_state1_state11_0)
-        
-        # transition /state1/state12
-        _state1_state12_0 = Transition(self, self.states["/state1/state12"], [self.states["/state2"]])
-        _state1_state12_0.setTrigger(None)
-        self.states["/state1/state12"].addTransition(_state1_state12_0)
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class MainApp(ClassBase):
-    def __init__(self, name):
-        ClassBase.__init__(self, name)
-        self.input = self.addInPort("input")
-        new_instance = self.constructObject(0, 0, [])
-        self.state.instances[new_instance.instance_id] = new_instance
-        new_instance.start()
-        self.state.next_time = 0
-    
-    def constructObject(self, id, start_port_id, parameters):
-        new_instance = MainAppInstance(self, id, start_port_id)
-        return new_instance
-
-def instantiate(self, class_name, construct_params):
-    instance = {}
-    instance["name"] = class_name
-    if class_name == "MainApp":
-        self.narrow_cast_id = self.narrow_cast_id + 0
-        instance["associations"] = {}
-    else:
-        raise Exception("Cannot instantiate class " + class_name)
-    return instance
-ObjectManagerState.instantiate = instantiate
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
-        self.state = ObjectManagerState()
-        self.input = self.addInPort("input")
-        self.output["MainApp"] = self.addOutPort()
-        self.state.createInstance("MainApp", [])
-
-class Controller(CoupledDEVS):
-    def __init__(self, name):
-        CoupledDEVS.__init__(self, name)
-        self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomics = []
-        self.atomics.append(self.addSubModel(MainApp("MainApp")))
-        self.connectPorts(self.atomics[0].obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomics[0].obj_manager_in)

+ 0 - 7
tests/1.7) CompositeStateTest/Python/faulty_log.txt

@@ -1,7 +0,0 @@
-0.00 MainApp: exit /state1/state11
-0.00 MainApp: transition (/state1/state11 -> /state1/state12)
-0.00 MainApp: enter /state1/state12
-0.00 MainApp: exit /state1/state12
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1/state12 -> /state2)
-0.00 MainApp: enter /state2

+ 0 - 23
tests/1.7) CompositeStateTest/Python/log.txt

@@ -1,23 +0,0 @@
-__  Current Time:   0.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /state1/state11
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1/state11 -> /state1/state12)
-
-ENTER STATE in model <MainApp>
-		State: /state1/state12
-
-EXIT STATE in model <MainApp>
-		State: /state1/state12
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1/state12 -> /state2)
-
-ENTER STATE in model <MainApp>
-		State: /state2
-

+ 0 - 106
tests/1.7) CompositeStateTest/Python/target.py

@@ -1,106 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Model author: Sam Pieters
-Model name:   AfterTransitionTest
-Model description:
-Test 3: Test if the composite state works as expected
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "AfterTransitionTest"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        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()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        
-        # state /state1/state10
-        self.states["/state1/state10"] = State(2, "/state1/state10", self)
-        
-        # state /state1/state11
-        self.states["/state1/state11"] = State(3, "/state1/state11", self)
-        
-        # state /state1/state12
-        self.states["/state1/state12"] = State(4, "/state1/state12", self)
-        
-        # state /state2
-        self.states["/state2"] = State(5, "/state2", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states["/state1"].addChild(self.states["/state1/state10"])
-        self.states["/state1"].addChild(self.states["/state1/state11"])
-        self.states["/state1"].addChild(self.states["/state1/state12"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        self.states["/state1"].default_state = self.states["/state1/state11"]
-        
-        # transition /state1/state10
-        _state1_state10_0 = Transition(self, self.states["/state1/state10"], [self.states["/state1/state10"]])
-        _state1_state10_0.setTrigger(None)
-        self.states["/state1/state10"].addTransition(_state1_state10_0)
-        
-        # transition /state1/state11
-        _state1_state11_0 = Transition(self, self.states["/state1/state11"], [self.states["/state1/state12"]])
-        _state1_state11_0.setTrigger(None)
-        self.states["/state1/state11"].addTransition(_state1_state11_0)
-        
-        # transition /state1/state12
-        _state1_state12_0 = Transition(self, self.states["/state1/state12"], [self.states["/state2"]])
-        _state1_state12_0.setTrigger(None)
-        self.states["/state1/state12"].addTransition(_state1_state12_0)
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].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 == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, 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("MainApp", [])

+ 0 - 7
tests/1.8) ParallelStateTest/PyDEVS/faulty_log.txt

@@ -1,7 +0,0 @@
-0.00 MainApp: exit /state1/state12/state12
-0.00 MainApp: exit /state1/state11/state11
-0.00 MainApp: exit /state1/state12
-0.00 MainApp: exit /state1/state11
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /end_parallel)
-0.00 MainApp: enter /end_parallel

+ 0 - 68
tests/1.8) ParallelStateTest/PyDEVS/log.txt

@@ -1,68 +0,0 @@
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INITIAL CONDITIONS in model <Controller.MainApp>
-		Initial State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INITIAL CONDITIONS in model <Controller.ObjectManager>
-		Initial State: <sccd.runtime.DEVS_statecharts_core.ObjectManagerState object at 0x104a6f7a0>
-		Next scheduled internal transition at time inf
-
-
-	INITIAL CONDITIONS in model <Controller.Tester>
-		Initial State: None
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(5) (name: /state1/state12/state12)
-
-			EXIT STATE in model <MainApp>
-			State: State(3) (name: /state1/state11/state11)
-
-			EXIT STATE in model <MainApp>
-			State: State(4) (name: /state1/state12)
-
-			EXIT STATE in model <MainApp>
-			State: State(2) (name: /state1/state11)
-
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /end_parallel)
-
-			ENTER STATE in model <MainApp>
-			State: State(6) (name: /end_parallel)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-		Next scheduled internal transition at time inf
-

+ 0 - 150
tests/1.8) ParallelStateTest/PyDEVS/target.py

@@ -1,150 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration) and Sam Pieters (DEVS)
-
-Model author: Sam Pieters
-Model name:   AfterTransitionTest
-Model description:
-Test 2: Check if a statechart transitions after a certain time.
-"""
-
-from sccd.runtime.DEVS_statecharts_core import *
-
-# package "AfterTransitionTest"
-
-class MainAppInstance(RuntimeClassBase):
-    def __init__(self, atomdevs, id, start_port_id):
-        RuntimeClassBase.__init__(self, atomdevs, id)
-        
-        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()
-        
-        # call user defined constructor
-        MainAppInstance.user_defined_constructor(self)
-        port_name = addInputPort("<narrow_cast>", start_port_id)
-        atomdevs.state.port_mappings[port_name] = id
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = ParallelState(1, "/state1", self)
-        
-        # state /state1/state11
-        self.states["/state1/state11"] = State(2, "/state1/state11", self)
-        
-        # state /state1/state11/state11
-        self.states["/state1/state11/state11"] = State(3, "/state1/state11/state11", self)
-        self.states["/state1/state11/state11"].setEnter(self._state1_state11_state11_enter)
-        self.states["/state1/state11/state11"].setExit(self._state1_state11_state11_exit)
-        
-        # state /state1/state12
-        self.states["/state1/state12"] = State(4, "/state1/state12", self)
-        
-        # state /state1/state12/state12
-        self.states["/state1/state12/state12"] = State(5, "/state1/state12/state12", self)
-        self.states["/state1/state12/state12"].setEnter(self._state1_state12_state12_enter)
-        self.states["/state1/state12/state12"].setExit(self._state1_state12_state12_exit)
-        
-        # state /end_parallel
-        self.states["/end_parallel"] = State(6, "/end_parallel", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/end_parallel"])
-        self.states["/state1"].addChild(self.states["/state1/state11"])
-        self.states["/state1"].addChild(self.states["/state1/state12"])
-        self.states["/state1/state11"].addChild(self.states["/state1/state11/state11"])
-        self.states["/state1/state12"].addChild(self.states["/state1/state12/state12"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        self.states["/state1/state11"].default_state = self.states["/state1/state11/state11"]
-        self.states["/state1/state12"].default_state = self.states["/state1/state12/state12"]
-        
-        # transition /state1/state11/state11
-        _state1_state11_state11_0 = Transition(self, self.states["/state1/state11/state11"], [self.states["/state1/state11/state11"]])
-        _state1_state11_state11_0.setTrigger(Event("_0after"))
-        self.states["/state1/state11/state11"].addTransition(_state1_state11_state11_0)
-        
-        # transition /state1/state12/state12
-        _state1_state12_state12_0 = Transition(self, self.states["/state1/state12/state12"], [self.states["/state1/state12/state12"]])
-        _state1_state12_state12_0.setTrigger(Event("_1after"))
-        self.states["/state1/state12/state12"].addTransition(_state1_state12_state12_0)
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/end_parallel"]])
-        _state1_0.setTrigger(None)
-        self.states["/state1"].addTransition(_state1_0)
-    
-    def _state1_state11_state11_enter(self):
-        self.addTimer(0, 0.05)
-    
-    def _state1_state11_state11_exit(self):
-        self.removeTimer(0)
-    
-    def _state1_state12_state12_enter(self):
-        self.addTimer(1, 0.05)
-    
-    def _state1_state12_state12_exit(self):
-        self.removeTimer(1)
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class MainApp(ClassBase):
-    def __init__(self, name):
-        ClassBase.__init__(self, name)
-        self.input = self.addInPort("input")
-        new_instance = self.constructObject(0, 0, [])
-        self.state.instances[new_instance.instance_id] = new_instance
-        new_instance.start()
-        self.state.next_time = 0
-    
-    def constructObject(self, id, start_port_id, parameters):
-        new_instance = MainAppInstance(self, id, start_port_id)
-        return new_instance
-
-def instantiate(self, class_name, construct_params):
-    instance = {}
-    instance["name"] = class_name
-    if class_name == "MainApp":
-        self.narrow_cast_id = self.narrow_cast_id + 0
-        instance["associations"] = {}
-    else:
-        raise Exception("Cannot instantiate class " + class_name)
-    return instance
-ObjectManagerState.instantiate = instantiate
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
-        self.state = ObjectManagerState()
-        self.input = self.addInPort("input")
-        self.output["MainApp"] = self.addOutPort()
-        self.state.createInstance("MainApp", [])
-
-class Controller(CoupledDEVS):
-    def __init__(self, name):
-        CoupledDEVS.__init__(self, name)
-        self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomics = []
-        self.atomics.append(self.addSubModel(MainApp("MainApp")))
-        self.connectPorts(self.atomics[0].obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomics[0].obj_manager_in)

+ 0 - 7
tests/1.8) ParallelStateTest/Python/faulty_log.txt

@@ -1,7 +0,0 @@
-0.00 MainApp: exit /state1/state12/state12
-0.00 MainApp: exit /state1/state11/state11
-0.00 MainApp: exit /state1/state12
-0.00 MainApp: exit /state1/state11
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /end_parallel)
-0.00 MainApp: enter /end_parallel

+ 0 - 23
tests/1.8) ParallelStateTest/Python/log.txt

@@ -1,23 +0,0 @@
-__  Current Time:   0.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /state1/state12/state12
-
-EXIT STATE in model <MainApp>
-		State: /state1/state11/state11
-
-EXIT STATE in model <MainApp>
-		State: /state1/state12
-
-EXIT STATE in model <MainApp>
-		State: /state1/state11
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /end_parallel)
-
-ENTER STATE in model <MainApp>
-		State: /end_parallel
-

+ 0 - 127
tests/1.8) ParallelStateTest/Python/target.py

@@ -1,127 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Model author: Sam Pieters
-Model name:   AfterTransitionTest
-Model description:
-Test 2: Check if a statechart transitions after a certain time.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "AfterTransitionTest"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        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()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = ParallelState(1, "/state1", self)
-        
-        # state /state1/state11
-        self.states["/state1/state11"] = State(2, "/state1/state11", self)
-        
-        # state /state1/state11/state11
-        self.states["/state1/state11/state11"] = State(3, "/state1/state11/state11", self)
-        self.states["/state1/state11/state11"].setEnter(self._state1_state11_state11_enter)
-        self.states["/state1/state11/state11"].setExit(self._state1_state11_state11_exit)
-        
-        # state /state1/state12
-        self.states["/state1/state12"] = State(4, "/state1/state12", self)
-        
-        # state /state1/state12/state12
-        self.states["/state1/state12/state12"] = State(5, "/state1/state12/state12", self)
-        self.states["/state1/state12/state12"].setEnter(self._state1_state12_state12_enter)
-        self.states["/state1/state12/state12"].setExit(self._state1_state12_state12_exit)
-        
-        # state /end_parallel
-        self.states["/end_parallel"] = State(6, "/end_parallel", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/end_parallel"])
-        self.states["/state1"].addChild(self.states["/state1/state11"])
-        self.states["/state1"].addChild(self.states["/state1/state12"])
-        self.states["/state1/state11"].addChild(self.states["/state1/state11/state11"])
-        self.states["/state1/state12"].addChild(self.states["/state1/state12/state12"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        self.states["/state1/state11"].default_state = self.states["/state1/state11/state11"]
-        self.states["/state1/state12"].default_state = self.states["/state1/state12/state12"]
-        
-        # transition /state1/state11/state11
-        _state1_state11_state11_0 = Transition(self, self.states["/state1/state11/state11"], [self.states["/state1/state11/state11"]])
-        _state1_state11_state11_0.setTrigger(Event("_0after"))
-        self.states["/state1/state11/state11"].addTransition(_state1_state11_state11_0)
-        
-        # transition /state1/state12/state12
-        _state1_state12_state12_0 = Transition(self, self.states["/state1/state12/state12"], [self.states["/state1/state12/state12"]])
-        _state1_state12_state12_0.setTrigger(Event("_1after"))
-        self.states["/state1/state12/state12"].addTransition(_state1_state12_state12_0)
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/end_parallel"]])
-        _state1_0.setTrigger(None)
-        self.states["/state1"].addTransition(_state1_0)
-    
-    def _state1_state11_state11_enter(self):
-        self.addTimer(0, 0.05)
-    
-    def _state1_state11_state11_exit(self):
-        self.removeTimer(0)
-    
-    def _state1_state12_state12_enter(self):
-        self.addTimer(1, 0.05)
-    
-    def _state1_state12_state12_exit(self):
-        self.removeTimer(1)
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].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 == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, 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("MainApp", [])

+ 0 - 43
tests/10.0) TrafficLightTest/PyDEVS/faulty_log.txt

@@ -1,43 +0,0 @@
-0.00 MainApp: exit /creating_window
-0.00 MainApp: transition (/creating_window -> /creating_canvas)
-0.00 MainApp: enter /creating_canvas
-0.00 MainApp: exit /creating_canvas
-0.00 MainApp: transition (/creating_canvas -> /creating_trafficlight)
-0.00 MainApp: enter /creating_trafficlight
-0.00 MainApp: enter /creating_trafficlight/creating_greenlight
-0.00 MainApp: exit /creating_trafficlight/creating_greenlight
-0.00 MainApp: transition (/creating_trafficlight/creating_greenlight -> /creating_trafficlight/creating_yellowlight)
-0.00 MainApp: enter /creating_trafficlight/creating_yellowlight
-0.00 MainApp: exit /creating_trafficlight/creating_yellowlight
-0.00 MainApp: transition (/creating_trafficlight/creating_yellowlight -> /creating_trafficlight/creating_redlight)
-0.00 MainApp: enter /creating_trafficlight/creating_redlight
-0.00 MainApp: exit /creating_trafficlight/creating_redlight
-0.00 MainApp: exit /creating_trafficlight
-0.00 MainApp: transition (/creating_trafficlight/creating_redlight -> /creating_interrupt_button)
-0.00 MainApp: enter /creating_interrupt_button
-0.00 MainApp: exit /creating_interrupt_button
-0.00 MainApp: transition (/creating_interrupt_button -> /creating_quit_button)
-0.00 MainApp: enter /creating_quit_button
-0.00 MainApp: exit /creating_quit_button
-0.00 MainApp: transition (/creating_quit_button -> /on)
-0.00 MainApp: enter /on
-0.00 MainApp: enter /on/normal
-0.00 MainApp: enter /on/normal/red
-1.00 MainApp: exit /on/normal/red
-1.00 MainApp: exit /on/normal
-1.00 MainApp: transition (/on/normal -> /on/interrupted)
-1.00 MainApp: enter /on/interrupted
-1.00 MainApp: enter /on/interrupted/yellow
-1.50 MainApp: exit /on/interrupted/yellow
-1.50 MainApp: transition (/on/interrupted/yellow -> /on/interrupted/black)
-1.50 MainApp: enter /on/interrupted/black
-1.99 MainApp: exit /on/interrupted/black
-1.99 MainApp: exit /on/interrupted
-1.99 MainApp: transition (/on/interrupted -> /on/normal)
-1.99 MainApp: enter /on/normal
-1.99 MainApp: enter /on/normal/red
-3.00 MainApp: exit /on/normal/red
-3.00 MainApp: exit /on/normal
-3.00 MainApp: exit /on
-3.00 MainApp: transition (/on -> /off)
-3.00 MainApp: enter /off

+ 0 - 751
tests/10.0) TrafficLightTest/PyDEVS/log.txt

@@ -1,751 +0,0 @@
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INITIAL CONDITIONS in model <Controller.MainApp>
-		Initial State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INITIAL CONDITIONS in model <Controller.ObjectManager>
-		Initial State: <sccd.runtime.DEVS_statecharts_core.ObjectManagerState object at 0x104e5fd10>
-		Next scheduled internal transition at time inf
-
-
-	INITIAL CONDITIONS in model <Controller.Tester>
-		Initial State: None
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: create_window; port: ui; parameters: [100, 350, 'Traffic Light (history)', 'private_1_field_ui'])
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-			port <Test_field_ui>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	EXTERNAL TRANSITION in model <Controller.MainApp>
-		Input Port Configuration:
-			port <obj_manager_in>:
-			port <input>:
-			port <field_ui>:
-				['Event("window_created","private_1_field_ui",[0])']
-		New State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-			port <Test_field_ui>:
-				['Event("window_created","private_1_field_ui",[0])']
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /creating_window)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/creating_window -> /creating_canvas)
-
-			ENTER STATE in model <MainApp>
-			State: State(2) (name: /creating_canvas)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: create_canvas; port: ui; parameters: [0, 100, 250, {'background': '#222222'}, 'private_1_field_ui'])
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	EXTERNAL TRANSITION in model <Controller.MainApp>
-		Input Port Configuration:
-			port <obj_manager_in>:
-			port <input>:
-			port <field_ui>:
-				['Event("canvas_created","private_1_field_ui",[1])']
-		New State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-			port <Test_field_ui>:
-				['Event("canvas_created","private_1_field_ui",[1])']
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(2) (name: /creating_canvas)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/creating_canvas -> /creating_trafficlight)
-
-			ENTER STATE in model <MainApp>
-			State: State(3) (name: /creating_trafficlight)
-
-			ENTER STATE in model <MainApp>
-			State: State(4) (name: /creating_trafficlight/creating_greenlight)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: create_rectangle; port: ui; parameters: [1, 50, 50, 50, 50, {'fill': '#000'}, 'private_1_field_ui'])
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	EXTERNAL TRANSITION in model <Controller.MainApp>
-		Input Port Configuration:
-			port <obj_manager_in>:
-			port <input>:
-			port <field_ui>:
-				['Event("rectangle_created","private_1_field_ui",[1, 1])']
-		New State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-			port <Test_field_ui>:
-				['Event("rectangle_created","private_1_field_ui",[1, 1])']
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(4) (name: /creating_trafficlight/creating_greenlight)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/creating_trafficlight/creating_greenlight -> /creating_trafficlight/creating_yellowlight)
-
-			ENTER STATE in model <MainApp>
-			State: State(5) (name: /creating_trafficlight/creating_yellowlight)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: create_rectangle; port: ui; parameters: [1, 50, 110, 50, 50, {'fill': '#000'}, 'private_1_field_ui'])
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	EXTERNAL TRANSITION in model <Controller.MainApp>
-		Input Port Configuration:
-			port <obj_manager_in>:
-			port <input>:
-			port <field_ui>:
-				['Event("rectangle_created","private_1_field_ui",[1, 2])']
-		New State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-			port <Test_field_ui>:
-				['Event("rectangle_created","private_1_field_ui",[1, 2])']
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(5) (name: /creating_trafficlight/creating_yellowlight)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/creating_trafficlight/creating_yellowlight -> /creating_trafficlight/creating_redlight)
-
-			ENTER STATE in model <MainApp>
-			State: State(6) (name: /creating_trafficlight/creating_redlight)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: create_rectangle; port: ui; parameters: [1, 50, 170, 50, 50, {'fill': '#000'}, 'private_1_field_ui'])
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	EXTERNAL TRANSITION in model <Controller.MainApp>
-		Input Port Configuration:
-			port <obj_manager_in>:
-			port <input>:
-			port <field_ui>:
-				['Event("rectangle_created","private_1_field_ui",[1, 3])']
-		New State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-			port <Test_field_ui>:
-				['Event("rectangle_created","private_1_field_ui",[1, 3])']
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(6) (name: /creating_trafficlight/creating_redlight)
-
-			EXIT STATE in model <MainApp>
-			State: State(3) (name: /creating_trafficlight)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/creating_trafficlight/creating_redlight -> /creating_interrupt_button)
-
-			ENTER STATE in model <MainApp>
-			State: State(7) (name: /creating_interrupt_button)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: create_button; port: ui; parameters: [0, 'Police Interrupt', 'private_1_field_ui'])
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	EXTERNAL TRANSITION in model <Controller.MainApp>
-		Input Port Configuration:
-			port <obj_manager_in>:
-			port <input>:
-			port <field_ui>:
-				['Event("button_created","private_1_field_ui",[2])']
-		New State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-			port <Test_field_ui>:
-				['Event("button_created","private_1_field_ui",[2])']
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(7) (name: /creating_interrupt_button)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/creating_interrupt_button -> /creating_quit_button)
-
-			ENTER STATE in model <MainApp>
-			State: State(8) (name: /creating_quit_button)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: bind_event; port: ui; parameters: [2, '<Button>', 'interrupt_clicked', 'private_1_field_ui'])
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: create_button; port: ui; parameters: [0, 'Quit', 'private_1_field_ui'])
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	EXTERNAL TRANSITION in model <Controller.MainApp>
-		Input Port Configuration:
-			port <obj_manager_in>:
-			port <input>:
-			port <field_ui>:
-				['Event("button_created","private_1_field_ui",[3])']
-		New State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-			port <Test_field_ui>:
-				['Event("button_created","private_1_field_ui",[3])']
-		Next scheduled internal transition at time 1.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(8) (name: /creating_quit_button)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/creating_quit_button -> /on)
-
-			ENTER STATE in model <MainApp>
-			State: State(9) (name: /on)
-
-			ENTER STATE in model <MainApp>
-			State: State(10) (name: /on/normal)
-
-			ENTER STATE in model <MainApp>
-			State: State(11) (name: /on/normal/red)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: bind_event; port: ui; parameters: [3, '<Button>', 'quit_clicked', 'private_1_field_ui'])
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: set_element_color; port: ui; parameters: [1, 2, 'black'])
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: set_element_color; port: ui; parameters: [1, 3, 'red'])
-		Next scheduled internal transition at time 3.000000
-
-
-__  Current Time:   1.000000 __________________________________________ 
-
-
-	EXTERNAL TRANSITION in model <Controller.MainApp>
-		Input Port Configuration:
-			port <obj_manager_in>:
-			port <input>:
-			port <field_ui>:
-				['Event("interrupt_clicked","private_1_field_ui",[58, 24, 1])']
-		New State: 
-		Next scheduled internal transition at time 1.000000
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-			port <Test_field_ui>:
-				['Event("interrupt_clicked","private_1_field_ui",[58, 24, 1])']
-		Next scheduled internal transition at time 1.990000
-
-
-__  Current Time:   1.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(11) (name: /on/normal/red)
-
-			EXIT STATE in model <MainApp>
-			State: State(10) (name: /on/normal)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on/normal -> /on/interrupted)
-
-			ENTER STATE in model <MainApp>
-			State: State(14) (name: /on/interrupted)
-
-			ENTER STATE in model <MainApp>
-			State: State(15) (name: /on/interrupted/yellow)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-		Next scheduled internal transition at time 1.000000
-
-
-__  Current Time:   1.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: set_element_color; port: ui; parameters: [1, 1, 'black'])
-		Next scheduled internal transition at time 1.000000
-
-
-__  Current Time:   1.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: set_element_color; port: ui; parameters: [1, 2, 'black'])
-		Next scheduled internal transition at time 1.000000
-
-
-__  Current Time:   1.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: set_element_color; port: ui; parameters: [1, 3, 'black'])
-		Next scheduled internal transition at time 1.000000
-
-
-__  Current Time:   1.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: set_element_color; port: ui; parameters: [1, 2, 'yellow'])
-		Next scheduled internal transition at time 1.500000
-
-
-__  Current Time:   1.500000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(15) (name: /on/interrupted/yellow)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on/interrupted/yellow -> /on/interrupted/black)
-
-			ENTER STATE in model <MainApp>
-			State: State(16) (name: /on/interrupted/black)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-		Next scheduled internal transition at time 1.500000
-
-
-__  Current Time:   1.500000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: set_element_color; port: ui; parameters: [1, 2, 'black'])
-		Next scheduled internal transition at time 2.000000
-
-
-__  Current Time:   1.990000 __________________________________________ 
-
-
-	EXTERNAL TRANSITION in model <Controller.MainApp>
-		Input Port Configuration:
-			port <obj_manager_in>:
-			port <input>:
-			port <field_ui>:
-				['Event("interrupt_clicked","private_1_field_ui",[58, 24, 1])']
-		New State: 
-		Next scheduled internal transition at time 1.990000
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-			port <Test_field_ui>:
-				['Event("interrupt_clicked","private_1_field_ui",[58, 24, 1])']
-		Next scheduled internal transition at time 3.000000
-
-
-__  Current Time:   1.990000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(16) (name: /on/interrupted/black)
-
-			EXIT STATE in model <MainApp>
-			State: State(14) (name: /on/interrupted)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on/interrupted -> /on/normal)
-
-			ENTER STATE in model <MainApp>
-			State: State(10) (name: /on/normal)
-
-			ENTER STATE in model <MainApp>
-			State: State(11) (name: /on/normal/red)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-		Next scheduled internal transition at time 1.990000
-
-
-__  Current Time:   1.990000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: set_element_color; port: ui; parameters: [1, 2, 'black'])
-		Next scheduled internal transition at time 1.990000
-
-
-__  Current Time:   1.990000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: set_element_color; port: ui; parameters: [1, 3, 'red'])
-		Next scheduled internal transition at time 4.990000
-
-
-__  Current Time:   3.000000 __________________________________________ 
-
-
-	EXTERNAL TRANSITION in model <Controller.MainApp>
-		Input Port Configuration:
-			port <obj_manager_in>:
-			port <input>:
-			port <field_ui>:
-				['Event("quit_clicked","private_1_field_ui",[58, 45, 1])']
-		New State: 
-		Next scheduled internal transition at time 3.000000
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-			port <Test_field_ui>:
-				['Event("quit_clicked","private_1_field_ui",[58, 45, 1])']
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   3.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(11) (name: /on/normal/red)
-
-			EXIT STATE in model <MainApp>
-			State: State(10) (name: /on/normal)
-
-			EXIT STATE in model <MainApp>
-			State: State(9) (name: /on)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/on -> /off)
-
-			ENTER STATE in model <MainApp>
-			State: State(17) (name: /off)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-		Next scheduled internal transition at time 3.000000
-
-
-__  Current Time:   3.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: set_element_color; port: ui; parameters: [1, 1, 'black'])
-		Next scheduled internal transition at time 3.000000
-
-
-__  Current Time:   3.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: set_element_color; port: ui; parameters: [1, 2, 'black'])
-		Next scheduled internal transition at time 3.000000
-
-
-__  Current Time:   3.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-				(event name: set_element_color; port: ui; parameters: [1, 3, 'black'])
-		Next scheduled internal transition at time inf
-

+ 0 - 409
tests/10.0) TrafficLightTest/PyDEVS/target.py

@@ -1,409 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration) and Sam Pieters (DEVS)
-
-Model author: Sam Pieters
-Model name:   TrafficLight
-Model description:
-Tkinter frame with Traffic light in a single statechart.
-"""
-
-from sccd.runtime.DEVS_statecharts_core import *
-from sccd.runtime.libs import ui_v2 as ui
-CANVAS_DIMS = (100, 350)
-
-# package "TrafficLight"
-
-class MainAppInstance(RuntimeClassBase):
-    def __init__(self, atomdevs, id, start_port_id):
-        RuntimeClassBase.__init__(self, atomdevs, id)
-        
-        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.window_id = None
-        self.canvas_id = None
-        self.green_id = None
-        self.yellow_id = None
-        self.red_id = None
-        self.police_button_id = None
-        
-        # call user defined constructor
-        MainAppInstance.user_defined_constructor(self)
-        port_name = addInputPort("<narrow_cast>", start_port_id)
-        atomdevs.state.port_mappings[port_name] = id
-        port_name = addInputPort("field_ui", start_port_id + 1)
-        atomdevs.state.port_mappings[port_name] = id
-        self.inports["field_ui"] = port_name
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /creating_window
-        self.states["/creating_window"] = State(1, "/creating_window", self)
-        self.states["/creating_window"].setEnter(self._creating_window_enter)
-        
-        # state /creating_canvas
-        self.states["/creating_canvas"] = State(2, "/creating_canvas", self)
-        self.states["/creating_canvas"].setEnter(self._creating_canvas_enter)
-        
-        # state /creating_trafficlight
-        self.states["/creating_trafficlight"] = State(3, "/creating_trafficlight", self)
-        
-        # state /creating_trafficlight/creating_greenlight
-        self.states["/creating_trafficlight/creating_greenlight"] = State(4, "/creating_trafficlight/creating_greenlight", self)
-        self.states["/creating_trafficlight/creating_greenlight"].setEnter(self._creating_trafficlight_creating_greenlight_enter)
-        
-        # state /creating_trafficlight/creating_yellowlight
-        self.states["/creating_trafficlight/creating_yellowlight"] = State(5, "/creating_trafficlight/creating_yellowlight", self)
-        self.states["/creating_trafficlight/creating_yellowlight"].setEnter(self._creating_trafficlight_creating_yellowlight_enter)
-        
-        # state /creating_trafficlight/creating_redlight
-        self.states["/creating_trafficlight/creating_redlight"] = State(6, "/creating_trafficlight/creating_redlight", self)
-        self.states["/creating_trafficlight/creating_redlight"].setEnter(self._creating_trafficlight_creating_redlight_enter)
-        
-        # state /creating_interrupt_button
-        self.states["/creating_interrupt_button"] = State(7, "/creating_interrupt_button", self)
-        self.states["/creating_interrupt_button"].setEnter(self._creating_interrupt_button_enter)
-        
-        # state /creating_quit_button
-        self.states["/creating_quit_button"] = State(8, "/creating_quit_button", self)
-        self.states["/creating_quit_button"].setEnter(self._creating_quit_button_enter)
-        
-        # state /on
-        self.states["/on"] = State(9, "/on", self)
-        
-        # state /on/normal
-        self.states["/on/normal"] = State(10, "/on/normal", self)
-        
-        # state /on/normal/red
-        self.states["/on/normal/red"] = State(11, "/on/normal/red", self)
-        self.states["/on/normal/red"].setEnter(self._on_normal_red_enter)
-        self.states["/on/normal/red"].setExit(self._on_normal_red_exit)
-        
-        # state /on/normal/green
-        self.states["/on/normal/green"] = State(12, "/on/normal/green", self)
-        self.states["/on/normal/green"].setEnter(self._on_normal_green_enter)
-        self.states["/on/normal/green"].setExit(self._on_normal_green_exit)
-        
-        # state /on/normal/yellow
-        self.states["/on/normal/yellow"] = State(13, "/on/normal/yellow", self)
-        self.states["/on/normal/yellow"].setEnter(self._on_normal_yellow_enter)
-        self.states["/on/normal/yellow"].setExit(self._on_normal_yellow_exit)
-        
-        # state /on/interrupted
-        self.states["/on/interrupted"] = State(14, "/on/interrupted", self)
-        
-        # state /on/interrupted/yellow
-        self.states["/on/interrupted/yellow"] = State(15, "/on/interrupted/yellow", self)
-        self.states["/on/interrupted/yellow"].setEnter(self._on_interrupted_yellow_enter)
-        self.states["/on/interrupted/yellow"].setExit(self._on_interrupted_yellow_exit)
-        
-        # state /on/interrupted/black
-        self.states["/on/interrupted/black"] = State(16, "/on/interrupted/black", self)
-        self.states["/on/interrupted/black"].setEnter(self._on_interrupted_black_enter)
-        self.states["/on/interrupted/black"].setExit(self._on_interrupted_black_exit)
-        
-        # state /off
-        self.states["/off"] = State(17, "/off", self)
-        self.states["/off"].setEnter(self._off_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/creating_window"])
-        self.states[""].addChild(self.states["/creating_canvas"])
-        self.states[""].addChild(self.states["/creating_trafficlight"])
-        self.states[""].addChild(self.states["/creating_interrupt_button"])
-        self.states[""].addChild(self.states["/creating_quit_button"])
-        self.states[""].addChild(self.states["/on"])
-        self.states[""].addChild(self.states["/off"])
-        self.states["/creating_trafficlight"].addChild(self.states["/creating_trafficlight/creating_greenlight"])
-        self.states["/creating_trafficlight"].addChild(self.states["/creating_trafficlight/creating_yellowlight"])
-        self.states["/creating_trafficlight"].addChild(self.states["/creating_trafficlight/creating_redlight"])
-        self.states["/on"].addChild(self.states["/on/normal"])
-        self.states["/on"].addChild(self.states["/on/interrupted"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/red"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/green"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/yellow"])
-        self.states["/on/interrupted"].addChild(self.states["/on/interrupted/yellow"])
-        self.states["/on/interrupted"].addChild(self.states["/on/interrupted/black"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/creating_window"]
-        self.states["/creating_trafficlight"].default_state = self.states["/creating_trafficlight/creating_greenlight"]
-        self.states["/on"].default_state = self.states["/on/normal"]
-        self.states["/on/normal"].default_state = self.states["/on/normal/red"]
-        self.states["/on/interrupted"].default_state = self.states["/on/interrupted/yellow"]
-        
-        # transition /creating_window
-        _creating_window_0 = Transition(self, self.states["/creating_window"], [self.states["/creating_canvas"]])
-        _creating_window_0.setAction(self._creating_window_0_exec)
-        _creating_window_0.setTrigger(Event("window_created", None))
-        self.states["/creating_window"].addTransition(_creating_window_0)
-        
-        # transition /creating_canvas
-        _creating_canvas_0 = Transition(self, self.states["/creating_canvas"], [self.states["/creating_trafficlight"]])
-        _creating_canvas_0.setAction(self._creating_canvas_0_exec)
-        _creating_canvas_0.setTrigger(Event("canvas_created", None))
-        self.states["/creating_canvas"].addTransition(_creating_canvas_0)
-        
-        # transition /creating_trafficlight/creating_greenlight
-        _creating_trafficlight_creating_greenlight_0 = Transition(self, self.states["/creating_trafficlight/creating_greenlight"], [self.states["/creating_trafficlight/creating_yellowlight"]])
-        _creating_trafficlight_creating_greenlight_0.setAction(self._creating_trafficlight_creating_greenlight_0_exec)
-        _creating_trafficlight_creating_greenlight_0.setTrigger(Event("rectangle_created", None))
-        self.states["/creating_trafficlight/creating_greenlight"].addTransition(_creating_trafficlight_creating_greenlight_0)
-        
-        # transition /creating_trafficlight/creating_yellowlight
-        _creating_trafficlight_creating_yellowlight_0 = Transition(self, self.states["/creating_trafficlight/creating_yellowlight"], [self.states["/creating_trafficlight/creating_redlight"]])
-        _creating_trafficlight_creating_yellowlight_0.setAction(self._creating_trafficlight_creating_yellowlight_0_exec)
-        _creating_trafficlight_creating_yellowlight_0.setTrigger(Event("rectangle_created", None))
-        self.states["/creating_trafficlight/creating_yellowlight"].addTransition(_creating_trafficlight_creating_yellowlight_0)
-        
-        # transition /creating_trafficlight/creating_redlight
-        _creating_trafficlight_creating_redlight_0 = Transition(self, self.states["/creating_trafficlight/creating_redlight"], [self.states["/creating_interrupt_button"]])
-        _creating_trafficlight_creating_redlight_0.setAction(self._creating_trafficlight_creating_redlight_0_exec)
-        _creating_trafficlight_creating_redlight_0.setTrigger(Event("rectangle_created", None))
-        self.states["/creating_trafficlight/creating_redlight"].addTransition(_creating_trafficlight_creating_redlight_0)
-        
-        # transition /creating_interrupt_button
-        _creating_interrupt_button_0 = Transition(self, self.states["/creating_interrupt_button"], [self.states["/creating_quit_button"]])
-        _creating_interrupt_button_0.setAction(self._creating_interrupt_button_0_exec)
-        _creating_interrupt_button_0.setTrigger(Event("button_created", None))
-        self.states["/creating_interrupt_button"].addTransition(_creating_interrupt_button_0)
-        
-        # transition /creating_quit_button
-        _creating_quit_button_0 = Transition(self, self.states["/creating_quit_button"], [self.states["/on"]])
-        _creating_quit_button_0.setAction(self._creating_quit_button_0_exec)
-        _creating_quit_button_0.setTrigger(Event("button_created", None))
-        self.states["/creating_quit_button"].addTransition(_creating_quit_button_0)
-        
-        # transition /on/normal/red
-        _on_normal_red_0 = Transition(self, self.states["/on/normal/red"], [self.states["/on/normal/green"]])
-        _on_normal_red_0.setTrigger(Event("_0after"))
-        self.states["/on/normal/red"].addTransition(_on_normal_red_0)
-        
-        # transition /on/normal/green
-        _on_normal_green_0 = Transition(self, self.states["/on/normal/green"], [self.states["/on/normal/yellow"]])
-        _on_normal_green_0.setTrigger(Event("_1after"))
-        self.states["/on/normal/green"].addTransition(_on_normal_green_0)
-        
-        # transition /on/normal/yellow
-        _on_normal_yellow_0 = Transition(self, self.states["/on/normal/yellow"], [self.states["/on/normal/red"]])
-        _on_normal_yellow_0.setTrigger(Event("_2after"))
-        self.states["/on/normal/yellow"].addTransition(_on_normal_yellow_0)
-        
-        # transition /on/interrupted/yellow
-        _on_interrupted_yellow_0 = Transition(self, self.states["/on/interrupted/yellow"], [self.states["/on/interrupted/black"]])
-        _on_interrupted_yellow_0.setTrigger(Event("_3after"))
-        self.states["/on/interrupted/yellow"].addTransition(_on_interrupted_yellow_0)
-        
-        # transition /on/interrupted/black
-        _on_interrupted_black_0 = Transition(self, self.states["/on/interrupted/black"], [self.states["/on/interrupted/yellow"]])
-        _on_interrupted_black_0.setTrigger(Event("_4after"))
-        self.states["/on/interrupted/black"].addTransition(_on_interrupted_black_0)
-        
-        # transition /on
-        _on_0 = Transition(self, self.states["/on"], [self.states["/off"]])
-        _on_0.setTrigger(Event("quit_clicked", self.getInPortName("field_ui")))
-        _on_0.setGuard(self._on_0_guard)
-        self.states["/on"].addTransition(_on_0)
-        
-        # transition /on/normal
-        _on_normal_0 = Transition(self, self.states["/on/normal"], [self.states["/on/interrupted"]])
-        _on_normal_0.setAction(self._on_normal_0_exec)
-        _on_normal_0.setTrigger(Event("interrupt_clicked", self.getInPortName("field_ui")))
-        _on_normal_0.setGuard(self._on_normal_0_guard)
-        self.states["/on/normal"].addTransition(_on_normal_0)
-        
-        # transition /on/interrupted
-        _on_interrupted_0 = Transition(self, self.states["/on/interrupted"], [self.states["/on/normal"]])
-        _on_interrupted_0.setTrigger(Event("interrupt_clicked", self.getInPortName("field_ui")))
-        _on_interrupted_0.setGuard(self._on_interrupted_0_guard)
-        self.states["/on/interrupted"].addTransition(_on_interrupted_0)
-    
-    def _creating_window_enter(self):
-        self.big_step.outputEvent(Event("create_window", self.getOutPortName("ui"), [CANVAS_DIMS[0], CANVAS_DIMS[1], "Traffic Light (history)", self.inports['field_ui']]))
-    
-    def _creating_canvas_enter(self):
-        self.big_step.outputEvent(Event("create_canvas", self.getOutPortName("ui"), [self.window_id, CANVAS_DIMS[0], CANVAS_DIMS[1] - 100, {'background':'#222222'}, self.inports['field_ui']]))
-    
-    def _creating_trafficlight_creating_greenlight_enter(self):
-        self.big_step.outputEvent(Event("create_rectangle", self.getOutPortName("ui"), [self.canvas_id, 50, 50, 50, 50, {'fill':'#000'}, self.inports['field_ui']]))
-    
-    def _creating_trafficlight_creating_yellowlight_enter(self):
-        self.big_step.outputEvent(Event("create_rectangle", self.getOutPortName("ui"), [self.canvas_id, 50, 110, 50, 50, {'fill':'#000'}, self.inports['field_ui']]))
-    
-    def _creating_trafficlight_creating_redlight_enter(self):
-        self.big_step.outputEvent(Event("create_rectangle", self.getOutPortName("ui"), [self.canvas_id, 50, 170, 50, 50, {'fill':'#000'}, self.inports['field_ui']]))
-    
-    def _creating_interrupt_button_enter(self):
-        self.big_step.outputEvent(Event("create_button", self.getOutPortName("ui"), [self.window_id, 'Police Interrupt', self.inports['field_ui']]))
-    
-    def _creating_quit_button_enter(self):
-        self.big_step.outputEvent(Event("create_button", self.getOutPortName("ui"), [self.window_id, 'Quit', self.inports['field_ui']]))
-    
-    def _on_normal_red_enter(self):
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.yellow_id, 'black']))
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.red_id, 'red']))
-        self.addTimer(0, 3)
-    
-    def _on_normal_red_exit(self):
-        self.removeTimer(0)
-    
-    def _on_normal_green_enter(self):
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.red_id, 'black']))
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.green_id, 'green']))
-        self.addTimer(1, 2)
-    
-    def _on_normal_green_exit(self):
-        self.removeTimer(1)
-    
-    def _on_normal_yellow_enter(self):
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.green_id, 'black']))
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.yellow_id, 'yellow']))
-        self.addTimer(2, 1)
-    
-    def _on_normal_yellow_exit(self):
-        self.removeTimer(2)
-    
-    def _on_interrupted_yellow_enter(self):
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.yellow_id, 'yellow']))
-        self.addTimer(3, .5)
-    
-    def _on_interrupted_yellow_exit(self):
-        self.removeTimer(3)
-    
-    def _on_interrupted_black_enter(self):
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.yellow_id, 'black']))
-        self.addTimer(4, .5)
-    
-    def _on_interrupted_black_exit(self):
-        self.removeTimer(4)
-    
-    def _off_enter(self):
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.green_id, 'black']))
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.yellow_id, 'black']))
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.red_id, 'black']))
-    
-    def _on_0_guard(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        return button == ui.MOUSE_BUTTONS.LEFT
-    
-    def _on_normal_0_exec(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.green_id, 'black']))
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.yellow_id, 'black']))
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.red_id, 'black']))
-    
-    def _on_normal_0_guard(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        return button == ui.MOUSE_BUTTONS.LEFT
-    
-    def _on_interrupted_0_guard(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        return button == ui.MOUSE_BUTTONS.LEFT
-    
-    def _creating_window_0_exec(self, parameters):
-        window_id = parameters[0]
-        self.window_id = window_id
-    
-    def _creating_canvas_0_exec(self, parameters):
-        canvas_id = parameters[0]
-        self.canvas_id = canvas_id
-    
-    def _creating_trafficlight_creating_greenlight_0_exec(self, parameters):
-        canvas_id = parameters[0]
-        green_id = parameters[1]
-        self.green_id = green_id
-    
-    def _creating_trafficlight_creating_yellowlight_0_exec(self, parameters):
-        canvas_id = parameters[0]
-        yellow_id = parameters[1]
-        self.yellow_id = yellow_id
-    
-    def _creating_trafficlight_creating_redlight_0_exec(self, parameters):
-        canvas_id = parameters[0]
-        red_id = parameters[1]
-        self.red_id = red_id
-    
-    def _creating_interrupt_button_0_exec(self, parameters):
-        button_id = parameters[0]
-        self.police_button_id = button_id
-        self.big_step.outputEvent(Event("bind_event", self.getOutPortName("ui"), [button_id, ui.EVENTS.MOUSE_CLICK, "interrupt_clicked", self.inports['field_ui']]))
-    
-    def _creating_quit_button_0_exec(self, parameters):
-        button_id = parameters[0]
-        self.quit_button_id = button_id
-        self.big_step.outputEvent(Event("bind_event", self.getOutPortName("ui"), [button_id, ui.EVENTS.MOUSE_CLICK, "quit_clicked", self.inports['field_ui']]))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/creating_window"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class MainApp(ClassBase):
-    def __init__(self, name):
-        ClassBase.__init__(self, name)
-        self.input = self.addInPort("input")
-        self.glob_outputs["ui"] = self.addOutPort("ui")
-        self.field_ui = self.addInPort("field_ui")
-        new_instance = self.constructObject(0, 0, [])
-        self.state.instances[new_instance.instance_id] = new_instance
-        new_instance.start()
-        self.state.next_time = 0
-    
-    def constructObject(self, id, start_port_id, parameters):
-        new_instance = MainAppInstance(self, id, start_port_id)
-        return new_instance
-
-def instantiate(self, class_name, construct_params):
-    instance = {}
-    instance["name"] = class_name
-    if class_name == "MainApp":
-        self.narrow_cast_id = self.narrow_cast_id + 1
-        instance["associations"] = {}
-    else:
-        raise Exception("Cannot instantiate class " + class_name)
-    return instance
-ObjectManagerState.instantiate = instantiate
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
-        self.state = ObjectManagerState()
-        self.input = self.addInPort("input")
-        self.output["MainApp"] = self.addOutPort()
-        self.state.createInstance("MainApp", [])
-
-class Controller(CoupledDEVS):
-    def __init__(self, name):
-        CoupledDEVS.__init__(self, name)
-        self.out_ui = self.addOutPort("ui")
-        self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomics = []
-        self.atomics.append(self.addSubModel(MainApp("MainApp")))
-        self.connectPorts(self.atomics[0].obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomics[0].obj_manager_in)
-        self.connectPorts(self.atomics[0].glob_outputs["ui"], self.out_ui)

+ 0 - 43
tests/10.0) TrafficLightTest/Python/faulty_log.txt

@@ -1,43 +0,0 @@
-0.00 MainApp: exit /creating_window
-0.00 MainApp: transition (/creating_window -> /creating_canvas)
-0.00 MainApp: enter /creating_canvas
-0.00 MainApp: exit /creating_canvas
-0.00 MainApp: transition (/creating_canvas -> /creating_trafficlight)
-0.00 MainApp: enter /creating_trafficlight
-0.00 MainApp: enter /creating_trafficlight/creating_greenlight
-0.00 MainApp: exit /creating_trafficlight/creating_greenlight
-0.00 MainApp: transition (/creating_trafficlight/creating_greenlight -> /creating_trafficlight/creating_yellowlight)
-0.00 MainApp: enter /creating_trafficlight/creating_yellowlight
-0.00 MainApp: exit /creating_trafficlight/creating_yellowlight
-0.00 MainApp: transition (/creating_trafficlight/creating_yellowlight -> /creating_trafficlight/creating_redlight)
-0.00 MainApp: enter /creating_trafficlight/creating_redlight
-0.00 MainApp: exit /creating_trafficlight/creating_redlight
-0.00 MainApp: exit /creating_trafficlight
-0.00 MainApp: transition (/creating_trafficlight/creating_redlight -> /creating_interrupt_button)
-0.00 MainApp: enter /creating_interrupt_button
-0.00 MainApp: exit /creating_interrupt_button
-0.00 MainApp: transition (/creating_interrupt_button -> /creating_quit_button)
-0.00 MainApp: enter /creating_quit_button
-0.00 MainApp: exit /creating_quit_button
-0.00 MainApp: transition (/creating_quit_button -> /on)
-0.00 MainApp: enter /on
-0.00 MainApp: enter /on/normal
-0.00 MainApp: enter /on/normal/red
-1.00 MainApp: exit /on/normal/red
-1.00 MainApp: exit /on/normal
-1.00 MainApp: transition (/on/normal -> /on/interrupted)
-1.00 MainApp: enter /on/interrupted
-1.00 MainApp: enter /on/interrupted/yellow
-1.50 MainApp: exit /on/interrupted/yellow
-1.50 MainApp: transition (/on/interrupted/yellow -> /on/interrupted/black)
-1.50 MainApp: enter /on/interrupted/black
-1.99 MainApp: exit /on/interrupted/black
-1.99 MainApp: exit /on/interrupted
-1.99 MainApp: transition (/on/interrupted -> /on/normal)
-1.99 MainApp: enter /on/normal
-1.99 MainApp: enter /on/normal/red
-3.00 MainApp: exit /on/normal/red
-3.00 MainApp: exit /on/normal
-3.00 MainApp: exit /on
-3.00 MainApp: transition (/on -> /off)
-3.00 MainApp: enter /off

+ 0 - 282
tests/10.0) TrafficLightTest/Python/log.txt

@@ -1,282 +0,0 @@
-__  Current Time:   0.000000 __________________________________________ 
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: create_window; port: ui; parameters: [100, 350, 'Traffic Light (history)', 'private_1_field_ui'])
-
-INPUT EVENT from <ObjectManager>
-	\Type: cd
-	\Event: (event name: window_created; port: private_1_field_ui; parameters: [0])
-
-INPUT EVENT from port <private_1_field_ui>
-	\Type: field_ui
-	\Event: (event name: window_created; port: private_1_field_ui; parameters: [0])
-
-INPUT EVENT from <ObjectManager>
-	\Type: cd
-	\Event: (event name: canvas_created; port: private_1_field_ui; parameters: [1])
-
-INPUT EVENT from port <private_1_field_ui>
-	\Type: field_ui
-	\Event: (event name: canvas_created; port: private_1_field_ui; parameters: [1])
-
-INPUT EVENT from <ObjectManager>
-	\Type: cd
-	\Event: (event name: rectangle_created; port: private_1_field_ui; parameters: [1, 1])
-
-INPUT EVENT from port <private_1_field_ui>
-	\Type: field_ui
-	\Event: (event name: rectangle_created; port: private_1_field_ui; parameters: [1, 1])
-
-INPUT EVENT from <ObjectManager>
-	\Type: cd
-	\Event: (event name: rectangle_created; port: private_1_field_ui; parameters: [1, 2])
-
-INPUT EVENT from port <private_1_field_ui>
-	\Type: field_ui
-	\Event: (event name: rectangle_created; port: private_1_field_ui; parameters: [1, 2])
-
-INPUT EVENT from <ObjectManager>
-	\Type: cd
-	\Event: (event name: rectangle_created; port: private_1_field_ui; parameters: [1, 3])
-
-INPUT EVENT from port <private_1_field_ui>
-	\Type: field_ui
-	\Event: (event name: rectangle_created; port: private_1_field_ui; parameters: [1, 3])
-
-INPUT EVENT from <ObjectManager>
-	\Type: cd
-	\Event: (event name: button_created; port: private_1_field_ui; parameters: [2])
-
-INPUT EVENT from port <private_1_field_ui>
-	\Type: field_ui
-	\Event: (event name: button_created; port: private_1_field_ui; parameters: [2])
-
-INPUT EVENT from <ObjectManager>
-	\Type: cd
-	\Event: (event name: button_created; port: private_1_field_ui; parameters: [3])
-
-INPUT EVENT from port <private_1_field_ui>
-	\Type: field_ui
-	\Event: (event name: button_created; port: private_1_field_ui; parameters: [3])
-
-INPUT EVENT from <ObjectManager>
-	\Type: cd
-	\Event: (event name: interrupt_clicked; port: private_1_field_ui; parameters: [58, 24, 1])
-
-INPUT EVENT from port <private_1_field_ui>
-	\Type: field_ui
-	\Event: (event name: interrupt_clicked; port: private_1_field_ui; parameters: [58, 24, 1])
-
-INPUT EVENT from <ObjectManager>
-	\Type: cd
-	\Event: (event name: interrupt_clicked; port: private_1_field_ui; parameters: [58, 24, 1])
-
-INPUT EVENT from port <private_1_field_ui>
-	\Type: field_ui
-	\Event: (event name: interrupt_clicked; port: private_1_field_ui; parameters: [58, 24, 1])
-
-INPUT EVENT from <ObjectManager>
-	\Type: cd
-	\Event: (event name: quit_clicked; port: private_1_field_ui; parameters: [58, 45, 1])
-
-INPUT EVENT from port <private_1_field_ui>
-	\Type: field_ui
-	\Event: (event name: quit_clicked; port: private_1_field_ui; parameters: [58, 45, 1])
-
-EXIT STATE in model <MainApp>
-		State: /creating_window
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/creating_window -> /creating_canvas)
-
-ENTER STATE in model <MainApp>
-		State: /creating_canvas
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: create_canvas; port: ui; parameters: [0, 100, 250, {'background': '#222222'}, 'private_1_field_ui'])
-
-EXIT STATE in model <MainApp>
-		State: /creating_canvas
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/creating_canvas -> /creating_trafficlight)
-
-ENTER STATE in model <MainApp>
-		State: /creating_trafficlight
-
-ENTER STATE in model <MainApp>
-		State: /creating_trafficlight/creating_greenlight
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: create_rectangle; port: ui; parameters: [1, 50, 50, 50, 50, {'fill': '#000'}, 'private_1_field_ui'])
-
-EXIT STATE in model <MainApp>
-		State: /creating_trafficlight/creating_greenlight
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/creating_trafficlight/creating_greenlight -> /creating_trafficlight/creating_yellowlight)
-
-ENTER STATE in model <MainApp>
-		State: /creating_trafficlight/creating_yellowlight
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: create_rectangle; port: ui; parameters: [1, 50, 110, 50, 50, {'fill': '#000'}, 'private_1_field_ui'])
-
-EXIT STATE in model <MainApp>
-		State: /creating_trafficlight/creating_yellowlight
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/creating_trafficlight/creating_yellowlight -> /creating_trafficlight/creating_redlight)
-
-ENTER STATE in model <MainApp>
-		State: /creating_trafficlight/creating_redlight
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: create_rectangle; port: ui; parameters: [1, 50, 170, 50, 50, {'fill': '#000'}, 'private_1_field_ui'])
-
-EXIT STATE in model <MainApp>
-		State: /creating_trafficlight/creating_redlight
-
-EXIT STATE in model <MainApp>
-		State: /creating_trafficlight
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/creating_trafficlight/creating_redlight -> /creating_interrupt_button)
-
-ENTER STATE in model <MainApp>
-		State: /creating_interrupt_button
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: create_button; port: ui; parameters: [0, 'Police Interrupt', 'private_1_field_ui'])
-
-EXIT STATE in model <MainApp>
-		State: /creating_interrupt_button
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/creating_interrupt_button -> /creating_quit_button)
-
-ENTER STATE in model <MainApp>
-		State: /creating_quit_button
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: bind_event; port: ui; parameters: [2, '<Button>', 'interrupt_clicked', 'private_1_field_ui'])
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: create_button; port: ui; parameters: [0, 'Quit', 'private_1_field_ui'])
-
-EXIT STATE in model <MainApp>
-		State: /creating_quit_button
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/creating_quit_button -> /on)
-
-ENTER STATE in model <MainApp>
-		State: /on
-
-ENTER STATE in model <MainApp>
-		State: /on/normal
-
-ENTER STATE in model <MainApp>
-		State: /on/normal/red
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: bind_event; port: ui; parameters: [3, '<Button>', 'quit_clicked', 'private_1_field_ui'])
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: set_element_color; port: ui; parameters: [1, 2, 'black'])
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: set_element_color; port: ui; parameters: [1, 3, 'red'])
-
-__  Current Time:   1.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/normal/red
-
-EXIT STATE in model <MainApp>
-		State: /on/normal
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on/normal -> /on/interrupted)
-
-ENTER STATE in model <MainApp>
-		State: /on/interrupted
-
-ENTER STATE in model <MainApp>
-		State: /on/interrupted/yellow
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: set_element_color; port: ui; parameters: [1, 1, 'black'])
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: set_element_color; port: ui; parameters: [1, 2, 'black'])
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: set_element_color; port: ui; parameters: [1, 3, 'black'])
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: set_element_color; port: ui; parameters: [1, 2, 'yellow'])
-
-__  Current Time:   1.500000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/interrupted/yellow
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on/interrupted/yellow -> /on/interrupted/black)
-
-ENTER STATE in model <MainApp>
-		State: /on/interrupted/black
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: set_element_color; port: ui; parameters: [1, 2, 'black'])
-
-__  Current Time:   1.990000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/interrupted/black
-
-EXIT STATE in model <MainApp>
-		State: /on/interrupted
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on/interrupted -> /on/normal)
-
-ENTER STATE in model <MainApp>
-		State: /on/normal
-
-ENTER STATE in model <MainApp>
-		State: /on/normal/red
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: set_element_color; port: ui; parameters: [1, 2, 'black'])
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: set_element_color; port: ui; parameters: [1, 3, 'red'])
-
-__  Current Time:   3.000000 __________________________________________ 
-
-EXIT STATE in model <MainApp>
-		State: /on/normal/red
-
-EXIT STATE in model <MainApp>
-		State: /on/normal
-
-EXIT STATE in model <MainApp>
-		State: /on
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/on -> /off)
-
-ENTER STATE in model <MainApp>
-		State: /off
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: set_element_color; port: ui; parameters: [1, 1, 'black'])
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: set_element_color; port: ui; parameters: [1, 2, 'black'])
-
-OUTPUT EVENT to port <ui>
-	\Event: (event name: set_element_color; port: ui; parameters: [1, 3, 'black'])
-

+ 0 - 381
tests/10.0) TrafficLightTest/Python/target.py

@@ -1,381 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Model author: Sam Pieters
-Model name:   TrafficLight
-Model description:
-Tkinter frame with Traffic light in a single statechart.
-"""
-
-from sccd.runtime.statecharts_core import *
-from sccd.runtime.libs import ui_v2 as ui
-CANVAS_DIMS = (100, 350)
-
-# package "TrafficLight"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        RuntimeClassBase.__init__(self, controller)
-        
-        self.inports["field_ui"] = controller.addInputPort("field_ui", self)
-        
-        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.window_id = None
-        self.canvas_id = None
-        self.green_id = None
-        self.yellow_id = None
-        self.red_id = None
-        self.police_button_id = None
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /creating_window
-        self.states["/creating_window"] = State(1, "/creating_window", self)
-        self.states["/creating_window"].setEnter(self._creating_window_enter)
-        
-        # state /creating_canvas
-        self.states["/creating_canvas"] = State(2, "/creating_canvas", self)
-        self.states["/creating_canvas"].setEnter(self._creating_canvas_enter)
-        
-        # state /creating_trafficlight
-        self.states["/creating_trafficlight"] = State(3, "/creating_trafficlight", self)
-        
-        # state /creating_trafficlight/creating_greenlight
-        self.states["/creating_trafficlight/creating_greenlight"] = State(4, "/creating_trafficlight/creating_greenlight", self)
-        self.states["/creating_trafficlight/creating_greenlight"].setEnter(self._creating_trafficlight_creating_greenlight_enter)
-        
-        # state /creating_trafficlight/creating_yellowlight
-        self.states["/creating_trafficlight/creating_yellowlight"] = State(5, "/creating_trafficlight/creating_yellowlight", self)
-        self.states["/creating_trafficlight/creating_yellowlight"].setEnter(self._creating_trafficlight_creating_yellowlight_enter)
-        
-        # state /creating_trafficlight/creating_redlight
-        self.states["/creating_trafficlight/creating_redlight"] = State(6, "/creating_trafficlight/creating_redlight", self)
-        self.states["/creating_trafficlight/creating_redlight"].setEnter(self._creating_trafficlight_creating_redlight_enter)
-        
-        # state /creating_interrupt_button
-        self.states["/creating_interrupt_button"] = State(7, "/creating_interrupt_button", self)
-        self.states["/creating_interrupt_button"].setEnter(self._creating_interrupt_button_enter)
-        
-        # state /creating_quit_button
-        self.states["/creating_quit_button"] = State(8, "/creating_quit_button", self)
-        self.states["/creating_quit_button"].setEnter(self._creating_quit_button_enter)
-        
-        # state /on
-        self.states["/on"] = State(9, "/on", self)
-        
-        # state /on/normal
-        self.states["/on/normal"] = State(10, "/on/normal", self)
-        
-        # state /on/normal/red
-        self.states["/on/normal/red"] = State(11, "/on/normal/red", self)
-        self.states["/on/normal/red"].setEnter(self._on_normal_red_enter)
-        self.states["/on/normal/red"].setExit(self._on_normal_red_exit)
-        
-        # state /on/normal/green
-        self.states["/on/normal/green"] = State(12, "/on/normal/green", self)
-        self.states["/on/normal/green"].setEnter(self._on_normal_green_enter)
-        self.states["/on/normal/green"].setExit(self._on_normal_green_exit)
-        
-        # state /on/normal/yellow
-        self.states["/on/normal/yellow"] = State(13, "/on/normal/yellow", self)
-        self.states["/on/normal/yellow"].setEnter(self._on_normal_yellow_enter)
-        self.states["/on/normal/yellow"].setExit(self._on_normal_yellow_exit)
-        
-        # state /on/interrupted
-        self.states["/on/interrupted"] = State(14, "/on/interrupted", self)
-        
-        # state /on/interrupted/yellow
-        self.states["/on/interrupted/yellow"] = State(15, "/on/interrupted/yellow", self)
-        self.states["/on/interrupted/yellow"].setEnter(self._on_interrupted_yellow_enter)
-        self.states["/on/interrupted/yellow"].setExit(self._on_interrupted_yellow_exit)
-        
-        # state /on/interrupted/black
-        self.states["/on/interrupted/black"] = State(16, "/on/interrupted/black", self)
-        self.states["/on/interrupted/black"].setEnter(self._on_interrupted_black_enter)
-        self.states["/on/interrupted/black"].setExit(self._on_interrupted_black_exit)
-        
-        # state /off
-        self.states["/off"] = State(17, "/off", self)
-        self.states["/off"].setEnter(self._off_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/creating_window"])
-        self.states[""].addChild(self.states["/creating_canvas"])
-        self.states[""].addChild(self.states["/creating_trafficlight"])
-        self.states[""].addChild(self.states["/creating_interrupt_button"])
-        self.states[""].addChild(self.states["/creating_quit_button"])
-        self.states[""].addChild(self.states["/on"])
-        self.states[""].addChild(self.states["/off"])
-        self.states["/creating_trafficlight"].addChild(self.states["/creating_trafficlight/creating_greenlight"])
-        self.states["/creating_trafficlight"].addChild(self.states["/creating_trafficlight/creating_yellowlight"])
-        self.states["/creating_trafficlight"].addChild(self.states["/creating_trafficlight/creating_redlight"])
-        self.states["/on"].addChild(self.states["/on/normal"])
-        self.states["/on"].addChild(self.states["/on/interrupted"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/red"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/green"])
-        self.states["/on/normal"].addChild(self.states["/on/normal/yellow"])
-        self.states["/on/interrupted"].addChild(self.states["/on/interrupted/yellow"])
-        self.states["/on/interrupted"].addChild(self.states["/on/interrupted/black"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/creating_window"]
-        self.states["/creating_trafficlight"].default_state = self.states["/creating_trafficlight/creating_greenlight"]
-        self.states["/on"].default_state = self.states["/on/normal"]
-        self.states["/on/normal"].default_state = self.states["/on/normal/red"]
-        self.states["/on/interrupted"].default_state = self.states["/on/interrupted/yellow"]
-        
-        # transition /creating_window
-        _creating_window_0 = Transition(self, self.states["/creating_window"], [self.states["/creating_canvas"]])
-        _creating_window_0.setAction(self._creating_window_0_exec)
-        _creating_window_0.setTrigger(Event("window_created", None))
-        self.states["/creating_window"].addTransition(_creating_window_0)
-        
-        # transition /creating_canvas
-        _creating_canvas_0 = Transition(self, self.states["/creating_canvas"], [self.states["/creating_trafficlight"]])
-        _creating_canvas_0.setAction(self._creating_canvas_0_exec)
-        _creating_canvas_0.setTrigger(Event("canvas_created", None))
-        self.states["/creating_canvas"].addTransition(_creating_canvas_0)
-        
-        # transition /creating_trafficlight/creating_greenlight
-        _creating_trafficlight_creating_greenlight_0 = Transition(self, self.states["/creating_trafficlight/creating_greenlight"], [self.states["/creating_trafficlight/creating_yellowlight"]])
-        _creating_trafficlight_creating_greenlight_0.setAction(self._creating_trafficlight_creating_greenlight_0_exec)
-        _creating_trafficlight_creating_greenlight_0.setTrigger(Event("rectangle_created", None))
-        self.states["/creating_trafficlight/creating_greenlight"].addTransition(_creating_trafficlight_creating_greenlight_0)
-        
-        # transition /creating_trafficlight/creating_yellowlight
-        _creating_trafficlight_creating_yellowlight_0 = Transition(self, self.states["/creating_trafficlight/creating_yellowlight"], [self.states["/creating_trafficlight/creating_redlight"]])
-        _creating_trafficlight_creating_yellowlight_0.setAction(self._creating_trafficlight_creating_yellowlight_0_exec)
-        _creating_trafficlight_creating_yellowlight_0.setTrigger(Event("rectangle_created", None))
-        self.states["/creating_trafficlight/creating_yellowlight"].addTransition(_creating_trafficlight_creating_yellowlight_0)
-        
-        # transition /creating_trafficlight/creating_redlight
-        _creating_trafficlight_creating_redlight_0 = Transition(self, self.states["/creating_trafficlight/creating_redlight"], [self.states["/creating_interrupt_button"]])
-        _creating_trafficlight_creating_redlight_0.setAction(self._creating_trafficlight_creating_redlight_0_exec)
-        _creating_trafficlight_creating_redlight_0.setTrigger(Event("rectangle_created", None))
-        self.states["/creating_trafficlight/creating_redlight"].addTransition(_creating_trafficlight_creating_redlight_0)
-        
-        # transition /creating_interrupt_button
-        _creating_interrupt_button_0 = Transition(self, self.states["/creating_interrupt_button"], [self.states["/creating_quit_button"]])
-        _creating_interrupt_button_0.setAction(self._creating_interrupt_button_0_exec)
-        _creating_interrupt_button_0.setTrigger(Event("button_created", None))
-        self.states["/creating_interrupt_button"].addTransition(_creating_interrupt_button_0)
-        
-        # transition /creating_quit_button
-        _creating_quit_button_0 = Transition(self, self.states["/creating_quit_button"], [self.states["/on"]])
-        _creating_quit_button_0.setAction(self._creating_quit_button_0_exec)
-        _creating_quit_button_0.setTrigger(Event("button_created", None))
-        self.states["/creating_quit_button"].addTransition(_creating_quit_button_0)
-        
-        # transition /on/normal/red
-        _on_normal_red_0 = Transition(self, self.states["/on/normal/red"], [self.states["/on/normal/green"]])
-        _on_normal_red_0.setTrigger(Event("_0after"))
-        self.states["/on/normal/red"].addTransition(_on_normal_red_0)
-        
-        # transition /on/normal/green
-        _on_normal_green_0 = Transition(self, self.states["/on/normal/green"], [self.states["/on/normal/yellow"]])
-        _on_normal_green_0.setTrigger(Event("_1after"))
-        self.states["/on/normal/green"].addTransition(_on_normal_green_0)
-        
-        # transition /on/normal/yellow
-        _on_normal_yellow_0 = Transition(self, self.states["/on/normal/yellow"], [self.states["/on/normal/red"]])
-        _on_normal_yellow_0.setTrigger(Event("_2after"))
-        self.states["/on/normal/yellow"].addTransition(_on_normal_yellow_0)
-        
-        # transition /on/interrupted/yellow
-        _on_interrupted_yellow_0 = Transition(self, self.states["/on/interrupted/yellow"], [self.states["/on/interrupted/black"]])
-        _on_interrupted_yellow_0.setTrigger(Event("_3after"))
-        self.states["/on/interrupted/yellow"].addTransition(_on_interrupted_yellow_0)
-        
-        # transition /on/interrupted/black
-        _on_interrupted_black_0 = Transition(self, self.states["/on/interrupted/black"], [self.states["/on/interrupted/yellow"]])
-        _on_interrupted_black_0.setTrigger(Event("_4after"))
-        self.states["/on/interrupted/black"].addTransition(_on_interrupted_black_0)
-        
-        # transition /on
-        _on_0 = Transition(self, self.states["/on"], [self.states["/off"]])
-        _on_0.setTrigger(Event("quit_clicked", self.getInPortName("field_ui")))
-        _on_0.setGuard(self._on_0_guard)
-        self.states["/on"].addTransition(_on_0)
-        
-        # transition /on/normal
-        _on_normal_0 = Transition(self, self.states["/on/normal"], [self.states["/on/interrupted"]])
-        _on_normal_0.setAction(self._on_normal_0_exec)
-        _on_normal_0.setTrigger(Event("interrupt_clicked", self.getInPortName("field_ui")))
-        _on_normal_0.setGuard(self._on_normal_0_guard)
-        self.states["/on/normal"].addTransition(_on_normal_0)
-        
-        # transition /on/interrupted
-        _on_interrupted_0 = Transition(self, self.states["/on/interrupted"], [self.states["/on/normal"]])
-        _on_interrupted_0.setTrigger(Event("interrupt_clicked", self.getInPortName("field_ui")))
-        _on_interrupted_0.setGuard(self._on_interrupted_0_guard)
-        self.states["/on/interrupted"].addTransition(_on_interrupted_0)
-    
-    def _creating_window_enter(self):
-        self.big_step.outputEvent(Event("create_window", self.getOutPortName("ui"), [CANVAS_DIMS[0], CANVAS_DIMS[1], "Traffic Light (history)", self.inports['field_ui']]))
-    
-    def _creating_canvas_enter(self):
-        self.big_step.outputEvent(Event("create_canvas", self.getOutPortName("ui"), [self.window_id, CANVAS_DIMS[0], CANVAS_DIMS[1] - 100, {'background':'#222222'}, self.inports['field_ui']]))
-    
-    def _creating_trafficlight_creating_greenlight_enter(self):
-        self.big_step.outputEvent(Event("create_rectangle", self.getOutPortName("ui"), [self.canvas_id, 50, 50, 50, 50, {'fill':'#000'}, self.inports['field_ui']]))
-    
-    def _creating_trafficlight_creating_yellowlight_enter(self):
-        self.big_step.outputEvent(Event("create_rectangle", self.getOutPortName("ui"), [self.canvas_id, 50, 110, 50, 50, {'fill':'#000'}, self.inports['field_ui']]))
-    
-    def _creating_trafficlight_creating_redlight_enter(self):
-        self.big_step.outputEvent(Event("create_rectangle", self.getOutPortName("ui"), [self.canvas_id, 50, 170, 50, 50, {'fill':'#000'}, self.inports['field_ui']]))
-    
-    def _creating_interrupt_button_enter(self):
-        self.big_step.outputEvent(Event("create_button", self.getOutPortName("ui"), [self.window_id, 'Police Interrupt', self.inports['field_ui']]))
-    
-    def _creating_quit_button_enter(self):
-        self.big_step.outputEvent(Event("create_button", self.getOutPortName("ui"), [self.window_id, 'Quit', self.inports['field_ui']]))
-    
-    def _on_normal_red_enter(self):
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.yellow_id, 'black']))
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.red_id, 'red']))
-        self.addTimer(0, 3)
-    
-    def _on_normal_red_exit(self):
-        self.removeTimer(0)
-    
-    def _on_normal_green_enter(self):
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.red_id, 'black']))
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.green_id, 'green']))
-        self.addTimer(1, 2)
-    
-    def _on_normal_green_exit(self):
-        self.removeTimer(1)
-    
-    def _on_normal_yellow_enter(self):
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.green_id, 'black']))
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.yellow_id, 'yellow']))
-        self.addTimer(2, 1)
-    
-    def _on_normal_yellow_exit(self):
-        self.removeTimer(2)
-    
-    def _on_interrupted_yellow_enter(self):
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.yellow_id, 'yellow']))
-        self.addTimer(3, .5)
-    
-    def _on_interrupted_yellow_exit(self):
-        self.removeTimer(3)
-    
-    def _on_interrupted_black_enter(self):
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.yellow_id, 'black']))
-        self.addTimer(4, .5)
-    
-    def _on_interrupted_black_exit(self):
-        self.removeTimer(4)
-    
-    def _off_enter(self):
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.green_id, 'black']))
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.yellow_id, 'black']))
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.red_id, 'black']))
-    
-    def _on_0_guard(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        return button == ui.MOUSE_BUTTONS.LEFT
-    
-    def _on_normal_0_exec(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.green_id, 'black']))
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.yellow_id, 'black']))
-        self.big_step.outputEvent(Event("set_element_color", self.getOutPortName("ui"), [self.canvas_id, self.red_id, 'black']))
-    
-    def _on_normal_0_guard(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        return button == ui.MOUSE_BUTTONS.LEFT
-    
-    def _on_interrupted_0_guard(self, parameters):
-        x = parameters[0]
-        y = parameters[1]
-        button = parameters[2]
-        return button == ui.MOUSE_BUTTONS.LEFT
-    
-    def _creating_window_0_exec(self, parameters):
-        window_id = parameters[0]
-        self.window_id = window_id
-    
-    def _creating_canvas_0_exec(self, parameters):
-        canvas_id = parameters[0]
-        self.canvas_id = canvas_id
-    
-    def _creating_trafficlight_creating_greenlight_0_exec(self, parameters):
-        canvas_id = parameters[0]
-        green_id = parameters[1]
-        self.green_id = green_id
-    
-    def _creating_trafficlight_creating_yellowlight_0_exec(self, parameters):
-        canvas_id = parameters[0]
-        yellow_id = parameters[1]
-        self.yellow_id = yellow_id
-    
-    def _creating_trafficlight_creating_redlight_0_exec(self, parameters):
-        canvas_id = parameters[0]
-        red_id = parameters[1]
-        self.red_id = red_id
-    
-    def _creating_interrupt_button_0_exec(self, parameters):
-        button_id = parameters[0]
-        self.police_button_id = button_id
-        self.big_step.outputEvent(Event("bind_event", self.getOutPortName("ui"), [button_id, ui.EVENTS.MOUSE_CLICK, "interrupt_clicked", self.inports['field_ui']]))
-    
-    def _creating_quit_button_0_exec(self, parameters):
-        button_id = parameters[0]
-        self.quit_button_id = button_id
-        self.big_step.outputEvent(Event("bind_event", self.getOutPortName("ui"), [button_id, ui.EVENTS.MOUSE_CLICK, "quit_clicked", self.inports['field_ui']]))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/creating_window"].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 == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, 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.addOutputPort("ui")
-        self.object_manager.createInstance("MainApp", [])

+ 4 - 0
tests/10.1) BouncingBallsTest/input.txt

@@ -0,0 +1,4 @@
+0.5 (event name: window_created; port: ui; parameters: [0])
+1.0 (event name: canvas_created; port: ui; parameters: [1])
+1.5 (event name: button_created; port: ui; parameters: [2])
+2.0 (event name: window_close; port: ui; parameters: None)

+ 483 - 0
tests/10.1) BouncingBallsTest/sccd.xml

@@ -0,0 +1,483 @@
+<?xml version="1.1" ?>
+<diagram author="Sam Pieters" name="Bouncing_Balls_DEVS_Version">
+    <description>
+        Tkinter frame with bouncing balls in it.
+    </description>
+    <top>
+        from sccd.runtime.libs import ui_v2 as ui
+        import random
+
+        CANVAS_DIMS = (800, 550)
+    </top>
+    <inport name="ui"/>
+    <class name="MainApp" default="true">
+        <relationships>
+            <association name="fields" class="Field" />
+        </relationships>
+        <constructor>
+            <body>
+                self.nr_of_fields = 0
+            </body>
+        </constructor>
+        <scxml initial="running">
+            <state id="running" initial="root">
+                <parallel id="root">
+                    <state id="main_behaviour" initial="initializing">
+                        <state id="initializing">
+                            <transition target="../running">
+                                <raise event="create_field" />        
+                            </transition>
+                        </state>
+                        <state id="running">
+                            <transition target='.' event='button_pressed' cond='event_name == "create_new_field"'>
+                                <parameter name="event_name" type="str" />
+                                <raise event="create_field" />
+                            </transition>
+                        </state>
+                    </state>
+                    <state id="cd_behaviour" initial="waiting">
+                        <state id="waiting">
+                            <transition event="create_field" target="../creating">
+                                <raise scope="cd" event="create_instance">
+                                    <parameter expr='"fields"' />
+                                </raise>
+                            </transition>
+                            <transition event="delete_field" target='../check_nr_of_fields'>
+                                <parameter name="association_name" type="str"/>
+                                <raise scope="cd" event="delete_instance">
+                                    <parameter expr='association_name' />
+                                </raise>
+                                <script>
+                                    self.nr_of_fields -= 1
+                                </script>
+                            </transition>
+                        </state>
+                        <state id="creating">
+                            <transition event="instance_created" target="../waiting">
+                                <parameter name="association_name" type="string"/>
+                                <raise scope="cd" event="start_instance">
+                                    <parameter expr="association_name" />
+                                </raise>
+                                <raise scope="narrow" event="set_association_name" target="association_name">
+                                    <parameter expr="association_name" />
+                                </raise>
+                                <script>
+                                    self.nr_of_fields += 1
+                                </script>
+                            </transition>
+                        </state>
+                        <state id="check_nr_of_fields">
+                            <transition target="../stopped" cond="self.nr_of_fields == 0" after="0.05">
+                                <raise event="stop" />
+                            </transition>
+                            <transition target="../waiting" cond="self.nr_of_fields != 0"/>
+                        </state>
+                        <state id="stopped" />
+                    </state>
+                    <transition target="../stopped" event="stop">
+                        <raise port="ui" event="destroy_all"/>
+                    </transition>
+                </parallel>
+                <state id="stopped" />
+            </state>
+        </scxml>
+    </class>
+
+    <class name="Field">
+        <attribute name="window_id" />
+        <attribute name="canvas_id" />
+        <inport name="field_ui"/>
+        <relationships>
+            <association name="balls" class="Ball" />
+            <association name="buttons" class="Button" />
+            <association name="parent" class="MainApp" min="1" max="1" />
+        </relationships>
+        <scxml initial="root">
+            <state id="root" initial="waiting">
+                <state id="waiting">
+                    <transition event="set_association_name" target="../creating_window">
+                        <parameter name="association_name" type="str" />
+                        <script>
+                            self.association_name = association_name
+                        </script>
+                    </transition>
+                </state>
+                <state id="creating_window">
+                    <onentry>
+                        <raise port="ui" event="create_window">
+                            <parameter expr="800"/>                     <!-- width -->
+                            <parameter expr="600"/>                     <!-- height -->
+                            <parameter expr='"BouncingBalls"'/>         <!-- title -->
+                            <parameter expr="self.inports['field_ui']"/><!-- inport for response -->
+                        </raise>
+                    </onentry>
+                    <transition event="window_created" target="../creating_canvas">
+                        <parameter name="window_id" type="int" />
+                        <script>
+                            self.window_id = window_id
+                        </script>
+                        <raise port="ui" event="bind_event">
+                            <parameter expr="window_id"/>               <!-- widget_id -->
+                            <parameter expr="ui.EVENTS.WINDOW_CLOSE"/>  <!-- tk_event -->
+                            <parameter expr="'window_close'"/>          <!-- sccd_event_name -->
+                            <parameter expr="self.inports['field_ui']"/><!-- inport for response -->
+                        </raise>
+                        <raise port="ui" event="bind_event">
+                            <parameter expr="window_id"/>               <!-- widget_id -->
+                            <parameter expr="ui.EVENTS.KEY_PRESS"/>     <!-- tk_event -->
+                            <parameter expr="'key_press'"/>             <!-- sccd_event_name -->
+                            <parameter expr="self.inports['field_ui']"/><!-- inport for response -->
+                        </raise>
+                    </transition>
+                </state>
+                <state id="creating_canvas">
+                    <onentry>
+                        <raise port="ui" event="create_canvas">
+                            <parameter expr="self.window_id"/>          <!-- window_id -->
+                            <parameter expr="CANVAS_DIMS[0]"/>          <!-- width -->
+                            <parameter expr="CANVAS_DIMS[1]"/>          <!-- height -->
+                            <parameter expr="{'background':'#eee'}"/>   <!-- style -->
+                            <parameter expr="self.inports['field_ui']"/><!-- inport for response -->
+                        </raise>
+                    </onentry>
+                    <transition event="canvas_created" target="../creating_button">
+                        <parameter name="canvas_id" type="int"/>
+                        <script>
+                            self.canvas_id = canvas_id
+                        </script>
+                        <raise port="ui" event="bind_event">
+                            <parameter expr="canvas_id"/>                   <!-- widget_id -->
+                            <parameter expr="ui.EVENTS.MOUSE_RIGHT_CLICK"/> <!-- tk_event -->
+                            <parameter expr="'right_click'"/>               <!-- sccd_event_name -->
+                            <parameter expr="self.inports['field_ui']"/>    <!-- inport for response -->
+                        </raise>
+                        <raise port="ui" event="bind_event">
+                            <parameter expr="canvas_id"/>                   <!-- widget_id -->
+                            <parameter expr="ui.EVENTS.MOUSE_MOVE"/>        <!-- tk_event -->
+                            <parameter expr="'mouse_move'"/>                <!-- sccd_event_name -->
+                            <parameter expr="self.inports['field_ui']"/>    <!-- inport for response -->
+                        </raise>
+                        <raise port="ui" event="bind_event">
+                            <parameter expr="canvas_id"/><!-- widget_id -->
+                            <parameter expr="ui.EVENTS.MOUSE_RELEASE"/><!-- tk_event -->
+                            <parameter expr="'mouse_release'"/><!-- sccd_event_name -->
+                            <parameter expr="self.inports['field_ui']"/><!-- inport for response -->
+                        </raise>
+                    </transition>
+                </state>
+                <state id="creating_button">
+                    <onentry>
+                        <raise scope="cd" event="create_instance">
+                            <parameter expr='"buttons"' />
+                            <parameter expr='"Button"' />
+                            <parameter expr="self.window_id" />
+                            <parameter expr="'create_new_field'" />
+                            <parameter expr="'Spawn New Window'" />
+                        </raise>
+                    </onentry>
+                    <transition event='instance_created' target='../running'>
+                        <parameter name="association_name" type="string"/>
+                        <raise scope="cd" event="start_instance">
+                            <parameter expr="association_name" />
+                        </raise>
+                    </transition>
+                </state>
+                 <parallel id="running">
+                    <transition port="field_ui" event="window_close" target="../deleting">
+                        <raise event="delete_instance" scope="cd">
+                            <parameter expr='"buttons"' />
+                        </raise>
+                        <raise event="delete_instance" scope="cd">
+                            <parameter expr='"balls"' />
+                        </raise>
+                    </transition>
+                    <state id="main_behaviour" initial="running">
+                        <state id="running">
+                            <transition port="field_ui" event="right_click" target="../creating_ball">
+                                <parameter name="x" />
+                                <parameter name="y" />
+                                <parameter name="button" />
+                                <raise scope="cd" event="create_instance">
+                                    <parameter expr='"balls"' />
+                                    <parameter expr='"Ball"' />
+                                    <parameter expr="self.canvas_id" />
+                                    <parameter expr="x" />
+                                    <parameter expr="y" />
+                                </raise>
+                            </transition>
+                        </state>
+                        <state id="creating_ball">
+                            <transition event="instance_created" target="../running">
+                                <parameter name="association_name" type="string"/>
+                                <raise scope="cd" event="start_instance">
+                                    <parameter expr="association_name" />
+                                </raise>
+                                <raise scope="narrow" event="set_association_name" target="association_name">
+                                    <parameter expr="association_name" />
+                                </raise>
+                            </transition>
+                        </state>
+                    </state>
+                    <state id="deleting_behaviour" initial="running">
+                        <state id="running">
+                            <transition event="delete_ball" target='.'>
+                                <parameter name="association_name" type="str"/>
+                                <raise scope="cd" event="delete_instance">
+                                    <parameter expr='association_name' />
+                                </raise>
+                            </transition>
+                        </state>
+                    </state>
+                    <state id="child_behaviour" initial="listening">
+                        <state id="listening">
+                            <transition event="button_pressed" target='.'>
+                                <parameter name="event_name" type="str" />
+                                <raise event="button_pressed" scope="narrow" target="'parent'">
+                                    <parameter expr='event_name' />
+                                </raise>
+                            </transition>
+                        </state>
+                    </state>
+                    <state id="deleting_balls_behaviour" initial="listening">
+                        <state id="listening">
+                            <transition port="field_ui" event="key_press" target="." cond="key == ui.KEYCODES.DELETE">
+                                <parameter name="key" />
+                                <raise event="delete_self" scope="narrow" target="'balls'" />
+                            </transition>
+                        </state>
+                    </state>
+                </parallel>
+                <state id="deleting">
+                    <transition target="../deleted">
+                        <raise event="delete_field" scope="narrow" target="'parent'">
+                            <parameter expr='self.association_name' />
+                        </raise>
+                        <raise port="ui" event="destroy_window">
+                            <parameter expr="self.window_id"/><!-- window to destroy -->
+                        </raise>
+                    </transition>
+                </state>
+                <state id="deleted" />
+            </state>
+        </scxml>
+    </class>
+    
+    <class name="Button">
+        <attribute name="window_id" />
+        <attribute name="event_name" />
+        <attribute name="button_id" />
+        <relationships>
+            <association name="parent" class="Field" min="1" max="1" />
+        </relationships>
+        <inport name="button_ui"/>
+        <constructor>
+            <parameter name="window_id" type="int" />
+            <parameter name="event_name" type="str" />
+            <parameter name="button_text" type="str" />
+            <body>
+                self.window_id = window_id;
+                self.event_name = event_name;
+            </body>
+        </constructor>
+        <scxml initial="creating_button">
+            <state id="creating_button">
+                <onentry>
+                    <raise port="ui" event="create_button">
+                        <parameter expr="self.window_id"/><!-- window_id -->
+                        <parameter expr="self.event_name"/><!-- text -->
+                        <parameter expr="self.inports['button_ui']"/><!-- inport for response -->
+                    </raise>
+                </onentry>
+                <transition event="button_created" target="../running">
+                    <parameter name="button_id" type="int"/>
+                    <script>
+                        self.button_id = button_id
+                    </script>
+                    <raise port="ui" event="bind_event">
+                        <parameter expr="button_id"/><!-- widget_id -->
+                        <parameter expr="ui.EVENTS.MOUSE_CLICK"/><!-- tk_event -->
+                        <parameter expr='"mouse_click"'/><!-- sccd_event_name -->
+                        <parameter expr="self.inports['button_ui']"/><!-- inport for response -->
+                    </raise>
+                </transition>
+            </state>
+             <state id="running">
+                <transition port='button_ui' event="mouse_click" target='.' cond="button == ui.MOUSE_BUTTONS.LEFT">
+                    <parameter name="x" />
+                    <parameter name="y" />
+                    <parameter name="button" />
+                    <raise event="button_pressed" scope="narrow" target="'parent'">
+                        <parameter expr="self.event_name" />
+                    </raise>
+                </transition>
+            </state>
+        </scxml>
+    </class>
+    
+    <class name="Ball">
+        <attribute name="canvas_id" />
+        <atrribute name="circle_id" />
+        <attribute name="pos" />
+        <inport name="ball_ui" />
+        <relationships>
+            <association name="parent" class="Field" min="1" max="1" />
+        </relationships>
+        <constructor>
+            <parameter name="canvas_id" />
+            <parameter name="x" />
+            <parameter name="y" />
+            <body>
+                self.canvas_id = canvas_id;
+                self.r = 20.0;
+                self.vel = {'x': 1, 'y': 1};
+                self.pos = {'x': x, 'y': y};
+                self.smooth = 0.6; # value between 0 and 1
+            </body>
+        </constructor>
+        <destructor>
+        </destructor>
+        <scxml initial="main_behaviour">
+            <state id="main_behaviour" initial="initializing">
+                <state id="initializing">
+                    <transition event="set_association_name" target="../creating_circle">
+                        <parameter name="association_name" type="str" />
+                        <script>
+                            self.association_name = association_name
+                        </script>
+                    </transition>
+                </state>
+                <state id="creating_circle">
+                    <onentry>
+                        <raise port="ui" event="create_circle">
+                            <parameter expr="self.canvas_id"/><!-- canvas_id -->
+                            <parameter expr="self.pos['x']"/><!-- x -->
+                            <parameter expr="self.pos['y']"/><!-- y -->
+                            <parameter expr="self.r"/><!-- r -->
+                            <parameter expr="{'fill':'#000'}"/><!-- style -->
+                            <parameter expr="self.inports['ball_ui']"/><!-- inport for response -->
+                        </raise>
+                    </onentry>
+                    <transition event="circle_created" target="../bouncing">
+                        <parameter name="canvas_id"/>
+                        <parameter name="circle_id"/>
+                        <script>
+                            self.circle_id = circle_id
+                        </script>
+                        <raise port="ui" event="bind_canvas_event">
+                            <parameter expr="self.canvas_id"/>
+                            <parameter expr="circle_id"/>
+                            <parameter expr="ui.EVENTS.MOUSE_PRESS"/>
+                            <parameter expr="'mouse_press'"/>
+                            <parameter expr="self.inports['ball_ui']"/>
+                        </raise>
+                        <raise port="ui" event="bind_canvas_event">
+                            <parameter expr="self.canvas_id"/>
+                            <parameter expr="circle_id"/>
+                            <parameter expr="ui.EVENTS.MOUSE_MOVE"/>
+                            <parameter expr="'mouse_move'"/>
+                            <parameter expr="self.inports['ball_ui']"/>
+                        </raise>
+                        <raise port="ui" event="bind_canvas_event">
+                            <parameter expr="self.canvas_id"/>
+                            <parameter expr="circle_id"/>
+                            <parameter expr="ui.EVENTS.MOUSE_RELEASE"/>
+                            <parameter expr="'mouse_release'"/>
+                            <parameter expr="self.inports['ball_ui']"/>
+                        </raise>
+                    </transition>
+                </state>
+                <state id="bouncing">
+                    <!-- <transition after="(20 - self.getSimulatedTime() % 20) / 1000.0" target="."> -->
+                    <transition after="0.02" target=".">
+                        <script>
+                            <![CDATA[
+                            # Invert velocity when colliding with canvas border:
+                            if self.pos['x']-self.r <= 0 or self.pos['x']+self.r >= CANVAS_DIMS[0]:
+                                self.vel['x'] = -self.vel['x'];
+                            if self.pos['y']-self.r <= 0 or self.pos['y']+self.r >= CANVAS_DIMS[1]:
+                                self.vel['y'] = -self.vel['y'];
+                            ]]>
+                        </script>
+                        <raise port="ui" event="move_element">
+                            <parameter expr="self.canvas_id"/>
+                            <parameter expr="self.circle_id"/>
+                            <parameter expr="self.vel['x']"/>
+                            <parameter expr="self.vel['y']"/>
+                        </raise>
+                        <script>
+                            self.pos['x'] += self.vel['x']
+                            self.pos['y'] += self.vel['y']
+                        </script>
+                    </transition>
+                    <transition port="ball_ui" event="mouse_press" target="../selected" cond="button == ui.MOUSE_BUTTONS.LEFT">
+                        <parameter name="x" />
+                        <parameter name="y" />
+                        <parameter name="button" />
+                        <raise port="ui" event="set_element_color">
+                            <parameter expr="self.canvas_id"/>
+                            <parameter expr="self.circle_id"/>
+                            <parameter expr="'#ff0'"/>
+                        </raise>
+                    </transition>
+                </state>
+                <state id="dragging">
+                    <transition port="ball_ui" event="mouse_move" target=".">
+                        <parameter name="x" />
+                        <parameter name="y" />
+                        <parameter name="button" />
+                        <script>
+                            # Always keep ball within canvas:
+                            x = min(max(0+self.r, x), CANVAS_DIMS[0]-self.r)
+                            y = min(max(0+self.r, y), CANVAS_DIMS[1]-self.r)
+
+                            dx = x - self.pos['x']
+                            dy = y - self.pos['y']
+
+                            self.vel = {
+                                'x': (1-self.smooth)*dx + self.smooth*self.vel['x'],
+                                'y': (1-self.smooth)*dy + self.smooth*self.vel['y']
+                            }
+                            
+                            self.pos = {'x': x, 'y': y}
+                        </script>
+                        <raise port="ui" event="set_element_pos">
+                            <parameter expr="self.canvas_id"/>
+                            <parameter expr="self.circle_id"/>
+                            <parameter expr="x-self.r"/>
+                            <parameter expr="y-self.r"/>
+                        </raise>
+                    </transition>
+                    <transition port="ball_ui" event="mouse_release" target="../bouncing">
+                        <parameter name="x" />
+                        <parameter name="y" />
+                        <raise port="ui" event="set_element_color">
+                            <parameter expr="self.canvas_id"/>
+                            <parameter expr="self.circle_id"/>
+                            <parameter expr="'#f00'"/>
+                        </raise>
+                    </transition>
+                </state>
+                <state id='selected'>
+                    <transition port="ball_ui" event="mouse_press" target="../dragging" cond="button == ui.MOUSE_BUTTONS.LEFT">
+                        <parameter name="x" />
+                        <parameter name="y" />
+                        <parameter name="button" />
+                        <script>
+                            self.mouse_pos = {'x':x, 'y':y};
+                        </script>
+                    </transition>
+                    <transition event="delete_self" target='../../deleted'>                    
+                        <raise event="delete_ball" scope="narrow" target="'parent'">
+                            <parameter expr='self.association_name' />
+                        </raise>
+                        <raise port="ui" event="destroy_element">
+                            <parameter expr="self.canvas_id" />
+                            <parameter expr="self.element_id" />
+                        </raise>
+                    </transition>
+                </state>
+            </state>
+            <state id='deleted' />
+        </scxml>
+    </class>
+</diagram>

+ 0 - 3
tests/2.0) GlobalInputTest/PyDEVS/faulty_log.txt

@@ -1,3 +0,0 @@
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state2)
-0.00 MainApp: enter /state2

+ 0 - 97
tests/2.0) GlobalInputTest/PyDEVS/log.txt

@@ -1,97 +0,0 @@
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INITIAL CONDITIONS in model <Controller.MainApp>
-		Initial State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INITIAL CONDITIONS in model <Controller.ObjectManager>
-		Initial State: <sccd.runtime.DEVS_statecharts_core.ObjectManagerState object at 0x104aba390>
-		Next scheduled internal transition at time inf
-
-
-	INITIAL CONDITIONS in model <Controller.Tester>
-		Initial State: None
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-			port <Test_ui>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	EXTERNAL TRANSITION in model <Controller.MainApp>
-		Input Port Configuration:
-			port <obj_manager_in>:
-			port <input>:
-				['Event("input_event","ui",[\'0.00\'])']
-		New State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-			port <Test_ui>:
-				['Event("input_event","ui",[\'0.00\'])']
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-			EXIT STATE in model <MainApp>
-			State: State(1) (name: /state1)
-
-			TRANSITION FIRED in model <MainApp>
-			Transition(/state1 -> /state2)
-
-			ENTER STATE in model <MainApp>
-			State: State(2) (name: /state2)
-
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-		Next scheduled internal transition at time inf
-

+ 0 - 110
tests/2.0) GlobalInputTest/PyDEVS/target.py

@@ -1,110 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration) and Sam Pieters (DEVS)
-
-Model author: Sam Pieters
-Model name:   Global Input Test
-Model description:
-Test 2.0: Check if the model receives input.
-"""
-
-from sccd.runtime.DEVS_statecharts_core import *
-
-# package "Global Input Test"
-
-class MainAppInstance(RuntimeClassBase):
-    def __init__(self, atomdevs, id, start_port_id):
-        RuntimeClassBase.__init__(self, atomdevs, id)
-        
-        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()
-        
-        # call user defined constructor
-        MainAppInstance.user_defined_constructor(self)
-        port_name = addInputPort("ui", start_port_id, True)
-        atomdevs.state.port_mappings[port_name] = id
-        port_name = addInputPort("<narrow_cast>", start_port_id)
-        atomdevs.state.port_mappings[port_name] = id
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        
-        # state /state2
-        self.states["/state2"] = State(2, "/state2", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/state2"]])
-        _state1_0.setTrigger(Event("input_event", None))
-        self.states["/state1"].addTransition(_state1_0)
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class MainApp(ClassBase):
-    def __init__(self, name):
-        ClassBase.__init__(self, name)
-        self.input = self.addInPort("input")
-        new_instance = self.constructObject(0, 0, [])
-        self.state.instances[new_instance.instance_id] = new_instance
-        new_instance.start()
-        self.state.next_time = 0
-    
-    def constructObject(self, id, start_port_id, parameters):
-        new_instance = MainAppInstance(self, id, start_port_id)
-        return new_instance
-
-def instantiate(self, class_name, construct_params):
-    instance = {}
-    instance["name"] = class_name
-    if class_name == "MainApp":
-        self.narrow_cast_id = self.narrow_cast_id + 0
-        instance["associations"] = {}
-    else:
-        raise Exception("Cannot instantiate class " + class_name)
-    return instance
-ObjectManagerState.instantiate = instantiate
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
-        self.state = ObjectManagerState()
-        self.input = self.addInPort("input")
-        self.output["MainApp"] = self.addOutPort()
-        self.state.createInstance("MainApp", [])
-
-class Controller(CoupledDEVS):
-    def __init__(self, name):
-        CoupledDEVS.__init__(self, name)
-        self.in_ui = self.addInPort("ui")
-        self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomics = []
-        self.atomics.append(self.addSubModel(MainApp("MainApp")))
-        self.connectPorts(self.atomics[0].obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomics[0].obj_manager_in)
-        self.connectPorts(self.in_ui, self.atomics[0].input)

+ 0 - 3
tests/2.0) GlobalInputTest/Python/faulty_log.txt

@@ -1,3 +0,0 @@
-0.00 MainApp: exit /state1
-0.00 MainApp: transition (/state1 -> /state2)
-0.00 MainApp: enter /state2

+ 0 - 19
tests/2.0) GlobalInputTest/Python/log.txt

@@ -1,19 +0,0 @@
-__  Current Time:   0.000000 __________________________________________ 
-
-INPUT EVENT from <ObjectManager>
-	\Type: cd
-	\Event: (event name: input_event; port: ui; parameters: ['0.00'])
-
-INPUT EVENT from port <ui>
-	\Type: ui
-	\Event: (event name: input_event; port: ui; parameters: ['0.00'])
-
-EXIT STATE in model <MainApp>
-		State: /state1
-
-TRANSITION FIRED in model <MainApp>
-		Transition(/state1 -> /state2)
-
-ENTER STATE in model <MainApp>
-		State: /state2
-

+ 0 - 84
tests/2.0) GlobalInputTest/Python/target.py

@@ -1,84 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
-
-Model author: Sam Pieters
-Model name:   Global Input Test
-Model description:
-Test 2.0: Check if the model receives input.
-"""
-
-from sccd.runtime.statecharts_core import *
-
-# package "Global Input Test"
-
-class MainApp(RuntimeClassBase):
-    def __init__(self, controller):
-        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()
-        
-        # call user defined constructor
-        MainApp.user_defined_constructor(self)
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        
-        # state /state2
-        self.states["/state2"] = State(2, "/state2", self)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].addChild(self.states["/state2"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-        
-        # transition /state1
-        _state1_0 = Transition(self, self.states["/state1"], [self.states["/state2"]])
-        _state1_0.setTrigger(Event("input_event", None))
-        self.states["/state1"].addTransition(_state1_0)
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].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 == "MainApp":
-            instance = MainApp(self.controller)
-            instance.associations = {}
-        else:
-            raise Exception("Cannot instantiate class " + class_name)
-        return instance
-
-class Controller(ThreadsControllerBase):
-    def __init__(self, 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.addInputPort("ui")
-        self.object_manager.createInstance("MainApp", [])

+ 0 - 0
tests/2.1) GlobalOutputTest/PyDEVS/faulty_log.txt


+ 0 - 50
tests/2.1) GlobalOutputTest/PyDEVS/log.txt

@@ -1,50 +0,0 @@
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INITIAL CONDITIONS in model <Controller.MainApp>
-		Initial State: 
-		Next scheduled internal transition at time 0.000000
-
-
-	INITIAL CONDITIONS in model <Controller.ObjectManager>
-		Initial State: <sccd.runtime.DEVS_statecharts_core.ObjectManagerState object at 0x104de8c80>
-		Next scheduled internal transition at time inf
-
-
-	INITIAL CONDITIONS in model <Controller.Tester>
-		Initial State: None
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <Outport>:
-				(event name: output_event; port: Outport)
-		Next scheduled internal transition at time 0.000000
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.MainApp>
-		New State: 
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <Outport>:
-		Next scheduled internal transition at time inf
-
-
-__  Current Time:   0.000000 __________________________________________ 
-
-
-	INTERNAL TRANSITION in model <Controller.Tester>
-		New State: None
-		Output Port Configuration:
-		Next scheduled internal transition at time inf
-

+ 0 - 104
tests/2.1) GlobalOutputTest/PyDEVS/target.py

@@ -1,104 +0,0 @@
-"""
-Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration) and Sam Pieters (DEVS)
-
-Model author: Sam Pieters
-Model name:   Global Output Test
-Model description:
-Test 2.1: Check if the model raises output.
-"""
-
-from sccd.runtime.DEVS_statecharts_core import *
-
-# package "Global Output Test"
-
-class MainAppInstance(RuntimeClassBase):
-    def __init__(self, atomdevs, id, start_port_id):
-        RuntimeClassBase.__init__(self, atomdevs, id)
-        
-        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()
-        
-        # call user defined constructor
-        MainAppInstance.user_defined_constructor(self)
-        port_name = addInputPort("<narrow_cast>", start_port_id)
-        atomdevs.state.port_mappings[port_name] = id
-    
-    def user_defined_constructor(self):
-        pass
-    
-    def user_defined_destructor(self):
-        pass
-    
-    
-    # builds Statechart structure
-    def build_statechart_structure(self):
-        
-        # state <root>
-        self.states[""] = State(0, "", self)
-        
-        # state /state1
-        self.states["/state1"] = State(1, "/state1", self)
-        self.states["/state1"].setEnter(self._state1_enter)
-        
-        # add children
-        self.states[""].addChild(self.states["/state1"])
-        self.states[""].fixTree()
-        self.states[""].default_state = self.states["/state1"]
-    
-    def _state1_enter(self):
-        self.big_step.outputEvent(Event("output_event", self.getOutPortName("Outport"), []))
-    
-    def initializeStatechart(self):
-        # enter default state
-        self.default_targets = self.states["/state1"].getEffectiveTargetStates()
-        RuntimeClassBase.initializeStatechart(self)
-
-class MainApp(ClassBase):
-    def __init__(self, name):
-        ClassBase.__init__(self, name)
-        self.input = self.addInPort("input")
-        self.glob_outputs["Outport"] = self.addOutPort("Outport")
-        new_instance = self.constructObject(0, 0, [])
-        self.state.instances[new_instance.instance_id] = new_instance
-        new_instance.start()
-        self.state.next_time = 0
-    
-    def constructObject(self, id, start_port_id, parameters):
-        new_instance = MainAppInstance(self, id, start_port_id)
-        return new_instance
-
-def instantiate(self, class_name, construct_params):
-    instance = {}
-    instance["name"] = class_name
-    if class_name == "MainApp":
-        self.narrow_cast_id = self.narrow_cast_id + 0
-        instance["associations"] = {}
-    else:
-        raise Exception("Cannot instantiate class " + class_name)
-    return instance
-ObjectManagerState.instantiate = instantiate
-
-class ObjectManager(ObjectManagerBase):
-    def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
-        self.state = ObjectManagerState()
-        self.input = self.addInPort("input")
-        self.output["MainApp"] = self.addOutPort()
-        self.state.createInstance("MainApp", [])
-
-class Controller(CoupledDEVS):
-    def __init__(self, name):
-        CoupledDEVS.__init__(self, name)
-        self.out_Outport = self.addOutPort("Outport")
-        self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomics = []
-        self.atomics.append(self.addSubModel(MainApp("MainApp")))
-        self.connectPorts(self.atomics[0].obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomics[0].obj_manager_in)
-        self.connectPorts(self.atomics[0].glob_outputs["Outport"], self.out_Outport)

+ 0 - 0
tests/2.1) GlobalOutputTest/Python/faulty_log.txt


+ 0 - 0
tests/2.1) GlobalOutputTest/Python/log.txt


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików