Przeglądaj źródła

added testing for statecharts

sampieters 1 rok temu
rodzic
commit
8b87a567cb
71 zmienionych plików z 283157 dodań i 2059 usunięć
  1. 4 20
      TraceComparison/Tester.py
  2. 111 26
      TraceComparison/TraceChecker.py
  3. 11 9
      TraceComparison/new_process_tests.py
  4. 278319 0
      examples/BouncingBalls/PyDEVS/log.txt
  5. 1 2
      examples/BouncingBalls/PyDEVS/runner.py
  6. 1 5
      examples/GlobalUI/PyDEVS/target.py
  7. 395 0
      examples/Test8/PyDEVS/log.txt
  8. 10 0
      examples/Test8/PyDEVS/runner.py
  9. 197 0
      examples/Test8/PyDEVS/target.py
  10. 27 0
      examples/Test8/Python/log.txt
  11. 161 0
      examples/Test8/Python/target.py
  12. 2 2
      tests/Test14/PyDEVS/faulty_log.txt
  13. 82 0
      examples/Test8/sccd.xml
  14. 74 3
      sccd/runtime/DEVS_statecharts_core.py
  15. 5 2
      tests/InputTest/PyDEVS/faulty_log.txt
  16. 105 41
      tests/InputTest/PyDEVS/log.txt
  17. 20 18
      tests/InputTest/PyDEVS/target.py
  18. 5 0
      tests/InputTest/Python/log.txt
  19. 93 0
      tests/InputTest/Python/target.py
  20. 2 0
      tests/InputTest/expected_trace.txt
  21. 1 1
      tests/InputTest/input.txt
  22. 4 4
      tests/InputTest/sccd.xml
  23. 3 0
      tests/Test1/PyDEVS/faulty_log.txt
  24. 60 40
      tests/Test1/PyDEVS/log.txt
  25. 14 12
      tests/Test1/PyDEVS/target.py
  26. 1 2
      tests/Test10/PyDEVS/faulty_log.txt
  27. 168 103
      tests/Test10/PyDEVS/log.txt
  28. 32 28
      tests/Test10/PyDEVS/target.py
  29. 0 2
      tests/Test12/PyDEVS/faulty_log.txt
  30. 132 91
      tests/Test12/PyDEVS/log.txt
  31. 23 20
      tests/Test12/PyDEVS/target.py
  32. 1 2
      tests/Test13/PyDEVS/faulty_log.txt
  33. 236 123
      tests/Test13/PyDEVS/log.txt
  34. 23 20
      tests/Test13/PyDEVS/target.py
  35. 192 128
      tests/Test14/PyDEVS/log.txt
  36. 23 20
      tests/Test14/PyDEVS/target.py
  37. 0 4
      tests/Test15/PyDEVS/faulty_log.txt
  38. 192 128
      tests/Test15/PyDEVS/log.txt
  39. 23 20
      tests/Test15/PyDEVS/target.py
  40. 4 0
      tests/Test2/PyDEVS/faulty_log.txt
  41. 60 40
      tests/Test2/PyDEVS/log.txt
  42. 14 12
      tests/Test2/PyDEVS/target.py
  43. 218 121
      tests/Test22/PyDEVS/log.txt
  44. 23 20
      tests/Test22/PyDEVS/target.py
  45. 1 2
      tests/Test22/expected_trace.txt
  46. 35 0
      tests/Test3/PyDEVS/faulty_log.txt
  47. 142 52
      tests/Test3/PyDEVS/log.txt
  48. 0 14
      tests/Test3/PyDEVS/runner.py
  49. 14 12
      tests/Test3/PyDEVS/target.py
  50. 0 0
      tests/Test4/PyDEVS/faulty_log.txt
  51. 39 28
      tests/Test4/PyDEVS/log.txt
  52. 14 12
      tests/Test4/PyDEVS/target.py
  53. 0 0
      tests/Test5/PyDEVS/faulty_log.txt
  54. 39 28
      tests/Test5/PyDEVS/log.txt
  55. 14 12
      tests/Test5/PyDEVS/target.py
  56. 0 0
      tests/Test6/PyDEVS/faulty_log.txt
  57. 59 50
      tests/Test6/PyDEVS/log.txt
  58. 23 20
      tests/Test6/PyDEVS/target.py
  59. 5 0
      tests/Test7/PyDEVS/faulty_log.txt
  60. 107 78
      tests/Test7/PyDEVS/log.txt
  61. 23 20
      tests/Test7/PyDEVS/target.py
  62. 4 4
      tests/Test8/PyDEVS/faulty_log.txt
  63. 213 61
      tests/Test8/PyDEVS/log.txt
  64. 31 28
      tests/Test8/PyDEVS/target.py
  65. 8 8
      tests/Test8/Python/log.txt
  66. 6 6
      tests/Test8/Python/target.py
  67. 4 4
      tests/Test8/expected_trace.txt
  68. 6 6
      tests/Test8/sccd.xml
  69. 20 20
      tests/Test9/PyDEVS/faulty_log.txt
  70. 1255 505
      tests/Test9/PyDEVS/log.txt
  71. 23 20
      tests/Test9/PyDEVS/target.py

+ 4 - 20
TraceComparison/Tester.py

@@ -4,8 +4,6 @@ from pypdevs.simulator import Simulator
 from sccd.runtime.DEVS_statecharts_core import Event
 from pypdevs.infinity import INFINITY
 
-import tests.Test3.PyDEVS.target as target
-
 def parse_event(line):
     # Regular expression to match the desired parts of the line
     pattern = re.compile(r'\(event name: (.*?); port: (.*?); parameters: (.*?)\)$')
@@ -66,26 +64,12 @@ class TesterUnit(AtomicDEVS):
         to_output = {}
         for event in self.to_send:
             for port in self.OPorts:
-                if event.port == port.name:
+                if f"Test_{event.port}" == port.name:
+                    string_event = f"Event(\"{event.name}\",\"{event.port}\",{event.parameters})"
                     #to_output[port] = event
-                    if port in to_output:
-                        to_output[port].append(event)
-                    else:
-                        to_output[port] = [event]
+                    to_output[port] = [string_event]
         return to_output
 
     def timeAdvance(self):
         return self.next_event_time
-    
-
-class Tester(CoupledDEVS):
-    def __init__(self, model, inputfile=None):
-        CoupledDEVS.__init__(self, "Tester")
-
-        self.model = self.addSubModel(model)
-        self.tester = self.addSubModel(TesterUnit("Tester", inputfile))
-
-        # Connect to global ports
-        for model_input_ports in self.model.IPorts:
-            an_output = self.tester.addOutPort(name=model_input_ports.name)
-            self.connectPorts(an_output, model_input_ports)
+    

+ 111 - 26
TraceComparison/TraceChecker.py

@@ -25,16 +25,8 @@ class SCCDTraceChecker:
     def run(self, directory):
         raise NotImplementedError("Run method must be implemented by the subclass")
 
-    def check(self, directory):
-        expected_log = os.path.join(directory, "expected_trace.txt")
-        if os.path.exists(expected_log):
-            lines_array = []
-            with open(expected_log, 'r') as file:
-                lines_array = file.readlines()
-            return lines_array
-        else:
-            print(f"The file {expected_log} does not exist.")
-            return None
+    def check(self, directory, options):
+        raise NotImplementedError("Chekc method must be implemented by the subclass")
 
 
 class PythonSCCDTraceChecker(SCCDTraceChecker):
@@ -111,7 +103,7 @@ class PythonSCCDTraceChecker(SCCDTraceChecker):
         
         return output_events
 
-    def check(self, directory):
+    def check(self, directory, options):
         log = os.path.join(directory, "Python", "log.txt")
 
         expected_log = os.path.join(directory, "expected_trace.txt")
@@ -192,10 +184,23 @@ class PydevsSCCDTraceChecker(SCCDTraceChecker):
         if not os.path.exists(input_file):
             input_file = None
 
+        # Initialize the to be tested model
         test_model = target.Controller("Controller")
-        tester = Tester.Tester(test_model, input_file)
 
-        sim = DEVSSimulator(tester)
+        # Add a new atomicDEVS to it which will be the Tester and link it to the model to sent events
+        tester = test_model.addSubModel(Tester.TesterUnit("Tester", input_file))
+
+        # Connect the outports of the tester to the global inports of the model
+        # TODO: Now directly connected to the atomicDEVS because out/in relation can not be of coupled (SEE DEVS.PY)
+        for in_port in test_model.IPorts:
+            test_output = tester.addOutPort(f"Test_{in_port.name}")
+            for atomic in test_model.atomics:
+                test_model.connectPorts(test_output, atomic.input)
+
+
+        #tester = Tester.Tester(test_model, input_file)
+
+        sim = DEVSSimulator(test_model)
         sim.setRealTime(False)
         
         # Create the full path for the log file
@@ -207,31 +212,111 @@ class PydevsSCCDTraceChecker(SCCDTraceChecker):
         #sim.setClassicDEVS()
         sim.simulate()
 
-    def extract_output_events(self, log_file_path):
+    def extract_globalio(self, line, context):
+        event_pattern = re.compile(r'^\s*\(event name:.*\)$')
+        event_match = event_pattern.match(line)
+        if event_match and context["time"] is not None:
+            event = line.strip()
+            # Remove everything before '(' in each string
+            event = event[event.index('('):]
+            return f"{context["time"]:.2f} {event}"
+        return None
+        
+    def extract_internalio(self, line, context):
+        return None
+
+    def extract_statechart(self, line, context):
+        if line != "\n" and "\t\tNew State:" not in line:
+            if "TRANSITION FIRED" in line:
+                context["extra_info"] = ""
+            elif "EXIT STATE" in line:
+                context["extra_info"] = "Exit "
+            elif "ENTER STATE" in line:
+                context["extra_info"] = "Enter "
+            else:
+                line = line.replace('\n', '')
+                line = line.replace('\t', '')  # Remove all tab characters
+                return f"{context["time"]:.2f} {context["extra_info"]}{line}"
+        return None
+
+    def check_state(self, line, context):
+        if "EXTERNAL TRANSITION" in line:
+            # Use regular expressions to find everything between <>
+            pattern = r"<(.*?)>"
+            # Search for the pattern in the string
+            match = re.search(pattern, line)
+            context = {
+                "time": context["time"],
+                "transition_type": "external",
+                "model": match.group(1),
+                "context": None,
+                "extra_info": None
+            }
+        elif "INTERNAL TRANSITION" in line:
+            # Use regular expressions to find everything between <>
+            pattern = r"<(.*?)>"
+            # Search for the pattern in the string
+            match = re.search(pattern, line)
+            context = {
+                "time": context["time"],
+                "transition_type": "internal",
+                "model": match.group(1),
+                "context": None,
+                "extra_info": None
+            }   
+        elif "New State:" in line:
+            context["context"] = "state"
+        elif "Output Port Configuration:" in line:
+            context["context"] = "input"
+        elif "Output Port Configuration:" in line:
+            context["context"] = "output"
+        elif "Next scheduled internal transition at time" in line:
+            context["context"] = "next"
+        return context
+    
+    def extract_info(self, log_file_path, options):
         output_events = []
         current_time = None
+
+        context = {
+            "time": None,
+            "transition_type": None,
+            "model": None,
+            "context": None,
+            "extra_info": None
+        }
         
         with open(log_file_path, 'r') as file:
             lines = file.readlines()
             
             time_pattern = re.compile(r"__  Current Time: +([\d\.]+) +__________________________________________")
-            event_pattern = re.compile(r'^\s*\(event name:.*\)$')
-            
+
             for line in lines:
                 time_match = time_pattern.match(line)
                 if time_match:
-                    current_time = float(time_match.group(1))
+                    context["time"] = float(time_match.group(1))
+
+                context = self.check_state(line, context)
                 
-                event_match = event_pattern.match(line)
-                if event_match and current_time is not None:
-                    event = line.strip()
-                    # Remove everything before '(' in each string
-                    event = event[event.index('('):]
-                    output_events.append(f"{current_time:.2f} {event}")
+                if "GLOBAL_IO" in options:
+                    io_event = self.extract_globalio(line, context)
+                    if io_event is not None:
+                        output_events.append(io_event)
+                
+                if "INTERNAL_IO" in options:
+                    internal_event = self.extract_internalio(line, context)
+                    if internal_event is not None:
+                        output_events.append(internal_event)
+                
+                if "STATECHART" in options:
+                    if context['context'] == "state":
+                        statechart_event = self.extract_statechart(line, context)
+                        if statechart_event is not None:
+                            output_events.append(statechart_event)
         
         return output_events
 
-    def check(self, directory):
+    def check(self, directory, options):
         log = os.path.join(directory, "PyDEVS", "log.txt")
         expected_log = os.path.join(directory, "expected_trace.txt")
 
@@ -239,8 +324,8 @@ class PydevsSCCDTraceChecker(SCCDTraceChecker):
         if os.path.exists(expected_log):
             with open(expected_log, 'r') as file:
                 expected_events = [line.strip() for line in file.readlines()]
-
-        actual_events = self.extract_output_events(log)
+        
+        actual_events = self.extract_info(log, options)
 
         return_code = 1
         if len(expected_events) != len(actual_events):

+ 11 - 9
TraceComparison/new_process_tests.py

@@ -5,6 +5,12 @@ import importlib.util
 from sccd.runtime.DEVS_loop import DEVSSimulator
 import TraceChecker
 
+# ANSI color escape codes
+RED = '\033[91m'    # Red color
+GREEN = '\033[92m'  # Green color
+YELLOW = '\033[93m' # Yellow color
+ENDC = '\033[0m'    # Reset color to default
+
 def sort_directories(test_directory):
     with os.scandir(tests_directory) as entries:
         sorted_entries = sorted(entries, key=lambda entry: entry.name)
@@ -20,21 +26,17 @@ def natural_sort_key(s):
     return [int(text) if text.isdigit() else text.lower() for text in re.split(r'(\d+)', s)]
 
 if __name__ == '__main__':
-    # ANSI color escape codes
-    RED = '\033[91m'    # Red color
-    GREEN = '\033[92m'  # Green color
-    YELLOW = '\033[93m' # Yellow color
-    ENDC = '\033[0m'    # Reset color to default
-
     tests_directory = "./tests"
 
-    sorted_dirs = sort_directories(tests_directory)
+    #options = ["GLOBAL_IO", "INTERNAL_IO","STATECHART"]
+    options = ["GLOBAL_IO"]
 
     checkers = {
-        #"Python": TraceChecker.PythonSCCDTraceChecker(),
+        "Python": TraceChecker.PythonSCCDTraceChecker(),
         "Pydevs": TraceChecker.PydevsSCCDTraceChecker()
     }
 
+    sorted_dirs = sort_directories(tests_directory)
     results = {checker_name: [] for checker_name in checkers}
 
     for directory_name in sorted_dirs:
@@ -44,7 +46,7 @@ if __name__ == '__main__':
             for checker_name, checker in checkers.items():
                 checker.compile(full_directory)
                 checker.run(full_directory)
-                result = checker.check(full_directory)
+                result = checker.check(full_directory, options)
                 results[checker_name].append(result)
                 if result == 0:
                     print(f"{checker_name}: ", RED + "Failed" + ENDC)

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


+ 1 - 2
examples/BouncingBalls/PyDEVS/runner.py

@@ -8,7 +8,6 @@ class OutputListener:
 		self.ui = ui
 
 	def add(self, events):
-		events = events[0]
 		for event in events:
 			if event.port == "ui":
 				method = getattr(self.ui, event.name)
@@ -21,7 +20,7 @@ if __name__ == '__main__':
 	tkroot.withdraw()
 	sim = DEVSSimulator(model)
 
-	#sim.setVerbose()
+	sim.setVerbose("./examples/BouncingBalls/PyDEVS/log.txt")
 	sim.setRealTimePlatformTk(tkroot)
 
 	ui = UI(tkroot, sim)

+ 1 - 5
examples/GlobalUI/PyDEVS/target.py

@@ -96,10 +96,6 @@ class ObjectManager(ObjectManagerBase):
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
 
-def translate_inputevent_to_outputevent(inputEvent):
-    return inputEvent
-    #return OutputEvent(inputEvent)
-
 class Controller(CoupledDEVS):
     def __init__(self, name):
         CoupledDEVS.__init__(self, name)
@@ -113,4 +109,4 @@ class Controller(CoupledDEVS):
         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["Output"], self.out_Output)
-        self.connectPorts(self.in_Input, self.atomics[0].input, translate_inputevent_to_outputevent)
+        self.connectPorts(self.in_Input, self.atomics[0].input)

+ 395 - 0
examples/Test8/PyDEVS/log.txt

@@ -0,0 +1,395 @@
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INITIAL CONDITIONS in model <controller.A>
+		Initial State: TODO
+		Next scheduled internal transition at time inf
+
+
+	INITIAL CONDITIONS in model <controller.MainApp>
+		Initial State: TODO
+		Next scheduled internal transition at time inf
+
+
+	INITIAL CONDITIONS in model <controller.ObjectManager>
+		Initial State: <target.ObjectManagerState object at 0x105519ac0>
+		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>:
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
+			port <input>:
+			port <private_0_<narrow_cast>>:
+		New State: TODO
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x105519ac0>
+		Output Port Configuration:
+			port <port1>:
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
+			port <port2>:
+		Next scheduled internal transition at time inf
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <controller.ObjectManager>
+		Input Port Configuration:
+			port <input>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+		New State: <target.ObjectManagerState object at 0x105519ac0>
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <controller.MainApp>
+		New State: TODO
+		Output Port Configuration:
+			port <obj_manager_out>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+			port <Outport>:
+			port <linkA>:
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <controller.ObjectManager>
+		Input Port Configuration:
+			port <input>:
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}]))]
+		New State: <target.ObjectManagerState object at 0x105519ac0>
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <controller.MainApp>
+		New State: TODO
+		Output Port Configuration:
+			port <obj_manager_out>:
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}]))]
+			port <Outport>:
+			port <linkA>:
+		Next scheduled internal transition at time inf
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <controller.A>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}]))]
+			port <input>:
+			port <private_1_<narrow_cast>>:
+		New State: TODO
+		Next scheduled internal transition at time 0.000000
+
+
+	EXTERNAL TRANSITION in model <controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+			port <input>:
+			port <private_0_<narrow_cast>>:
+		New State: TODO
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x105519ac0>
+		Output Port Configuration:
+			port <port1>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+			port <port2>:
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}]))]
+		Next scheduled internal transition at time inf
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <controller.ObjectManager>
+		Input Port Configuration:
+			port <input>:
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
+		New State: <target.ObjectManagerState object at 0x105519ac0>
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <controller.A>
+		New State: TODO
+		Output Port Configuration:
+			port <obj_manager_out>:
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
+			port <Outport>:
+		Next scheduled internal transition at time inf
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <controller.MainApp>
+		New State: TODO
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <Outport>:
+			port <linkA>:
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <controller.MainApp>
+		New State: TODO
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <Outport>:
+			port <linkA>:
+		Next scheduled internal transition at time inf
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
+			port <input>:
+			port <private_0_<narrow_cast>>:
+		New State: TODO
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x105519ac0>
+		Output Port Configuration:
+			port <port1>:
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
+			port <port2>:
+		Next scheduled internal transition at time inf
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <controller.MainApp>
+		New State: TODO
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <Outport>:
+			port <linkA>:
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <controller.MainApp>
+		New State: TODO
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <Outport>:
+				[(event name: instance_created_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]'])]
+			port <linkA>:
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <controller.ObjectManager>
+		Input Port Configuration:
+			port <input>:
+				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
+		New State: <target.ObjectManagerState object at 0x105519ac0>
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <controller.MainApp>
+		New State: TODO
+		Output Port Configuration:
+			port <obj_manager_out>:
+				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
+			port <Outport>:
+			port <linkA>:
+		Next scheduled internal transition at time inf
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <controller.A>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
+			port <input>:
+			port <private_1_<narrow_cast>>:
+		New State: TODO
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x105519ac0>
+		Output Port Configuration:
+			port <port1>:
+			port <port2>:
+				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
+		Next scheduled internal transition at time inf
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <controller.ObjectManager>
+		Input Port Configuration:
+			port <input>:
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
+		New State: <target.ObjectManagerState object at 0x105519ac0>
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <controller.A>
+		New State: TODO
+		Output Port Configuration:
+			port <obj_manager_out>:
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
+			port <Outport>:
+				[(event name: statechart_started_succesfully; port: Outport; parameters: ['0.00']), (event name: constructor_initialized_succesfully; port: Outport; parameters: ['0.00', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}])]
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <controller.ObjectManager>
+		Input Port Configuration:
+			port <input>:
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
+		New State: <target.ObjectManagerState object at 0x105519ac0>
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <controller.A>
+		New State: TODO
+		Output Port Configuration:
+			port <obj_manager_out>:
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
+			port <Outport>:
+				[(event name: constructor_initialized_succesfully; port: Outport; parameters: ['0.00', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}])]
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <controller.ObjectManager>
+		Input Port Configuration:
+			port <input>:
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
+		New State: <target.ObjectManagerState object at 0x105519ac0>
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <controller.A>
+		New State: TODO
+		Output Port Configuration:
+			port <obj_manager_out>:
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
+			port <Outport>:
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <controller.A>
+		New State: TODO
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <Outport>:
+		Next scheduled internal transition at time inf
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]'])), ('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]'])), ('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
+			port <input>:
+			port <private_0_<narrow_cast>>:
+		New State: TODO
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x105519ac0>
+		Output Port Configuration:
+			port <port1>:
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]'])), ('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]'])), ('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
+			port <port2>:
+		Next scheduled internal transition at time inf
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <controller.MainApp>
+		New State: TODO
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <Outport>:
+			port <linkA>:
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <controller.MainApp>
+		New State: TODO
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <Outport>:
+				[(event name: instance_started_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]']), (event name: instance_started_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]']), (event name: instance_started_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]'])]
+			port <linkA>:
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <controller.MainApp>
+		New State: TODO
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <Outport>:
+				[(event name: instance_started_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]']), (event name: instance_started_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]'])]
+			port <linkA>:
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <controller.MainApp>
+		New State: TODO
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <Outport>:
+				[(event name: instance_started_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]'])]
+			port <linkA>:
+		Next scheduled internal transition at time inf
+

+ 10 - 0
examples/Test8/PyDEVS/runner.py

@@ -0,0 +1,10 @@
+import target as target
+from sccd.runtime.DEVS_loop import DEVSSimulator
+model = target.Controller(name="controller")
+sim = DEVSSimulator(model)
+sim.setRealTime(False)
+
+
+sim.setVerbose("./examples/Test8/PyDEVS/log.txt")
+
+sim.simulate()

+ 197 - 0
examples/Test8/PyDEVS/target.py

@@ -0,0 +1,197 @@
+"""
+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:   Create and Start Instance
+Model description:
+Test 8: Check if an instance is created and started successfully with constructor parameters (other than the main app)
+"""
+
+from sccd.runtime.DEVS_statecharts_core import *
+
+# package "Create and Start Instance"
+
+class MainAppInstance(RuntimeClassBase):
+    def __init__(self, atomdevs):
+        RuntimeClassBase.__init__(self, atomdevs)
+        self.associations = {}
+        self.associations["linkA"] = Association("A", 0, -1)
+        
+        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 = Ports.addInputPort("<narrow_cast>", self)
+        atomdevs.addInPort(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 /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.setAction(self._state1_0_exec)
+        _state1_0.setTrigger(Event("instance_created", None))
+        self.states["/state1"].addTransition(_state1_0)
+        
+        # transition /state2
+        _state2_0 = Transition(self, self.states["/state2"], [self.states["/state2"]])
+        _state2_0.setAction(self._state2_0_exec)
+        _state2_0.setTrigger(Event("instance_started", None))
+        self.states["/state2"].addTransition(_state2_0)
+    
+    def _state1_enter(self):
+        self.big_step.outputEventOM(Event("create_instance", None, [self, "linkA", "A", 1, 3.14, "test", [1, 2, 3], {"1": 1, "2": 2, "3": 3}]))
+    
+    def _state1_0_exec(self, parameters):
+        association_name = parameters[0]
+        self.big_step.outputEvent(Event("instance_created_succesfully", self.getOutPortName("Outport"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), association_name]))
+        self.big_step.outputEventOM(Event("start_instance", None, [self, association_name]))
+    
+    def _state2_0_exec(self, parameters):
+        association_name = parameters[0]
+        self.big_step.outputEvent(Event("instance_started_succesfully", self.getOutPortName("Outport"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), association_name]))
+    
+    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")
+        self.outputs["linkA"] = self.addOutPort("linkA")
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
+    
+    def constructObject(self, parameters):
+        new_instance = MainAppInstance(self)
+        return new_instance
+
+class AInstance(RuntimeClassBase):
+    def __init__(self, atomdevs, integer, floating_point, astring, alist, adict):
+        RuntimeClassBase.__init__(self, atomdevs)
+        self.associations = {}
+        
+        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
+        AInstance.user_defined_constructor(self, integer, floating_point, astring, alist, adict)
+        port_name = Ports.addInputPort("<narrow_cast>", self)
+        atomdevs.addInPort(port_name)
+    
+    def user_defined_constructor(self, integer, floating_point, astring, alist, adict):
+        self.integer = integer
+        self.floating_point = floating_point
+        self.astring = astring
+        self.alist = alist
+        self.adict = adict
+    
+    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("statechart_started_succesfully", self.getOutPortName("Outport"), [str('%.2f' % (self.getSimulatedTime() / 1000.0))]))
+        self.big_step.outputEvent(Event("constructor_initialized_succesfully", self.getOutPortName("Outport"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), self.integer, self.floating_point, self.astring, self.alist, self.adict]))
+    
+    def initializeStatechart(self):
+        # enter default state
+        self.default_targets = self.states["/state1"].getEffectiveTargetStates()
+        RuntimeClassBase.initializeStatechart(self)
+
+class A(ClassBase):
+    def __init__(self, name):
+        ClassBase.__init__(self, name)
+        self.input = self.addInPort("input")
+        self.glob_outputs["Outport"] = self.addOutPort("Outport")
+    
+    def constructObject(self, parameters):
+        new_instance = AInstance(self, parameters[2], parameters[3], parameters[4], parameters[5], parameters[6])
+        return new_instance
+
+class ObjectManagerState:
+    def __init__(self):
+        self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
+
+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.output["A"] = self.addOutPort()
+
+class Controller(CoupledDEVS):
+    def __init__(self, name):
+        CoupledDEVS.__init__(self, name)
+        self.in_Inport = self.addInPort("Inport")
+        Ports.addInputPort("Inport")
+        self.out_Outport = self.addOutPort("Outport")
+        Ports.addOutputPort("Outport")
+        self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
+        self.atomics = []
+        self.atomics.append(self.addSubModel(MainApp("MainApp")))
+        self.atomics.append(self.addSubModel(A("A")))
+        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].outputs["linkA"], self.atomics[1].input)
+        self.connectPorts(self.atomics[1].obj_manager_out, self.objectmanager.input)
+        self.connectPorts(self.objectmanager.output["A"], self.atomics[1].obj_manager_in)
+        self.connectPorts(self.atomics[0].glob_outputs["Outport"], self.out_Outport)
+        self.connectPorts(self.in_Inport, self.atomics[0].input)
+        self.connectPorts(self.atomics[1].glob_outputs["Outport"], self.out_Outport)
+        self.connectPorts(self.in_Inport, self.atomics[1].input)

+ 27 - 0
examples/Test8/Python/log.txt

@@ -0,0 +1,27 @@
+__  Current Time:   0.000000 __________________________________________ 
+
+EXIT STATE in model <MainApp>
+		State: /state1
+
+ENTER STATE in model <MainApp>
+		State: /state2
+
+OUTPUT EVENT to port <Outport>
+	\Event: (event name: instance_created_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]'])
+
+
+OUTPUT EVENT to port <Outport>
+	\Event: (event name: statechart_started_succesfully; port: Outport; parameters: ['0.00'])
+
+OUTPUT EVENT to port <Outport>
+	\Event: (event name: constructor_initialized_succesfully; port: Outport; parameters: ['0.00', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}])
+
+EXIT STATE in model <MainApp>
+		State: /state2
+
+ENTER STATE in model <MainApp>
+		State: /state2
+
+OUTPUT EVENT to port <Outport>
+	\Event: (event name: instance_started_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]'])
+

+ 161 - 0
examples/Test8/Python/target.py

@@ -0,0 +1,161 @@
+"""
+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:   Create and Start Instance
+Model description:
+Test 8: Check if an instance is created and started successfully with constructor parameters (other than the main app)
+"""
+
+from sccd.runtime.statecharts_core import *
+
+# package "Create and Start Instance"
+
+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)
+        
+        # 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.setAction(self._state1_0_exec)
+        _state1_0.setTrigger(Event("instance_created", None))
+        self.states["/state1"].addTransition(_state1_0)
+        
+        # transition /state2
+        _state2_0 = Transition(self, self.states["/state2"], [self.states["/state2"]])
+        _state2_0.setAction(self._state2_0_exec)
+        _state2_0.setTrigger(Event("instance_started", None))
+        self.states["/state2"].addTransition(_state2_0)
+    
+    def _state1_enter(self):
+        self.big_step.outputEventOM(Event("create_instance", None, [self, "linkA", "A", 1, 3.14, "test", [1, 2, 3], {"1": 1, "2": 2, "3": 3}]))
+    
+    def _state1_0_exec(self, parameters):
+        association_name = parameters[0]
+        self.big_step.outputEvent(Event("instance_created_succesfully", self.getOutPortName("Outport"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), association_name]))
+        self.big_step.outputEventOM(Event("start_instance", None, [self, association_name]))
+    
+    def _state2_0_exec(self, parameters):
+        association_name = parameters[0]
+        self.big_step.outputEvent(Event("instance_started_succesfully", self.getOutPortName("Outport"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), association_name]))
+    
+    def initializeStatechart(self):
+        # enter default state
+        self.default_targets = self.states["/state1"].getEffectiveTargetStates()
+        RuntimeClassBase.initializeStatechart(self)
+
+class A(RuntimeClassBase):
+    def __init__(self, controller, integer, floating_point, astring, alist, adict):
+        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
+        A.user_defined_constructor(self, integer, floating_point, astring, alist, adict)
+    
+    def user_defined_constructor(self, integer, floating_point, astring, alist, adict):
+        self.integer = integer
+        self.floating_point = floating_point
+        self.astring = astring
+        self.alist = alist
+        self.adict = adict
+    
+    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("statechart_started_succesfully", self.getOutPortName("Outport"), [str('%.2f' % (self.getSimulatedTime() / 1000.0))]))
+        self.big_step.outputEvent(Event("constructor_initialized_succesfully", self.getOutPortName("Outport"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), self.integer, self.floating_point, self.astring, self.alist, self.adict]))
+    
+    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 = {}
+            instance.associations["linkA"] = Association("A", 0, -1)
+        elif class_name == "A":
+            instance = A(self.controller, construct_params[0], construct_params[1], construct_params[2], construct_params[3], construct_params[4])
+            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("Inport")
+        self.addOutputPort("Outport")
+        self.object_manager.createInstance("MainApp", [])

+ 2 - 2
tests/Test14/PyDEVS/faulty_log.txt

@@ -1,4 +1,4 @@
 0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
 0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
-0.00 (event name: instance_started_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
-0.00 (event name: instance_deleted_succesfully; port: ui; parameters: ['0.00', [0]])
+0.00 (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}])
+0.00 (event name: instance_started_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])

+ 82 - 0
examples/Test8/sccd.xml

@@ -0,0 +1,82 @@
+<?xml version="1.1" ?>
+<diagram author="Sam Pieters" name="Create and Start Instance">
+    <description>
+        Test 8: Check if an instance is created and started successfully with constructor parameters (other than the main app)
+    </description>
+    <inport name="Inport" />
+    <outport name="Outport"/>
+    <class name="MainApp" default="true">
+        <relationships>
+            <association name="linkA" class="A" />
+        </relationships>
+        <scxml initial="state1">
+            <state id="state1">
+                <onentry>
+                    <raise scope="cd" event="create_instance">
+                        <parameter expr='"linkA"' />
+                        <parameter expr='"A"' />
+                        <!-- Constructor parameters -->
+                        <parameter expr='1' type="int" />
+                        <parameter expr='3.14' type="float" />
+                        <parameter expr='"test"' type="string" />
+                        <parameter expr='[1, 2, 3]' type="list" />
+                        <parameter expr='{"1": 1, "2": 2, "3": 3}' type="dict" />
+                    </raise>
+                </onentry>
+                <transition event='instance_created' target='../state2'>
+                    <parameter name="association_name" type="string"/>
+                    <raise port="Outport" event="instance_created_succesfully">
+                        <parameter expr="str('%.2f' % (self.getSimulatedTime() / 1000.0))" />
+                        <parameter expr="association_name" />
+                    </raise>
+                    <raise scope="cd" event="start_instance">
+                        <parameter expr="association_name" />
+                    </raise>
+                </transition>
+            </state>
+            <state id="state2">
+                <transition event='instance_started' target='.'>
+                    <parameter name="association_name" type="string"/>
+                    <raise port="Outport" event="instance_started_succesfully">
+                        <parameter expr="str('%.2f' % (self.getSimulatedTime() / 1000.0))" />
+                        <parameter expr="association_name" />
+                    </raise>
+                </transition>
+            </state>
+        </scxml>
+    </class>
+
+    <class name="A">
+        <constructor>
+            <parameter name='integer' type="int" />
+            <parameter name='floating_point' type="float" />
+            <parameter name='astring' type="string" />
+            <parameter name='alist' type="list" />
+            <parameter name='adict' type="dict" />
+            <body>
+                self.integer = integer
+                self.floating_point = floating_point
+                self.astring = astring
+                self.alist = alist
+                self.adict = adict
+            </body>
+        </constructor>
+        <scxml initial="state1">
+            <state id="state1">
+                <onentry>
+                    <raise port="Outport" event="statechart_started_succesfully">
+                        <parameter expr="str('%.2f' % (self.getSimulatedTime() / 1000.0))" />
+                    </raise>
+                    <raise port="Outport" event="constructor_initialized_succesfully">
+                        <parameter expr="str('%.2f' % (self.getSimulatedTime() / 1000.0))" />
+                        <parameter expr="self.integer" />
+                        <parameter expr="self.floating_point" />
+                        <parameter expr="self.astring" />
+                        <parameter expr="self.alist" />
+                        <parameter expr="self.adict" />
+                    </raise>
+                </onentry>
+            </state>
+        </scxml>
+    </class>
+</diagram>

+ 74 - 3
sccd/runtime/DEVS_statecharts_core.py

@@ -43,7 +43,7 @@ class Transition:
                     return True
 
     # @profile
-    def fire(self):
+    def fire(self, statechart):
         # exit states...
         exit_set = self.__exitSet()
         for s in exit_set:
@@ -54,6 +54,13 @@ class Transition:
                     f = lambda s0: not s0.descendants and s0 in s.descendants
                 self.obj.history_values[h.state_id] = list(filter(f, self.obj.configuration))
         for s in exit_set:
+            #########################################
+            # TODO, here trace for exit state
+            statechart.text += "\n"
+            statechart.text += "\t\t\tEXIT STATE in model <%s>\n" % statechart.name
+            statechart.text += f"\t\t\tState: {str(s)} (name: {s.name})\n"
+            #########################################
+
             self.obj.eventless_states -= s.has_eventless_transitions
             # execute exit action(s)
             if s.exit:
@@ -64,6 +71,12 @@ class Transition:
         self.obj.combo_step.changed_bitmap |= 2 ** self.lca.state_id
         self.obj.combo_step.changed_bitmap |= self.lca.descendant_bitmap
 
+        #########################################
+         # TODO, here trace for fired transition
+        statechart.text += "\n"
+        statechart.text += "\t\t\tTRANSITION FIRED in model <%s>\n" % statechart.name
+        statechart.text += "\t\t\t%s\n" % str(self)
+        #########################################
         # execute transition action(s)
         if self.action:
             self.action(self.enabled_event.parameters if self.enabled_event else [])
@@ -72,6 +85,13 @@ class Transition:
         targets = self.__getEffectiveTargetStates()
         enter_set = self.__enterSet(targets)
         for s in enter_set:
+            #########################################
+            # TODO, here trace for enter state
+            statechart.text += "\n"
+            statechart.text += "\t\t\tENTER STATE in model <%s>\n" % statechart.name
+            statechart.text += f"\t\t\tState: {str(s)} (name: {s.name})\n"
+            #########################################
+
             self.obj.eventless_states += s.has_eventless_transitions
             self.obj.configuration_bitmap |= 2 ** s.state_id
             # execute enter action(s)
@@ -368,9 +388,9 @@ class RuntimeClassBase(object):
             if self.semantics.concurrency == StatechartSemantics.Single:
                 candidate = conflicting[0]
                 if self.semantics.priority == StatechartSemantics.SourceParent:
-                    candidate[-1].fire()
+                    candidate[-1].fire(self.controller.state)
                 else:
-                    candidate[0].fire()
+                    candidate[0].fire(self.controller.state)
             elif self.semantics.concurrency == StatechartSemantics.Many:
                 pass  # TODO: implement
             self.small_step.has_stepped = True
@@ -438,6 +458,11 @@ class ClassState():
 
         self.lock = threading.Condition()
 
+        self.text = ""
+
+    def __str__(self) -> str:
+        return self.text
+
     def getEarliestEventTime(self):
         with self.lock:
             while self.instance_times and self.instance_times[0][0] < self.instance_times[0][1].earliest_event_time:
@@ -740,6 +765,7 @@ class ClassBase(AtomicDEVS):
         # Update simulated time
         self.state.simulated_time += self.elapsed
         self.state.next_time = 0
+        self.state.text = ""
 
         # Collect all inputs
         all_inputs = [input for input_list in inputs.values() for input in input_list]
@@ -824,6 +850,7 @@ class ClassBase(AtomicDEVS):
                 self.state.addInput(ev)
         return self.state
     
+    '''
     def intTransition(self):
         # Update simulated time and clear previous messages 
         self.state.simulated_time += self.state.next_time
@@ -836,7 +863,28 @@ class ClassBase(AtomicDEVS):
         self.state.handleInput()
         self.state.stepAll()
         return self.state
+    '''
+    
+    def intTransition(self):
+        self.state.to_send = self.state.to_send[1:]
+        self.state.text = ""
 
+        if len(self.state.to_send) == 0:
+            # Update simulated time and clear previous messages 
+            self.state.simulated_time += self.state.next_time
+            
+            # Calculate the next event time, clamp to ensure non-negative result
+            self.state.next_time = min(self.state.getEarliestEventTime(), self.state.simulated_time + self.state.input_queue.getEarliestTime())
+            self.state.next_time -= self.state.simulated_time
+            self.state.next_time = max(self.state.next_time, 0.0)
+            # Handle incoming inputs and do a step in all statecharts
+            self.state.handleInput()
+            self.state.stepAll()
+        else:
+            self.state.next_time = 0
+        return self.state
+
+    '''
     def outputFnc(self):
         to_dict = {}
         for sending in self.state.to_send:
@@ -846,6 +894,22 @@ class ClassBase(AtomicDEVS):
                 the_port = next((port for port in self.OPorts if port.name == sending.port), None)
                 to_dict.setdefault(the_port, []).append(sending)
         return to_dict
+    '''
+
+    def outputFnc(self):
+        to_dict = {}
+        #for sending in self.state.to_send:
+        if not len(self.state.to_send) == 0:
+            sending = self.state.to_send[0]
+
+            if isinstance(sending, tuple) and sending[2].port == None:
+                #to_dict.setdefault(self.obj_manager_out, []).append(sending)
+                to_dict[self.obj_manager_out] = sending
+            else:
+                the_port = next((port for port in self.OPorts if port.name == sending.port), None)
+                #to_dict.setdefault(the_port, []).append(sending)
+                to_dict[the_port] = sending
+        return to_dict
     
     def timeAdvance(self):
         return self.state.next_time
@@ -855,10 +919,17 @@ class ObjectManagerBase(AtomicDEVS):
         AtomicDEVS.__init__(self, name)
         self.output = {}
     
+    '''
     def extTransition(self, inputs):
         all_inputs = inputs[self.input]
         self.state.to_send.extend(all_inputs)
         return self.state
+    '''
+
+    def extTransition(self, inputs):
+        all_inputs = inputs[self.input]
+        self.state.to_send.append(all_inputs)
+        return self.state
     
     def intTransition(self):
         self.state.to_send.clear()

+ 5 - 2
tests/InputTest/PyDEVS/faulty_log.txt

@@ -1,2 +1,5 @@
-0.00 (event name: waiting_on_input; port: ui)
-1.00 (event name: test; port: ui; parameters: [])
+0.00 (event name: waiting_on_input; port: Output)
+1.00 Exit State: State(1) (name: /state1)
+1.00 Transition(State(1), State(2))
+1.00 Enter State: State(2) (name: /state2)
+1.00 (event name: received; port: Output)

+ 105 - 41
tests/InputTest/PyDEVS/log.txt

@@ -2,17 +2,17 @@
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.MainApp>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.MainApp>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.ObjectManager>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.ObjectManager>
+		Initial State: <target.ObjectManagerState object at 0x1060c13d0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INITIAL CONDITIONS in model <Tester.Tester>
+	INITIAL CONDITIONS in model <Controller.Tester>
 		Initial State: None
 		Next scheduled internal transition at time 0.000000
 
@@ -20,105 +20,169 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
 			port <private_0_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1048424e0>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10486f200>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x1060c13d0>
 		Output Port Configuration:
 			port <port1>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 		Next scheduled internal transition at time inf
 
 
-	INTERNAL TRANSITION in model <Tester.Tester>
-		New State: None
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
-			port <ui>:
-		Next scheduled internal transition at time 1.000000
+			port <obj_manager_out>:
+			port <Output>:
+				(event name: waiting_on_input; port: Output)
+		Next scheduled internal transition at time 0.000000
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-		New State: <target.ObjectManagerState object at 0x10486f200>
+		New State: <target.ObjectManagerState object at 0x1060c13d0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1048424e0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-			port <ui>:
-				(event name: waiting_on_input; port: ui)
+			port <Output>:
 		Next scheduled internal transition at time 0.000000
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	CONFLUENT TRANSITION in model <Tester.Controller.MainApp>
-		Input Port Configuration:
-			port <obj_manager_in>: 
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-			port <input>: 
-			port <private_0_<narrow_cast>>: 
-		New State: {0: <target.MainAppInstance object at 0x1048424e0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-			port <ui>:
+			port <Output>:
+		Next scheduled internal transition at time inf
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+			port <input>:
+			port <private_0_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10486f200>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x1060c13d0>
 		Output Port Configuration:
 			port <port1>:
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1048424e0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-			port <ui>:
+			port <Output>:
 		Next scheduled internal transition at time 0.000000
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1048424e0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-			port <ui>:
+			port <Output>:
 		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_Input>:
+		Next scheduled internal transition at time 1.000000
+
+
 __  Current Time:   1.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Tester>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+			port <input>:
+				['Event("test","Input",[])']
+			port <private_0_<narrow_cast>>:
+		New State: 
+		Next scheduled internal transition at time 1.000000
+
+
+	INTERNAL TRANSITION in model <Controller.Tester>
 		New State: None
 		Output Port Configuration:
-			port <ui>:
-				(event name: test; port: ui; parameters: [])
+			port <Test_Input>:
+				['Event("test","Input",[])']
+		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(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <Output>:
+		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 <Output>:
+				(event name: received; port: Output)
 		Next scheduled internal transition at time inf
 

+ 20 - 18
tests/InputTest/PyDEVS/target.py

@@ -63,23 +63,23 @@ class MainAppInstance(RuntimeClassBase):
         self.states["/state1"].addTransition(_state1_0)
     
     def _state1_enter(self):
-        self.big_step.outputEvent(Event("waiting_on_input", self.getOutPortName("ui"), []))
+        self.big_step.outputEvent(Event("waiting_on_input", self.getOutPortName("Output"), []))
     
     def _state1_0_exec(self, parameters):
-        self.big_step.outputEvent(Event("received", self.getOutPortName("ui"), []))
+        self.big_step.outputEvent(Event("received", self.getOutPortName("Output"), []))
     
     def initializeStatechart(self):
         # enter default state
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class MainApp(ObjectManagerBase):
+class MainApp(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
-        self.instances[self.next_instance] = MainAppInstance(self)
-        self.next_instance = self.next_instance + 1
+        self.glob_outputs["Output"] = self.addOutPort("Output")
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
     
     def constructObject(self, parameters):
         new_instance = MainAppInstance(self)
@@ -89,22 +89,24 @@ class ObjectManagerState:
     def __init__(self):
         self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
 
-class ObjectManager(TheObjectManager):
+class ObjectManager(ObjectManagerBase):
     def __init__(self, name):
-        TheObjectManager.__init__(self, name)
-        self.State = ObjectManagerState()
+        ObjectManagerBase.__init__(self, name)
+        self.state = ObjectManagerState()
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
 
 class Controller(CoupledDEVS):
     def __init__(self, name):
         CoupledDEVS.__init__(self, name)
-        self.in_ui = self.addInPort("ui")
-        Ports.addInputPort("ui")
-        self.out_ui = self.addOutPort("ui")
-        Ports.addOutputPort("ui")
+        self.in_Input = self.addInPort("Input")
+        Ports.addInputPort("Input")
+        self.out_Output = self.addOutPort("Output")
+        Ports.addOutputPort("Output")
         self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomic0 = self.addSubModel(MainApp("MainApp"))
-        self.connectPorts(self.atomic0.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomic0.obj_manager_in)
-        self.connectPorts(self.atomic0.output, self.out_ui)
+        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["Output"], self.out_Output)
+        self.connectPorts(self.in_Input, self.atomics[0].input)

+ 5 - 0
tests/InputTest/Python/log.txt

@@ -0,0 +1,5 @@
+__  Current Time:   0.000000 __________________________________________ 
+
+OUTPUT EVENT to port <Output>
+	\Event: (event name: waiting_on_input; port: Output)
+

+ 93 - 0
tests/InputTest/Python/target.py

@@ -0,0 +1,93 @@
+"""
+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 inport
+Model description:
+Test X: Test if global inport works
+"""
+
+from sccd.runtime.statecharts_core import *
+
+# package "Global inport"
+
+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)
+        
+        # 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.setAction(self._state1_0_exec)
+        _state1_0.setTrigger(Event("test", None))
+        self.states["/state1"].addTransition(_state1_0)
+    
+    def _state1_enter(self):
+        self.big_step.outputEvent(Event("waiting_on_input", self.getOutPortName("Output"), []))
+    
+    def _state1_0_exec(self, parameters):
+        self.big_step.outputEvent(Event("received", self.getOutPortName("Output"), []))
+    
+    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("Input")
+        self.addOutputPort("Output")
+        self.object_manager.createInstance("MainApp", [])

+ 2 - 0
tests/InputTest/expected_trace.txt

@@ -0,0 +1,2 @@
+0.00 (event name: waiting_on_input; port: Output)
+1.00 (event name: received; port: Output)

+ 1 - 1
tests/InputTest/input.txt

@@ -1 +1 @@
-1.00 (event name: test; port: ui; parameters: [])
+1.00 (event name: test; port: Input; parameters: [])

+ 4 - 4
tests/InputTest/sccd.xml

@@ -3,16 +3,16 @@
     <description>
         Test X: Test if global inport works
     </description>
-    <inport name="ui"/>
-    <outport name="ui"/>
+    <inport name="Input"/>
+    <outport name="Output"/>
     <class name="MainApp" default="true">
         <scxml initial="state1">
             <state id="state1">
                 <onentry>
-                    <raise port="ui" event="waiting_on_input" />
+                    <raise port="Output" event="waiting_on_input" />
                 </onentry>
                 <transition event='test' target='../state2'>
-                    <raise port="ui" event="received" />
+                    <raise port="Output" event="received" />
                 </transition>
             </state>
             <state id="state2" />

+ 3 - 0
tests/Test1/PyDEVS/faulty_log.txt

@@ -0,0 +1,3 @@
+1.00 Exit State: State(1) (name: /state1)
+1.00 Transition(State(1), State(2))
+1.00 Enter State: State(2) (name: /end)

+ 60 - 40
tests/Test1/PyDEVS/log.txt

@@ -2,17 +2,17 @@
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.MainApp>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.MainApp>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.ObjectManager>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.ObjectManager>
+		Initial State: <target.ObjectManagerState object at 0x10610d1c0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INITIAL CONDITIONS in model <Tester.Tester>
+	INITIAL CONDITIONS in model <Controller.Tester>
 		Initial State: None
 		Next scheduled internal transition at time 0.000000
 
@@ -20,44 +20,37 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
 			port <private_1_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1048b6c60>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1048b92e0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10610d1c0>
 		Output Port Configuration:
 			port <port1>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
-		Next scheduled internal transition at time inf
-
-
-	INTERNAL TRANSITION in model <Tester.Tester>
-		New State: None
-		Output Port Configuration:
-			port <ui>:
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-		New State: <target.ObjectManagerState object at 0x1048b92e0>
+		New State: <target.ObjectManagerState object at 0x10610d1c0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1048b6c60>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
@@ -68,32 +61,40 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	CONFLUENT TRANSITION in model <Tester.Controller.MainApp>
-		Input Port Configuration:
-			port <obj_manager_in>: 
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-			port <input>: 
-			port <private_1_<narrow_cast>>: 
-		New State: {0: <target.MainAppInstance object at 0x1048b6c60>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
+		Next scheduled internal transition at time 1.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+			port <input>:
+			port <private_1_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1048b92e0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10610d1c0>
 		Output Port Configuration:
 			port <port1>:
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1048b6c60>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -103,19 +104,38 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1048b6c60>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
 		Next scheduled internal transition at time 1.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:   1.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1048b6c60>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /end)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -125,8 +145,8 @@ __  Current Time:   1.000000 __________________________________________
 __  Current Time:   1.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1048b6c60>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:

+ 14 - 12
tests/Test1/PyDEVS/target.py

@@ -73,13 +73,13 @@ class MainAppInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class MainApp(ObjectManagerBase):
+class MainApp(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
-        self.instances[self.next_instance] = MainAppInstance(self)
-        self.next_instance = self.next_instance + 1
+        self.glob_outputs["ui"] = self.addOutPort("ui")
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
     
     def constructObject(self, parameters):
         new_instance = MainAppInstance(self)
@@ -89,10 +89,10 @@ class ObjectManagerState:
     def __init__(self):
         self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
 
-class ObjectManager(TheObjectManager):
+class ObjectManager(ObjectManagerBase):
     def __init__(self, name):
-        TheObjectManager.__init__(self, name)
-        self.State = ObjectManagerState()
+        ObjectManagerBase.__init__(self, name)
+        self.state = ObjectManagerState()
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
 
@@ -104,7 +104,9 @@ class Controller(CoupledDEVS):
         self.out_ui = self.addOutPort("ui")
         Ports.addOutputPort("ui")
         self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomic0 = self.addSubModel(MainApp("MainApp"))
-        self.connectPorts(self.atomic0.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomic0.obj_manager_in)
-        self.connectPorts(self.atomic0.output, self.out_ui)
+        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)
+        self.connectPorts(self.in_ui, self.atomics[0].input)

+ 1 - 2
tests/Test10/PyDEVS/faulty_log.txt

@@ -1,4 +1,3 @@
 0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
-0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
-0.00 (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00'])
+0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00']), (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00'])
 0.00 (event name: instance_started_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])

+ 168 - 103
tests/Test10/PyDEVS/log.txt

@@ -2,22 +2,27 @@
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INITIAL CONDITIONS in model <controller.A>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.A>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <controller.B>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.B>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <controller.MainApp>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.MainApp>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <controller.ObjectManager>
+	INITIAL CONDITIONS in model <Controller.ObjectManager>
+		Initial State: <target.ObjectManagerState object at 0x1061a2600>
+		Next scheduled internal transition at time 0.000000
+
+
+	INITIAL CONDITIONS in model <Controller.Tester>
 		Initial State: None
 		Next scheduled internal transition at time 0.000000
 
@@ -25,21 +30,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
-			port <private_22_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060f5f10>}
+			port <private_23_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x105ecb2c0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x1061a2600>
 		Output Port Configuration:
 			port <port1>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <port2>:
 			port <port3>:
 		Next scheduled internal transition at time inf
@@ -48,16 +53,16 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-		New State: <target.ObjectManagerState object at 0x105ecb2c0>
+		New State: <target.ObjectManagerState object at 0x1061a2600>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f5f10>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
@@ -70,64 +75,55 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	CONFLUENT TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
-			port <obj_manager_in>: 
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-			port <input>: 
-			port <private_22_<narrow_cast>>: 
-		New State: {0: <target.MainAppInstance object at 0x1060f5f10>}
+			port <input>:
+				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+		New State: <target.ObjectManagerState object at 0x1061a2600>
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
 			port <ui>:
 			port <linkA>:
 			port <linkB>:
-		Next scheduled internal transition at time 0.000000
-
-
-	CONFLUENT TRANSITION in model <controller.ObjectManager>
-		Input Port Configuration:
-			port <input>: 
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
-		New State: <target.ObjectManagerState object at 0x105ecb2c0>
-		Output Port Configuration:
-			port <port1>:
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-			port <port2>:
-			port <port3>:
-		Next scheduled internal transition at time 0.000000
+		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
 			port <input>:
-			port <private_23_<narrow_cast>>:
-		New State: {0: <target.AInstance object at 0x1060f87d0>}
+			port <private_24_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f5f10>}
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-			port <linkA>:
-			port <linkB>:
+	EXTERNAL TRANSITION in model <Controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+			port <input>:
+			port <private_23_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x105ecb2c0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x1061a2600>
 		Output Port Configuration:
 			port <port1>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
 			port <port2>:
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
 			port <port3>:
 		Next scheduled internal transition at time inf
 
@@ -135,16 +131,16 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
-		New State: <target.ObjectManagerState object at 0x105ecb2c0>
+		New State: <target.ObjectManagerState object at 0x1061a2600>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x1060f87d0>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
@@ -152,8 +148,24 @@ __  Current Time:   0.000000 __________________________________________
 		Next scheduled internal transition at time inf
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f5f10>}
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <ui>:
+			port <linkA>:
+			port <linkB>:
+		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>:
@@ -165,21 +177,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
 			port <input>:
-			port <private_22_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060f5f10>}
+			port <private_23_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x105ecb2c0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x1061a2600>
 		Output Port Configuration:
 			port <port1>:
-				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
 			port <port2>:
 			port <port3>:
 		Next scheduled internal transition at time inf
@@ -188,8 +200,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f5f10>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -201,8 +222,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f5f10>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -215,16 +236,16 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
-		New State: <target.ObjectManagerState object at 0x105ecb2c0>
+		New State: <target.ObjectManagerState object at 0x1061a2600>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f5f10>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
@@ -237,22 +258,22 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
+				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
 			port <input>:
-			port <private_23_<narrow_cast>>:
-		New State: {0: <target.AInstance object at 0x1060f87d0>}
+			port <private_24_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x105ecb2c0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x1061a2600>
 		Output Port Configuration:
 			port <port1>:
 			port <port2>:
-				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
+				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
 			port <port3>:
 		Next scheduled internal transition at time inf
 
@@ -260,21 +281,23 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
-		Input Port Configuration:
-			port <input>:
-				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
-		New State: <target.ObjectManagerState object at 0x105ecb2c0>
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <ui>:
+				(event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x1060f87d0>}
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
 			port <ui>:
-				(event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
 				(event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00'])
 		Next scheduled internal transition at time 0.000000
 
@@ -282,29 +305,52 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
-			port <obj_manager_in>:
-				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
 			port <input>:
-			port <private_22_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060f5f10>}
+				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
+		New State: <target.ObjectManagerState object at 0x1061a2600>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x1060f87d0>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
+			port <ui>:
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
 		Next scheduled internal transition at time inf
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x105ecb2c0>
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
+			port <input>:
+			port <private_23_<narrow_cast>>:
+		New State: 
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x1061a2600>
 		Output Port Configuration:
 			port <port1>:
-				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
 			port <port2>:
 			port <port3>:
 		Next scheduled internal transition at time inf
@@ -313,8 +359,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f5f10>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(2), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -326,8 +381,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f5f10>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -336,3 +391,13 @@ __  Current Time:   0.000000 __________________________________________
 			port <linkB>:
 		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 inf
+

+ 32 - 28
tests/Test10/PyDEVS/target.py

@@ -88,15 +88,15 @@ class MainAppInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class MainApp(ObjectManagerBase):
+class MainApp(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
         self.outputs["linkA"] = self.addOutPort("linkA")
         self.outputs["linkB"] = self.addOutPort("linkB")
-        self.instances[self.next_instance] = MainAppInstance(self)
-        self.next_instance = self.next_instance + 1
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
     
     def constructObject(self, parameters):
         new_instance = MainAppInstance(self)
@@ -152,11 +152,11 @@ class AInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class A(ObjectManagerBase):
+class A(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
     
     def constructObject(self, parameters):
         new_instance = AInstance(self)
@@ -212,11 +212,11 @@ class BInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class B(ObjectManagerBase):
+class B(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
     
     def constructObject(self, parameters):
         new_instance = BInstance(self)
@@ -226,10 +226,10 @@ class ObjectManagerState:
     def __init__(self):
         self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
 
-class ObjectManager(TheObjectManager):
+class ObjectManager(ObjectManagerBase):
     def __init__(self, name):
-        TheObjectManager.__init__(self, name)
-        self.State = ObjectManagerState()
+        ObjectManagerBase.__init__(self, name)
+        self.state = ObjectManagerState()
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
         self.output["A"] = self.addOutPort()
@@ -243,17 +243,21 @@ class Controller(CoupledDEVS):
         self.out_ui = self.addOutPort("ui")
         Ports.addOutputPort("ui")
         self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomic0 = self.addSubModel(MainApp("MainApp"))
-        self.atomic1 = self.addSubModel(A("A"))
-        self.atomic2 = self.addSubModel(B("B"))
-        self.connectPorts(self.atomic0.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomic0.obj_manager_in)
-        self.connectPorts(self.atomic0.outputs["linkA"], self.atomic1.input)
-        self.connectPorts(self.atomic0.outputs["linkB"], self.atomic2.input)
-        self.connectPorts(self.atomic1.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["A"], self.atomic1.obj_manager_in)
-        self.connectPorts(self.atomic2.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["B"], self.atomic2.obj_manager_in)
-        self.connectPorts(self.atomic0.output, self.out_ui)
-        self.connectPorts(self.atomic1.output, self.out_ui)
-        self.connectPorts(self.atomic2.output, self.out_ui)
+        self.atomics = []
+        self.atomics.append(self.addSubModel(MainApp("MainApp")))
+        self.atomics.append(self.addSubModel(A("A")))
+        self.atomics.append(self.addSubModel(B("B")))
+        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].outputs["linkA"], self.atomics[1].input)
+        self.connectPorts(self.atomics[0].outputs["linkB"], self.atomics[2].input)
+        self.connectPorts(self.atomics[1].obj_manager_out, self.objectmanager.input)
+        self.connectPorts(self.objectmanager.output["A"], self.atomics[1].obj_manager_in)
+        self.connectPorts(self.atomics[2].obj_manager_out, self.objectmanager.input)
+        self.connectPorts(self.objectmanager.output["B"], self.atomics[2].obj_manager_in)
+        self.connectPorts(self.atomics[0].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[0].input)
+        self.connectPorts(self.atomics[1].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[1].input)
+        self.connectPorts(self.atomics[2].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[2].input)

+ 0 - 2
tests/Test12/PyDEVS/faulty_log.txt

@@ -1,2 +0,0 @@
-0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
-0.00 (event name: instance_deleted_succesfully; port: ui; parameters: ['0.00', [0]])

+ 132 - 91
tests/Test12/PyDEVS/log.txt

@@ -2,17 +2,22 @@
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INITIAL CONDITIONS in model <controller.A>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.A>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <controller.MainApp>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.MainApp>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <controller.ObjectManager>
+	INITIAL CONDITIONS in model <Controller.ObjectManager>
+		Initial State: <target.ObjectManagerState object at 0x10619dd60>
+		Next scheduled internal transition at time 0.000000
+
+
+	INITIAL CONDITIONS in model <Controller.Tester>
 		Initial State: None
 		Next scheduled internal transition at time 0.000000
 
@@ -20,21 +25,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
-			port <private_24_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060fa120>}
+			port <private_25_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060f5940>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10619dd60>
 		Output Port Configuration:
 			port <port1>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -42,16 +47,16 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-		New State: <target.ObjectManagerState object at 0x1060f5940>
+		New State: <target.ObjectManagerState object at 0x10619dd60>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060fa120>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
@@ -63,77 +68,70 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	CONFLUENT TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
-			port <obj_manager_in>: 
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-			port <input>: 
-			port <private_24_<narrow_cast>>: 
-		New State: {0: <target.MainAppInstance object at 0x1060fa120>}
-		Output Port Configuration:
-			port <obj_manager_out>:
+			port <input>:
 				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
-			port <ui>:
-			port <linkA>:
+		New State: <target.ObjectManagerState object at 0x10619dd60>
 		Next scheduled internal transition at time 0.000000
 
 
-	CONFLUENT TRANSITION in model <controller.ObjectManager>
-		Input Port Configuration:
-			port <input>: 
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
-		New State: <target.ObjectManagerState object at 0x1060f5940>
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
-			port <port1>:
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-			port <port2>:
-		Next scheduled internal transition at time 0.000000
+			port <obj_manager_out>:
+				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+			port <ui>:
+			port <linkA>:
+		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
 			port <input>:
-			port <private_25_<narrow_cast>>:
-		New State: {0: <target.AInstance object at 0x106040560>}
+			port <private_26_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060fa120>}
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-			port <linkA>:
+	EXTERNAL TRANSITION in model <Controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+			port <input>:
+			port <private_25_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060f5940>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10619dd60>
 		Output Port Configuration:
 			port <port1>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
 			port <port2>:
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
-		New State: <target.ObjectManagerState object at 0x1060f5940>
+		New State: <target.ObjectManagerState object at 0x10619dd60>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x106040560>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
@@ -141,8 +139,23 @@ __  Current Time:   0.000000 __________________________________________
 		Next scheduled internal transition at time inf
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060fa120>}
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <ui>:
+			port <linkA>:
+		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>:
@@ -153,21 +166,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
 			port <input>:
-			port <private_24_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060fa120>}
+			port <private_25_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060f5940>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10619dd60>
 		Output Port Configuration:
 			port <port1>:
-				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -175,8 +188,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060fa120>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -187,8 +209,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060fa120>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -200,16 +222,16 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
-		New State: <target.ObjectManagerState object at 0x1060f5940>
+		New State: <target.ObjectManagerState object at 0x10619dd60>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060fa120>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
@@ -221,38 +243,38 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
+				[('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))]
 			port <input>:
-			port <private_25_<narrow_cast>>:
-		New State: {}
+			port <private_26_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060f5940>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10619dd60>
 		Output Port Configuration:
 			port <port1>:
 			port <port2>:
-				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
+				[('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
-		New State: <target.ObjectManagerState object at 0x1060f5940>
+		New State: <target.ObjectManagerState object at 0x10619dd60>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
@@ -263,21 +285,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
+				[('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))]
 			port <input>:
-			port <private_24_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060fa120>}
+			port <private_25_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060f5940>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10619dd60>
 		Output Port Configuration:
 			port <port1>:
-				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
+				[('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -285,8 +307,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060fa120>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(2), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -297,8 +328,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060fa120>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -306,3 +337,13 @@ __  Current Time:   0.000000 __________________________________________
 			port <linkA>:
 		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 inf
+

+ 23 - 20
tests/Test12/PyDEVS/target.py

@@ -86,14 +86,14 @@ class MainAppInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class MainApp(ObjectManagerBase):
+class MainApp(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
         self.outputs["linkA"] = self.addOutPort("linkA")
-        self.instances[self.next_instance] = MainAppInstance(self)
-        self.next_instance = self.next_instance + 1
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
     
     def constructObject(self, parameters):
         new_instance = MainAppInstance(self)
@@ -148,11 +148,11 @@ class AInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class A(ObjectManagerBase):
+class A(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
     
     def constructObject(self, parameters):
         new_instance = AInstance(self)
@@ -162,10 +162,10 @@ class ObjectManagerState:
     def __init__(self):
         self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
 
-class ObjectManager(TheObjectManager):
+class ObjectManager(ObjectManagerBase):
     def __init__(self, name):
-        TheObjectManager.__init__(self, name)
-        self.State = ObjectManagerState()
+        ObjectManagerBase.__init__(self, name)
+        self.state = ObjectManagerState()
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
         self.output["A"] = self.addOutPort()
@@ -178,12 +178,15 @@ class Controller(CoupledDEVS):
         self.out_ui = self.addOutPort("ui")
         Ports.addOutputPort("ui")
         self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomic0 = self.addSubModel(MainApp("MainApp"))
-        self.atomic1 = self.addSubModel(A("A"))
-        self.connectPorts(self.atomic0.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomic0.obj_manager_in)
-        self.connectPorts(self.atomic0.outputs["linkA"], self.atomic1.input)
-        self.connectPorts(self.atomic1.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["A"], self.atomic1.obj_manager_in)
-        self.connectPorts(self.atomic0.output, self.out_ui)
-        self.connectPorts(self.atomic1.output, self.out_ui)
+        self.atomics = []
+        self.atomics.append(self.addSubModel(MainApp("MainApp")))
+        self.atomics.append(self.addSubModel(A("A")))
+        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].outputs["linkA"], self.atomics[1].input)
+        self.connectPorts(self.atomics[1].obj_manager_out, self.objectmanager.input)
+        self.connectPorts(self.objectmanager.output["A"], self.atomics[1].obj_manager_in)
+        self.connectPorts(self.atomics[0].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[0].input)
+        self.connectPorts(self.atomics[1].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[1].input)

+ 1 - 2
tests/Test13/PyDEVS/faulty_log.txt

@@ -1,4 +1,3 @@
 0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
 0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[1]'])
-0.00 (event name: instance_deleted_succesfully; port: ui; parameters: ['0.00', [1]])
-0.00 (event name: instance_deleted_succesfully; port: ui; parameters: ['0.00', [0]])
+0.00 (event name: instance_deleted_succesfully; port: ui; parameters: ['0.00', 'linkA[1]']), (event name: instance_deleted_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])

+ 236 - 123
tests/Test13/PyDEVS/log.txt

@@ -2,17 +2,22 @@
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INITIAL CONDITIONS in model <controller.A>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.A>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <controller.MainApp>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.MainApp>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <controller.ObjectManager>
+	INITIAL CONDITIONS in model <Controller.ObjectManager>
+		Initial State: <target.ObjectManagerState object at 0x10619d1f0>
+		Next scheduled internal transition at time 0.000000
+
+
+	INITIAL CONDITIONS in model <Controller.Tester>
 		Initial State: None
 		Next scheduled internal transition at time 0.000000
 
@@ -20,21 +25,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
-			port <private_26_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060f9eb0>}
+			port <private_27_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060f84d0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10619d1f0>
 		Output Port Configuration:
 			port <port1>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -42,16 +47,16 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-		New State: <target.ObjectManagerState object at 0x1060f84d0>
+		New State: <target.ObjectManagerState object at 0x10619d1f0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f9eb0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
@@ -63,77 +68,70 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	CONFLUENT TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
-			port <obj_manager_in>: 
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-			port <input>: 
-			port <private_26_<narrow_cast>>: 
-		New State: {0: <target.MainAppInstance object at 0x1060f9eb0>}
-		Output Port Configuration:
-			port <obj_manager_out>:
+			port <input>:
 				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
-			port <ui>:
-			port <linkA>:
+		New State: <target.ObjectManagerState object at 0x10619d1f0>
 		Next scheduled internal transition at time 0.000000
 
 
-	CONFLUENT TRANSITION in model <controller.ObjectManager>
-		Input Port Configuration:
-			port <input>: 
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
-		New State: <target.ObjectManagerState object at 0x1060f84d0>
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
-			port <port1>:
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-			port <port2>:
-		Next scheduled internal transition at time 0.000000
+			port <obj_manager_out>:
+				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+			port <ui>:
+			port <linkA>:
+		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
 			port <input>:
-			port <private_27_<narrow_cast>>:
-		New State: {0: <target.AInstance object at 0x10606eb10>}
+			port <private_28_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f9eb0>}
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-			port <linkA>:
+	EXTERNAL TRANSITION in model <Controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+			port <input>:
+			port <private_27_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060f84d0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10619d1f0>
 		Output Port Configuration:
 			port <port1>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
 			port <port2>:
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
-		New State: <target.ObjectManagerState object at 0x1060f84d0>
+		New State: <target.ObjectManagerState object at 0x10619d1f0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x10606eb10>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
@@ -141,8 +139,23 @@ __  Current Time:   0.000000 __________________________________________
 		Next scheduled internal transition at time inf
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f9eb0>}
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <ui>:
+			port <linkA>:
+		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>:
@@ -153,21 +166,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
 			port <input>:
-			port <private_26_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060f9eb0>}
+			port <private_27_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060f84d0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10619d1f0>
 		Output Port Configuration:
 			port <port1>:
-				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -175,8 +188,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f9eb0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -187,8 +209,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f9eb0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -200,16 +222,16 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
-		New State: <target.ObjectManagerState object at 0x1060f84d0>
+		New State: <target.ObjectManagerState object at 0x10619d1f0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f9eb0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
@@ -221,39 +243,39 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
 			port <input>:
-			port <private_27_<narrow_cast>>:
 			port <private_28_<narrow_cast>>:
-		New State: {0: <target.AInstance object at 0x10606eb10>, 1: <target.AInstance object at 0x10606ef30>}
+			port <private_29_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060f84d0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10619d1f0>
 		Output Port Configuration:
 			port <port1>:
 			port <port2>:
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[1]']))
-		New State: <target.ObjectManagerState object at 0x1060f84d0>
+		New State: <target.ObjectManagerState object at 0x10619d1f0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x10606eb10>, 1: <target.AInstance object at 0x10606ef30>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[1]']))
@@ -264,21 +286,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[1]']))
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[1]']))]
 			port <input>:
-			port <private_26_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060f9eb0>}
+			port <private_27_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060f84d0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10619d1f0>
 		Output Port Configuration:
 			port <port1>:
-				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[1]']))
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[1]']))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -286,8 +308,26 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f9eb0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(2), State(3))
+
+			ENTER STATE in model <MainApp>
+			State: State(3) (name: /state3)
+
+			EXIT STATE in model <MainApp>
+			State: State(3) (name: /state3)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(3), State(4))
+
+			ENTER STATE in model <MainApp>
+			State: State(4) (name: /state4)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -298,8 +338,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f9eb0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -311,20 +351,39 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[1]', [1]]))
-				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
-		New State: <target.ObjectManagerState object at 0x1060f84d0>
+		New State: <target.ObjectManagerState object at 0x10619d1f0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f9eb0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[1]', [1]]))
+			port <ui>:
+			port <linkA>:
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
+		Input Port Configuration:
+			port <input>:
+				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
+		New State: <target.ObjectManagerState object at 0x10619d1f0>
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
 				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
 			port <ui>:
 			port <linkA>:
@@ -334,45 +393,61 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[1]', [1]]))
-				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
+				[('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[1]', [1]])), ('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))]
 			port <input>:
-			port <private_27_<narrow_cast>>:
 			port <private_28_<narrow_cast>>:
-		New State: {}
+			port <private_29_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060f84d0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10619d1f0>
 		Output Port Configuration:
 			port <port1>:
 			port <port2>:
-				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[1]', [1]]))
-				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
+				[('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[1]', [1]])), ('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[1]', [1]]))
-				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
-		New State: <target.ObjectManagerState object at 0x1060f84d0>
+		New State: <target.ObjectManagerState object at 0x10619d1f0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[1]', [1]]))
+			port <ui>:
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
+		Input Port Configuration:
+			port <input>:
+				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
+		New State: <target.ObjectManagerState object at 0x10619d1f0>
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
 				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
 			port <ui>:
 		Next scheduled internal transition at time inf
@@ -381,23 +456,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[1]', [1]]))
-				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
+				[('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[1]', [1]])), ('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))]
 			port <input>:
-			port <private_26_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060f9eb0>}
+			port <private_27_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060f84d0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10619d1f0>
 		Output Port Configuration:
 			port <port1>:
-				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[1]', [1]]))
-				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
+				[('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[1]', [1]])), ('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -405,8 +478,26 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f9eb0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(4) (name: /state4)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(4), State(4))
+
+			ENTER STATE in model <MainApp>
+			State: State(4) (name: /state4)
+
+			EXIT STATE in model <MainApp>
+			State: State(4) (name: /state4)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(4), State(4))
+
+			ENTER STATE in model <MainApp>
+			State: State(4) (name: /state4)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -417,13 +508,35 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060f9eb0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
 				(event name: instance_deleted_succesfully; port: ui; parameters: ['0.00', 'linkA[1]'])
+			port <linkA>:
+		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: instance_deleted_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
 			port <linkA>:
 		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 inf
+

+ 23 - 20
tests/Test13/PyDEVS/target.py

@@ -117,14 +117,14 @@ class MainAppInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class MainApp(ObjectManagerBase):
+class MainApp(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
         self.outputs["linkA"] = self.addOutPort("linkA")
-        self.instances[self.next_instance] = MainAppInstance(self)
-        self.next_instance = self.next_instance + 1
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
     
     def constructObject(self, parameters):
         new_instance = MainAppInstance(self)
@@ -179,11 +179,11 @@ class AInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class A(ObjectManagerBase):
+class A(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
     
     def constructObject(self, parameters):
         new_instance = AInstance(self)
@@ -193,10 +193,10 @@ class ObjectManagerState:
     def __init__(self):
         self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
 
-class ObjectManager(TheObjectManager):
+class ObjectManager(ObjectManagerBase):
     def __init__(self, name):
-        TheObjectManager.__init__(self, name)
-        self.State = ObjectManagerState()
+        ObjectManagerBase.__init__(self, name)
+        self.state = ObjectManagerState()
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
         self.output["A"] = self.addOutPort()
@@ -209,12 +209,15 @@ class Controller(CoupledDEVS):
         self.out_ui = self.addOutPort("ui")
         Ports.addOutputPort("ui")
         self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomic0 = self.addSubModel(MainApp("MainApp"))
-        self.atomic1 = self.addSubModel(A("A"))
-        self.connectPorts(self.atomic0.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomic0.obj_manager_in)
-        self.connectPorts(self.atomic0.outputs["linkA"], self.atomic1.input)
-        self.connectPorts(self.atomic1.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["A"], self.atomic1.obj_manager_in)
-        self.connectPorts(self.atomic0.output, self.out_ui)
-        self.connectPorts(self.atomic1.output, self.out_ui)
+        self.atomics = []
+        self.atomics.append(self.addSubModel(MainApp("MainApp")))
+        self.atomics.append(self.addSubModel(A("A")))
+        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].outputs["linkA"], self.atomics[1].input)
+        self.connectPorts(self.atomics[1].obj_manager_out, self.objectmanager.input)
+        self.connectPorts(self.objectmanager.output["A"], self.atomics[1].obj_manager_in)
+        self.connectPorts(self.atomics[0].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[0].input)
+        self.connectPorts(self.atomics[1].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[1].input)

+ 192 - 128
tests/Test14/PyDEVS/log.txt

@@ -2,17 +2,22 @@
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INITIAL CONDITIONS in model <controller.A>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.A>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <controller.MainApp>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.MainApp>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <controller.ObjectManager>
+	INITIAL CONDITIONS in model <Controller.ObjectManager>
+		Initial State: <target.ObjectManagerState object at 0x1060eb020>
+		Next scheduled internal transition at time 0.000000
+
+
+	INITIAL CONDITIONS in model <Controller.Tester>
 		Initial State: None
 		Next scheduled internal transition at time 0.000000
 
@@ -20,21 +25,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
-			port <private_29_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
+			port <private_30_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10606e930>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x1060eb020>
 		Output Port Configuration:
 			port <port1>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -42,16 +47,16 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-		New State: <target.ObjectManagerState object at 0x10606e930>
+		New State: <target.ObjectManagerState object at 0x1060eb020>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
@@ -63,77 +68,70 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	CONFLUENT TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
-			port <obj_manager_in>: 
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-			port <input>: 
-			port <private_29_<narrow_cast>>: 
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
-		Output Port Configuration:
-			port <obj_manager_out>:
+			port <input>:
 				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
-			port <ui>:
-			port <linkA>:
+		New State: <target.ObjectManagerState object at 0x1060eb020>
 		Next scheduled internal transition at time 0.000000
 
 
-	CONFLUENT TRANSITION in model <controller.ObjectManager>
-		Input Port Configuration:
-			port <input>: 
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
-		New State: <target.ObjectManagerState object at 0x10606e930>
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
-			port <port1>:
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-			port <port2>:
-		Next scheduled internal transition at time 0.000000
+			port <obj_manager_out>:
+				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+			port <ui>:
+			port <linkA>:
+		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
 			port <input>:
-			port <private_30_<narrow_cast>>:
-		New State: {0: <target.AInstance object at 0x1060f5040>}
+			port <private_31_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-			port <linkA>:
+	EXTERNAL TRANSITION in model <Controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+			port <input>:
+			port <private_30_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10606e930>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x1060eb020>
 		Output Port Configuration:
 			port <port1>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
 			port <port2>:
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
-		New State: <target.ObjectManagerState object at 0x10606e930>
+		New State: <target.ObjectManagerState object at 0x1060eb020>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x1060f5040>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
@@ -141,8 +139,23 @@ __  Current Time:   0.000000 __________________________________________
 		Next scheduled internal transition at time inf
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <ui>:
+			port <linkA>:
+		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>:
@@ -153,21 +166,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
 			port <input>:
-			port <private_29_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
+			port <private_30_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10606e930>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x1060eb020>
 		Output Port Configuration:
 			port <port1>:
-				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -175,8 +188,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -187,8 +209,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -200,16 +222,16 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
-		New State: <target.ObjectManagerState object at 0x10606e930>
+		New State: <target.ObjectManagerState object at 0x1060eb020>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
@@ -221,72 +243,86 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
+				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
 			port <input>:
-			port <private_30_<narrow_cast>>:
-		New State: {0: <target.AInstance object at 0x1060f5040>}
+			port <private_31_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10606e930>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x1060eb020>
 		Output Port Configuration:
 			port <port1>:
 			port <port2>:
-				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
+				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <ui>:
+				(event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
-		New State: <target.ObjectManagerState object at 0x10606e930>
+		New State: <target.ObjectManagerState object at 0x1060eb020>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x1060f5040>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
 			port <ui>:
-				(event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
 		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>:
-				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
-			port <input>:
-			port <private_29_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
-		Next scheduled internal transition at time 0.000000
-
-
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x1060f5040>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
 		Next scheduled internal transition at time inf
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10606e930>
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
+			port <input>:
+			port <private_30_<narrow_cast>>:
+		New State: 
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x1060eb020>
 		Output Port Configuration:
 			port <port1>:
-				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -294,8 +330,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(2), State(3))
+
+			ENTER STATE in model <MainApp>
+			State: State(3) (name: /state3)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -306,8 +351,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -319,16 +364,16 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
-		New State: <target.ObjectManagerState object at 0x10606e930>
+		New State: <target.ObjectManagerState object at 0x1060eb020>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
@@ -340,38 +385,38 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
+				[('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))]
 			port <input>:
-			port <private_30_<narrow_cast>>:
-		New State: {}
+			port <private_31_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10606e930>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x1060eb020>
 		Output Port Configuration:
 			port <port1>:
 			port <port2>:
-				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
+				[('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
-		New State: <target.ObjectManagerState object at 0x10606e930>
+		New State: <target.ObjectManagerState object at 0x1060eb020>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
@@ -382,21 +427,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
+				[('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))]
 			port <input>:
-			port <private_29_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
+			port <private_30_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10606e930>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x1060eb020>
 		Output Port Configuration:
 			port <port1>:
-				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
+				[('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -404,8 +449,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(3) (name: /state3)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(3), State(4))
+
+			ENTER STATE in model <MainApp>
+			State: State(4) (name: /state4)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -416,8 +470,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -429,11 +483,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10606e720>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
 			port <linkA>:
 		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 inf
+

+ 23 - 20
tests/Test14/PyDEVS/target.py

@@ -112,14 +112,14 @@ class MainAppInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class MainApp(ObjectManagerBase):
+class MainApp(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
         self.outputs["linkA"] = self.addOutPort("linkA")
-        self.instances[self.next_instance] = MainAppInstance(self)
-        self.next_instance = self.next_instance + 1
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
     
     def constructObject(self, parameters):
         new_instance = MainAppInstance(self)
@@ -183,11 +183,11 @@ class AInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class A(ObjectManagerBase):
+class A(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
     
     def constructObject(self, parameters):
         new_instance = AInstance(self)
@@ -197,10 +197,10 @@ class ObjectManagerState:
     def __init__(self):
         self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
 
-class ObjectManager(TheObjectManager):
+class ObjectManager(ObjectManagerBase):
     def __init__(self, name):
-        TheObjectManager.__init__(self, name)
-        self.State = ObjectManagerState()
+        ObjectManagerBase.__init__(self, name)
+        self.state = ObjectManagerState()
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
         self.output["A"] = self.addOutPort()
@@ -213,12 +213,15 @@ class Controller(CoupledDEVS):
         self.out_ui = self.addOutPort("ui")
         Ports.addOutputPort("ui")
         self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomic0 = self.addSubModel(MainApp("MainApp"))
-        self.atomic1 = self.addSubModel(A("A"))
-        self.connectPorts(self.atomic0.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomic0.obj_manager_in)
-        self.connectPorts(self.atomic0.outputs["linkA"], self.atomic1.input)
-        self.connectPorts(self.atomic1.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["A"], self.atomic1.obj_manager_in)
-        self.connectPorts(self.atomic0.output, self.out_ui)
-        self.connectPorts(self.atomic1.output, self.out_ui)
+        self.atomics = []
+        self.atomics.append(self.addSubModel(MainApp("MainApp")))
+        self.atomics.append(self.addSubModel(A("A")))
+        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].outputs["linkA"], self.atomics[1].input)
+        self.connectPorts(self.atomics[1].obj_manager_out, self.objectmanager.input)
+        self.connectPorts(self.objectmanager.output["A"], self.atomics[1].obj_manager_in)
+        self.connectPorts(self.atomics[0].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[0].input)
+        self.connectPorts(self.atomics[1].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[1].input)

+ 0 - 4
tests/Test15/PyDEVS/faulty_log.txt

@@ -1,4 +0,0 @@
-0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
-0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
-0.00 (event name: instance_started_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
-0.00 (event name: instance_deleted_succesfully; port: ui; parameters: ['0.00', [0]])

+ 192 - 128
tests/Test15/PyDEVS/log.txt

@@ -2,17 +2,22 @@
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INITIAL CONDITIONS in model <controller.A>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.A>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <controller.MainApp>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.MainApp>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <controller.ObjectManager>
+	INITIAL CONDITIONS in model <Controller.ObjectManager>
+		Initial State: <target.ObjectManagerState object at 0x106374bc0>
+		Next scheduled internal transition at time 0.000000
+
+
+	INITIAL CONDITIONS in model <Controller.Tester>
 		Initial State: None
 		Next scheduled internal transition at time 0.000000
 
@@ -20,21 +25,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
-			port <private_31_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
+			port <private_32_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x105f24a70>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106374bc0>
 		Output Port Configuration:
 			port <port1>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -42,16 +47,16 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-		New State: <target.ObjectManagerState object at 0x105f24a70>
+		New State: <target.ObjectManagerState object at 0x106374bc0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
@@ -63,77 +68,70 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	CONFLUENT TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
-			port <obj_manager_in>: 
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-			port <input>: 
-			port <private_31_<narrow_cast>>: 
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
-		Output Port Configuration:
-			port <obj_manager_out>:
+			port <input>:
 				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
-			port <ui>:
-			port <linkA>:
+		New State: <target.ObjectManagerState object at 0x106374bc0>
 		Next scheduled internal transition at time 0.000000
 
 
-	CONFLUENT TRANSITION in model <controller.ObjectManager>
-		Input Port Configuration:
-			port <input>: 
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
-		New State: <target.ObjectManagerState object at 0x105f24a70>
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
-			port <port1>:
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-			port <port2>:
-		Next scheduled internal transition at time 0.000000
+			port <obj_manager_out>:
+				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+			port <ui>:
+			port <linkA>:
+		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
 			port <input>:
-			port <private_32_<narrow_cast>>:
-		New State: {0: <target.AInstance object at 0x106041280>}
+			port <private_33_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-			port <linkA>:
+	EXTERNAL TRANSITION in model <Controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+			port <input>:
+			port <private_32_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x105f24a70>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106374bc0>
 		Output Port Configuration:
 			port <port1>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
 			port <port2>:
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
-		New State: <target.ObjectManagerState object at 0x105f24a70>
+		New State: <target.ObjectManagerState object at 0x106374bc0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x106041280>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
@@ -141,8 +139,23 @@ __  Current Time:   0.000000 __________________________________________
 		Next scheduled internal transition at time inf
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <ui>:
+			port <linkA>:
+		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>:
@@ -153,21 +166,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
 			port <input>:
-			port <private_31_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
+			port <private_32_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x105f24a70>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106374bc0>
 		Output Port Configuration:
 			port <port1>:
-				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -175,8 +188,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -187,8 +209,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -200,16 +222,16 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
-		New State: <target.ObjectManagerState object at 0x105f24a70>
+		New State: <target.ObjectManagerState object at 0x106374bc0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
@@ -221,72 +243,86 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
+				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
 			port <input>:
-			port <private_32_<narrow_cast>>:
-		New State: {0: <target.AInstance object at 0x106041280>}
+			port <private_33_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x105f24a70>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106374bc0>
 		Output Port Configuration:
 			port <port1>:
 			port <port2>:
-				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
+				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <ui>:
+				(event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
-		New State: <target.ObjectManagerState object at 0x105f24a70>
+		New State: <target.ObjectManagerState object at 0x106374bc0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x106041280>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
 			port <ui>:
-				(event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
 		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>:
-				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
-			port <input>:
-			port <private_31_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
-		Next scheduled internal transition at time 0.000000
-
-
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x106041280>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
 		Next scheduled internal transition at time inf
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x105f24a70>
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
+			port <input>:
+			port <private_32_<narrow_cast>>:
+		New State: 
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106374bc0>
 		Output Port Configuration:
 			port <port1>:
-				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -294,8 +330,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(2), State(3))
+
+			ENTER STATE in model <MainApp>
+			State: State(3) (name: /state3)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -306,8 +351,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -319,16 +364,16 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
-		New State: <target.ObjectManagerState object at 0x105f24a70>
+		New State: <target.ObjectManagerState object at 0x106374bc0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
@@ -340,38 +385,38 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
+				[('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))]
 			port <input>:
-			port <private_32_<narrow_cast>>:
-		New State: {}
+			port <private_33_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x105f24a70>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106374bc0>
 		Output Port Configuration:
 			port <port1>:
 			port <port2>:
-				('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))
+				[('MainApp', 'A', (event name: delete_instance; port: None; parameters: ['linkA[0]', [0]]))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
-		New State: <target.ObjectManagerState object at 0x105f24a70>
+		New State: <target.ObjectManagerState object at 0x106374bc0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
@@ -382,21 +427,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
+				[('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))]
 			port <input>:
-			port <private_31_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
+			port <private_32_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x105f24a70>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106374bc0>
 		Output Port Configuration:
 			port <port1>:
-				('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))
+				[('A', 'MainApp', (event name: instance_deleted; port: None; parameters: ['linkA[0]', [0]]))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -404,8 +449,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(3) (name: /state3)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(3), State(4))
+
+			ENTER STATE in model <MainApp>
+			State: State(4) (name: /state4)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -416,8 +470,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -429,11 +483,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060652b0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
 			port <linkA>:
 		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 inf
+

+ 23 - 20
tests/Test15/PyDEVS/target.py

@@ -113,14 +113,14 @@ class MainAppInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class MainApp(ObjectManagerBase):
+class MainApp(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
         self.outputs["linkA"] = self.addOutPort("linkA")
-        self.instances[self.next_instance] = MainAppInstance(self)
-        self.next_instance = self.next_instance + 1
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
     
     def constructObject(self, parameters):
         new_instance = MainAppInstance(self)
@@ -184,11 +184,11 @@ class AInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class A(ObjectManagerBase):
+class A(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
     
     def constructObject(self, parameters):
         new_instance = AInstance(self)
@@ -198,10 +198,10 @@ class ObjectManagerState:
     def __init__(self):
         self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
 
-class ObjectManager(TheObjectManager):
+class ObjectManager(ObjectManagerBase):
     def __init__(self, name):
-        TheObjectManager.__init__(self, name)
-        self.State = ObjectManagerState()
+        ObjectManagerBase.__init__(self, name)
+        self.state = ObjectManagerState()
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
         self.output["A"] = self.addOutPort()
@@ -214,12 +214,15 @@ class Controller(CoupledDEVS):
         self.out_ui = self.addOutPort("ui")
         Ports.addOutputPort("ui")
         self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomic0 = self.addSubModel(MainApp("MainApp"))
-        self.atomic1 = self.addSubModel(A("A"))
-        self.connectPorts(self.atomic0.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomic0.obj_manager_in)
-        self.connectPorts(self.atomic0.outputs["linkA"], self.atomic1.input)
-        self.connectPorts(self.atomic1.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["A"], self.atomic1.obj_manager_in)
-        self.connectPorts(self.atomic0.output, self.out_ui)
-        self.connectPorts(self.atomic1.output, self.out_ui)
+        self.atomics = []
+        self.atomics.append(self.addSubModel(MainApp("MainApp")))
+        self.atomics.append(self.addSubModel(A("A")))
+        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].outputs["linkA"], self.atomics[1].input)
+        self.connectPorts(self.atomics[1].obj_manager_out, self.objectmanager.input)
+        self.connectPorts(self.objectmanager.output["A"], self.atomics[1].obj_manager_in)
+        self.connectPorts(self.atomics[0].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[0].input)
+        self.connectPorts(self.atomics[1].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[1].input)

+ 4 - 0
tests/Test2/PyDEVS/faulty_log.txt

@@ -0,0 +1,4 @@
+1.00 Exit State: State(1) (name: /state1)
+1.00 Transition(State(1), State(2))
+1.00 Enter State: State(2) (name: /end)
+1.00 (event name: test_event; port: ui; parameters: ['1.00'])

+ 60 - 40
tests/Test2/PyDEVS/log.txt

@@ -2,17 +2,17 @@
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.MainApp>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.MainApp>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.ObjectManager>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.ObjectManager>
+		Initial State: <target.ObjectManagerState object at 0x10610cb00>
 		Next scheduled internal transition at time 0.000000
 
 
-	INITIAL CONDITIONS in model <Tester.Tester>
+	INITIAL CONDITIONS in model <Controller.Tester>
 		Initial State: None
 		Next scheduled internal transition at time 0.000000
 
@@ -20,44 +20,37 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
 			port <private_2_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1048b9fa0>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1048b9d90>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10610cb00>
 		Output Port Configuration:
 			port <port1>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
-		Next scheduled internal transition at time inf
-
-
-	INTERNAL TRANSITION in model <Tester.Tester>
-		New State: None
-		Output Port Configuration:
-			port <ui>:
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-		New State: <target.ObjectManagerState object at 0x1048b9d90>
+		New State: <target.ObjectManagerState object at 0x10610cb00>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1048b9fa0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
@@ -68,32 +61,40 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	CONFLUENT TRANSITION in model <Tester.Controller.MainApp>
-		Input Port Configuration:
-			port <obj_manager_in>: 
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-			port <input>: 
-			port <private_2_<narrow_cast>>: 
-		New State: {0: <target.MainAppInstance object at 0x1048b9fa0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
+		Next scheduled internal transition at time 1.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+			port <input>:
+			port <private_2_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1048b9d90>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10610cb00>
 		Output Port Configuration:
 			port <port1>:
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1048b9fa0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -103,19 +104,38 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1048b9fa0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
 		Next scheduled internal transition at time 1.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:   1.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1048b9fa0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /end)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -125,8 +145,8 @@ __  Current Time:   1.000000 __________________________________________
 __  Current Time:   1.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1048b9fa0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:

+ 14 - 12
tests/Test2/PyDEVS/target.py

@@ -77,13 +77,13 @@ class MainAppInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class MainApp(ObjectManagerBase):
+class MainApp(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
-        self.instances[self.next_instance] = MainAppInstance(self)
-        self.next_instance = self.next_instance + 1
+        self.glob_outputs["ui"] = self.addOutPort("ui")
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
     
     def constructObject(self, parameters):
         new_instance = MainAppInstance(self)
@@ -93,10 +93,10 @@ class ObjectManagerState:
     def __init__(self):
         self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
 
-class ObjectManager(TheObjectManager):
+class ObjectManager(ObjectManagerBase):
     def __init__(self, name):
-        TheObjectManager.__init__(self, name)
-        self.State = ObjectManagerState()
+        ObjectManagerBase.__init__(self, name)
+        self.state = ObjectManagerState()
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
 
@@ -108,7 +108,9 @@ class Controller(CoupledDEVS):
         self.out_ui = self.addOutPort("ui")
         Ports.addOutputPort("ui")
         self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomic0 = self.addSubModel(MainApp("MainApp"))
-        self.connectPorts(self.atomic0.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomic0.obj_manager_in)
-        self.connectPorts(self.atomic0.output, self.out_ui)
+        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)
+        self.connectPorts(self.in_ui, self.atomics[0].input)

+ 218 - 121
tests/Test22/PyDEVS/log.txt

@@ -2,17 +2,22 @@
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INITIAL CONDITIONS in model <controller.A>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.A>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <controller.MainApp>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.MainApp>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <controller.ObjectManager>
+	INITIAL CONDITIONS in model <Controller.ObjectManager>
+		Initial State: <target.ObjectManagerState object at 0x106377680>
+		Next scheduled internal transition at time 0.000000
+
+
+	INITIAL CONDITIONS in model <Controller.Tester>
 		Initial State: None
 		Next scheduled internal transition at time 0.000000
 
@@ -20,21 +25,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
-			port <private_33_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060422a0>}
+			port <private_34_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060420c0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106377680>
 		Output Port Configuration:
 			port <port1>:
-				('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))
+				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -42,16 +47,16 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-		New State: <target.ObjectManagerState object at 0x1060420c0>
+		New State: <target.ObjectManagerState object at 0x106377680>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060422a0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
@@ -63,77 +68,70 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	CONFLUENT TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
-			port <obj_manager_in>: 
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-			port <input>: 
-			port <private_33_<narrow_cast>>: 
-		New State: {0: <target.MainAppInstance object at 0x1060422a0>}
-		Output Port Configuration:
-			port <obj_manager_out>:
+			port <input>:
 				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
-			port <ui>:
-			port <linkA>:
+		New State: <target.ObjectManagerState object at 0x106377680>
 		Next scheduled internal transition at time 0.000000
 
 
-	CONFLUENT TRANSITION in model <controller.ObjectManager>
-		Input Port Configuration:
-			port <input>: 
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
-		New State: <target.ObjectManagerState object at 0x1060420c0>
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
-			port <port1>:
-				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
-			port <port2>:
-		Next scheduled internal transition at time 0.000000
+			port <obj_manager_out>:
+				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+			port <ui>:
+			port <linkA>:
+		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
 			port <input>:
-			port <private_34_<narrow_cast>>:
-		New State: {0: <target.AInstance object at 0x106041670>}
+			port <private_35_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060422a0>}
-		Output Port Configuration:
-			port <obj_manager_out>:
-			port <ui>:
-			port <linkA>:
+	EXTERNAL TRANSITION in model <Controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+			port <input>:
+			port <private_34_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060420c0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106377680>
 		Output Port Configuration:
 			port <port1>:
+				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
 			port <port2>:
-				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
-		New State: <target.ObjectManagerState object at 0x1060420c0>
+		New State: <target.ObjectManagerState object at 0x106377680>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x106041670>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
@@ -141,8 +139,23 @@ __  Current Time:   0.000000 __________________________________________
 		Next scheduled internal transition at time inf
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060422a0>}
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <ui>:
+			port <linkA>:
+		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>:
@@ -153,21 +166,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
 			port <input>:
-			port <private_33_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060422a0>}
+			port <private_34_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060420c0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106377680>
 		Output Port Configuration:
 			port <port1>:
-				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
+				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -175,8 +188,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060422a0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -187,8 +209,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060422a0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -200,16 +222,16 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
-		New State: <target.ObjectManagerState object at 0x1060420c0>
+		New State: <target.ObjectManagerState object at 0x106377680>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060422a0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
@@ -221,72 +243,95 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
-				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
+				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
 			port <input>:
-			port <private_34_<narrow_cast>>:
-		New State: {0: <target.AInstance object at 0x106041670>}
+			port <private_35_<narrow_cast>>:
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060420c0>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106377680>
 		Output Port Configuration:
 			port <port1>:
 			port <port2>:
-				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
+				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <ui>:
+				(event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
-		New State: <target.ObjectManagerState object at 0x1060420c0>
+		New State: <target.ObjectManagerState object at 0x106377680>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x106041670>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
+			EXIT STATE in model <A>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <A>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <A>
+			State: State(2) (name: /state2)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
 			port <ui>:
-				(event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
 		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>:
-				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
-			port <input>:
-			port <private_33_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x1060422a0>}
-		Next scheduled internal transition at time 0.000000
-
-
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x106041670>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
 		Next scheduled internal transition at time inf
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060420c0>
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
+			port <input>:
+			port <private_34_<narrow_cast>>:
+		New State: 
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106377680>
 		Output Port Configuration:
 			port <port1>:
-				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
 			port <port2>:
 		Next scheduled internal transition at time inf
 
@@ -294,8 +339,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060422a0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(2), State(3))
+
+			ENTER STATE in model <MainApp>
+			State: State(3) (name: /state3)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -306,8 +360,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060422a0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(3) (name: /state3)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(3), State(4))
+
+			ENTER STATE in model <MainApp>
+			State: State(4) (name: /state4)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -319,21 +382,20 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
 				('MainApp', 'A', (event name: link_check; port: None; parameters: ['linkA[0]']))
-		New State: <target.ObjectManagerState object at 0x1060420c0>
+		New State: <target.ObjectManagerState object at 0x106377680>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060422a0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 				('MainApp', 'A', (event name: link_check; port: None; parameters: ['linkA[0]']))
 			port <ui>:
-				(event name: instance_disassociated_succesfully; port: ui; parameters: ['0.00', ['linkA[0]']])
 			port <linkA>:
 		Next scheduled internal transition at time 0.000000
 
@@ -341,18 +403,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <controller.A>
-		Input Port Configuration:
-			port <obj_manager_in>:
-				('MainApp', 'A', (event name: link_check; port: None; parameters: ['linkA[0]']))
-			port <input>:
-			port <private_34_<narrow_cast>>:
-		New State: {0: <target.AInstance object at 0x106041670>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <ui>:
+				(event name: instance_disassociated_succesfully; port: ui; parameters: ['0.00', ['linkA[0]']])
+			port <linkA>:
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x1060422a0>}
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -360,20 +425,42 @@ __  Current Time:   0.000000 __________________________________________
 		Next scheduled internal transition at time inf
 
 
-	INTERNAL TRANSITION in model <controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x1060420c0>
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.A>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('MainApp', 'A', (event name: link_check; port: None; parameters: ['linkA[0]']))]
+			port <input>:
+			port <private_35_<narrow_cast>>:
+		New State: 
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106377680>
 		Output Port Configuration:
 			port <port1>:
 			port <port2>:
-				('MainApp', 'A', (event name: link_check; port: None; parameters: ['linkA[0]']))
+				[('MainApp', 'A', (event name: link_check; port: None; parameters: ['linkA[0]']))]
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x106041670>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
+			EXIT STATE in model <A>
+			State: State(2) (name: /state2)
+
+			TRANSITION FIRED in model <A>
+			Transition(State(2), State(2))
+
+			ENTER STATE in model <A>
+			State: State(2) (name: /state2)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -383,11 +470,21 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <controller.A>
-		New State: {0: <target.AInstance object at 0x106041670>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
 				(event name: instance_linked_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
 		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 inf
+

+ 23 - 20
tests/Test22/PyDEVS/target.py

@@ -114,14 +114,14 @@ class MainAppInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class MainApp(ObjectManagerBase):
+class MainApp(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
         self.outputs["linkA"] = self.addOutPort("linkA")
-        self.instances[self.next_instance] = MainAppInstance(self)
-        self.next_instance = self.next_instance + 1
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
     
     def constructObject(self, parameters):
         new_instance = MainAppInstance(self)
@@ -202,11 +202,11 @@ class AInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class A(ObjectManagerBase):
+class A(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
     
     def constructObject(self, parameters):
         new_instance = AInstance(self)
@@ -216,10 +216,10 @@ class ObjectManagerState:
     def __init__(self):
         self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
 
-class ObjectManager(TheObjectManager):
+class ObjectManager(ObjectManagerBase):
     def __init__(self, name):
-        TheObjectManager.__init__(self, name)
-        self.State = ObjectManagerState()
+        ObjectManagerBase.__init__(self, name)
+        self.state = ObjectManagerState()
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
         self.output["A"] = self.addOutPort()
@@ -232,12 +232,15 @@ class Controller(CoupledDEVS):
         self.out_ui = self.addOutPort("ui")
         Ports.addOutputPort("ui")
         self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomic0 = self.addSubModel(MainApp("MainApp"))
-        self.atomic1 = self.addSubModel(A("A"))
-        self.connectPorts(self.atomic0.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomic0.obj_manager_in)
-        self.connectPorts(self.atomic0.outputs["linkA"], self.atomic1.input)
-        self.connectPorts(self.atomic1.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["A"], self.atomic1.obj_manager_in)
-        self.connectPorts(self.atomic0.output, self.out_ui)
-        self.connectPorts(self.atomic1.output, self.out_ui)
+        self.atomics = []
+        self.atomics.append(self.addSubModel(MainApp("MainApp")))
+        self.atomics.append(self.addSubModel(A("A")))
+        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].outputs["linkA"], self.atomics[1].input)
+        self.connectPorts(self.atomics[1].obj_manager_out, self.objectmanager.input)
+        self.connectPorts(self.objectmanager.output["A"], self.atomics[1].obj_manager_in)
+        self.connectPorts(self.atomics[0].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[0].input)
+        self.connectPorts(self.atomics[1].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[1].input)

+ 1 - 2
tests/Test22/expected_trace.txt

@@ -2,5 +2,4 @@
 0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
 0.00 (event name: instance_started_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
 0.00 (event name: instance_disassociated_succesfully; port: ui; parameters: ['0.00', ['linkA[0]']])
-0.00 (event name: instance_linked_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
-
+0.00 (event name: instance_linked_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])

+ 35 - 0
tests/Test3/PyDEVS/faulty_log.txt

@@ -0,0 +1,35 @@
+1.00 Exit State: State(1) (name: /state1)
+1.00  Transition(State(1), State(2))
+1.00 Enter State: State(2) (name: /state2)
+1.00 Exit State: State(2) (name: /state2)
+1.00  Transition(State(2), State(1))
+1.00 Enter State: State(1) (name: /state1)
+1.00 (event name: test_event; port: ui; parameters: ['1', '1.00'])
+2.00 Exit State: State(1) (name: /state1)
+2.00  Transition(State(1), State(2))
+2.00 Enter State: State(2) (name: /state2)
+2.00 Exit State: State(2) (name: /state2)
+2.00  Transition(State(2), State(1))
+2.00 Enter State: State(1) (name: /state1)
+2.00 (event name: test_event; port: ui; parameters: ['2', '2.00'])
+3.00 Exit State: State(1) (name: /state1)
+3.00  Transition(State(1), State(2))
+3.00 Enter State: State(2) (name: /state2)
+3.00 Exit State: State(2) (name: /state2)
+3.00  Transition(State(2), State(1))
+3.00 Enter State: State(1) (name: /state1)
+3.00 (event name: test_event; port: ui; parameters: ['3', '3.00'])
+4.00 Exit State: State(1) (name: /state1)
+4.00  Transition(State(1), State(2))
+4.00 Enter State: State(2) (name: /state2)
+4.00 Exit State: State(2) (name: /state2)
+4.00  Transition(State(2), State(1))
+4.00 Enter State: State(1) (name: /state1)
+4.00 (event name: test_event; port: ui; parameters: ['4', '4.00'])
+5.00 Exit State: State(1) (name: /state1)
+5.00  Transition(State(1), State(2))
+5.00 Enter State: State(2) (name: /state2)
+5.00 Exit State: State(2) (name: /state2)
+5.00  Transition(State(2), State(3))
+5.00 Enter State: State(3) (name: /end)
+5.00 (event name: test_event; port: ui; parameters: ['5', '5.00'])

+ 142 - 52
tests/Test3/PyDEVS/log.txt

@@ -2,17 +2,17 @@
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.MainApp>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.MainApp>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.ObjectManager>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.ObjectManager>
+		Initial State: <target.ObjectManagerState object at 0x10610e0c0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INITIAL CONDITIONS in model <Tester.Tester>
+	INITIAL CONDITIONS in model <Controller.Tester>
 		Initial State: None
 		Next scheduled internal transition at time 0.000000
 
@@ -20,18 +20,18 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
 			port <private_3_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x104809d90>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10480ac60>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10610e0c0>
 		Output Port Configuration:
 			port <port1>:
 				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
@@ -41,19 +41,19 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
-				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
-		New State: <target.ObjectManagerState object at 0x10480ac60>
+				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
+		New State: <target.ObjectManagerState object at 0x10610e0c0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104809d90>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
 			port <ui>:
 		Next scheduled internal transition at time 0.000000
 
@@ -61,8 +61,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104809d90>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -72,18 +72,18 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
 			port <private_3_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x104809d90>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10480ac60>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10610e0c0>
 		Output Port Configuration:
 			port <port1>:
 				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
@@ -93,8 +93,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104809d90>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -104,8 +104,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104809d90>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -115,18 +115,36 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Tester>
+	INTERNAL TRANSITION in model <Controller.Tester>
 		New State: None
 		Output Port Configuration:
-			port <ui>:
+			port <Test_ui>:
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   1.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104809d90>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			EXIT STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(2), State(1))
+
+			ENTER STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -136,20 +154,38 @@ __  Current Time:   1.000000 __________________________________________
 __  Current Time:   1.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104809d90>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
-				[(event name: test_event; port: ui; parameters: ['1', '1.00'])]
+				(event name: test_event; port: ui; parameters: ['1', '1.00'])
 		Next scheduled internal transition at time 2.000000
 
 
 __  Current Time:   2.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104809d90>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			EXIT STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(2), State(1))
+
+			ENTER STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -159,20 +195,38 @@ __  Current Time:   2.000000 __________________________________________
 __  Current Time:   2.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104809d90>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
-				[(event name: test_event; port: ui; parameters: ['2', '2.00'])]
+				(event name: test_event; port: ui; parameters: ['2', '2.00'])
 		Next scheduled internal transition at time 3.000000
 
 
 __  Current Time:   3.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104809d90>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			EXIT STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(2), State(1))
+
+			ENTER STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -182,20 +236,38 @@ __  Current Time:   3.000000 __________________________________________
 __  Current Time:   3.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104809d90>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
-				[(event name: test_event; port: ui; parameters: ['3', '3.00'])]
+				(event name: test_event; port: ui; parameters: ['3', '3.00'])
 		Next scheduled internal transition at time 4.000000
 
 
 __  Current Time:   4.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104809d90>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			EXIT STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(2), State(1))
+
+			ENTER STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -205,20 +277,38 @@ __  Current Time:   4.000000 __________________________________________
 __  Current Time:   4.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104809d90>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
-				[(event name: test_event; port: ui; parameters: ['4', '4.00'])]
+				(event name: test_event; port: ui; parameters: ['4', '4.00'])
 		Next scheduled internal transition at time 5.000000
 
 
 __  Current Time:   5.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104809d90>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			EXIT STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(2), State(3))
+
+			ENTER STATE in model <MainApp>
+			State: State(3) (name: /end)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -228,11 +318,11 @@ __  Current Time:   5.000000 __________________________________________
 __  Current Time:   5.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104809d90>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
-				[(event name: test_event; port: ui; parameters: ['5', '5.00'])]
+				(event name: test_event; port: ui; parameters: ['5', '5.00'])
 		Next scheduled internal transition at time inf
 

+ 0 - 14
tests/Test3/PyDEVS/runner.py

@@ -1,14 +0,0 @@
-import tkinter as tk
-import target as target
-from sccd.runtime.libs.ui_v2 import UI
-from sccd.runtime.DEVS_loop import DEVSSimulator
-
-if __name__ == '__main__':
-	model = target.Controller(name="controller")
-
-	sim = DEVSSimulator(model)
-	sim.setRealTime(False)
-
-	sim.setVerbose(None)
-
-	sim.simulate()

+ 14 - 12
tests/Test3/PyDEVS/target.py

@@ -101,13 +101,13 @@ class MainAppInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class MainApp(ObjectManagerBase):
+class MainApp(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
-        self.instances[self.next_instance] = MainAppInstance(self)
-        self.next_instance = self.next_instance + 1
+        self.glob_outputs["ui"] = self.addOutPort("ui")
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
     
     def constructObject(self, parameters):
         new_instance = MainAppInstance(self)
@@ -117,10 +117,10 @@ class ObjectManagerState:
     def __init__(self):
         self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
 
-class ObjectManager(TheObjectManager):
+class ObjectManager(ObjectManagerBase):
     def __init__(self, name):
-        TheObjectManager.__init__(self, name)
-        self.State = ObjectManagerState()
+        ObjectManagerBase.__init__(self, name)
+        self.state = ObjectManagerState()
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
 
@@ -132,7 +132,9 @@ class Controller(CoupledDEVS):
         self.out_ui = self.addOutPort("ui")
         Ports.addOutputPort("ui")
         self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomic0 = self.addSubModel(MainApp("MainApp"))
-        self.connectPorts(self.atomic0.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomic0.obj_manager_in)
-        self.connectPorts(self.atomic0.output, self.out_ui)
+        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)
+        self.connectPorts(self.in_ui, self.atomics[0].input)

+ 0 - 0
tests/Test4/PyDEVS/faulty_log.txt


+ 39 - 28
tests/Test4/PyDEVS/log.txt

@@ -2,17 +2,17 @@
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.MainApp>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.MainApp>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.ObjectManager>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.ObjectManager>
+		Initial State: <target.ObjectManagerState object at 0x10610e930>
 		Next scheduled internal transition at time 0.000000
 
 
-	INITIAL CONDITIONS in model <Tester.Tester>
+	INITIAL CONDITIONS in model <Controller.Tester>
 		Initial State: None
 		Next scheduled internal transition at time 0.000000
 
@@ -20,18 +20,18 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
 			port <private_4_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x10480ad80>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x103dc3200>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10610e930>
 		Output Port Configuration:
 			port <port1>:
 				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
@@ -41,29 +41,40 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <ui>:
+				(event name: output_event; port: ui; parameters: ['0.00'])
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
-				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
-		New State: <target.ObjectManagerState object at 0x103dc3200>
+				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
+		New State: <target.ObjectManagerState object at 0x10610e930>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480ad80>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
 			port <ui>:
-				[(event name: output_event; port: ui; parameters: ['0.00'])]
 		Next scheduled internal transition at time 0.000000
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480ad80>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -73,18 +84,18 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
 			port <private_4_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x10480ad80>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x103dc3200>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10610e930>
 		Output Port Configuration:
 			port <port1>:
 				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
@@ -94,8 +105,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480ad80>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -105,8 +116,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480ad80>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -116,9 +127,9 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Tester>
+	INTERNAL TRANSITION in model <Controller.Tester>
 		New State: None
 		Output Port Configuration:
-			port <ui>:
+			port <Test_ui>:
 		Next scheduled internal transition at time inf
 

+ 14 - 12
tests/Test4/PyDEVS/target.py

@@ -73,13 +73,13 @@ class MainAppInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class MainApp(ObjectManagerBase):
+class MainApp(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
-        self.instances[self.next_instance] = MainAppInstance(self)
-        self.next_instance = self.next_instance + 1
+        self.glob_outputs["ui"] = self.addOutPort("ui")
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
     
     def constructObject(self, parameters):
         new_instance = MainAppInstance(self)
@@ -89,10 +89,10 @@ class ObjectManagerState:
     def __init__(self):
         self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
 
-class ObjectManager(TheObjectManager):
+class ObjectManager(ObjectManagerBase):
     def __init__(self, name):
-        TheObjectManager.__init__(self, name)
-        self.State = ObjectManagerState()
+        ObjectManagerBase.__init__(self, name)
+        self.state = ObjectManagerState()
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
 
@@ -104,7 +104,9 @@ class Controller(CoupledDEVS):
         self.out_ui = self.addOutPort("ui")
         Ports.addOutputPort("ui")
         self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomic0 = self.addSubModel(MainApp("MainApp"))
-        self.connectPorts(self.atomic0.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomic0.obj_manager_in)
-        self.connectPorts(self.atomic0.output, self.out_ui)
+        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)
+        self.connectPorts(self.in_ui, self.atomics[0].input)

+ 0 - 0
tests/Test5/PyDEVS/faulty_log.txt


+ 39 - 28
tests/Test5/PyDEVS/log.txt

@@ -2,17 +2,17 @@
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.MainApp>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.MainApp>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.ObjectManager>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.ObjectManager>
+		Initial State: <target.ObjectManagerState object at 0x1061111f0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INITIAL CONDITIONS in model <Tester.Tester>
+	INITIAL CONDITIONS in model <Controller.Tester>
 		Initial State: None
 		Next scheduled internal transition at time 0.000000
 
@@ -20,18 +20,18 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
 			port <private_5_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x10480dc70>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10480c560>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x1061111f0>
 		Output Port Configuration:
 			port <port1>:
 				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
@@ -41,29 +41,40 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <ui>:
+				(event name: output_event; port: ui; parameters: ['0.00'])
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
-				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
-		New State: <target.ObjectManagerState object at 0x10480c560>
+				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
+		New State: <target.ObjectManagerState object at 0x1061111f0>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480dc70>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
 			port <ui>:
-				[(event name: output_event; port: ui; parameters: ['0.00'])]
 		Next scheduled internal transition at time 0.000000
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480dc70>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -73,18 +84,18 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
 			port <private_5_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x10480dc70>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10480c560>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x1061111f0>
 		Output Port Configuration:
 			port <port1>:
 				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
@@ -94,8 +105,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480dc70>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -105,8 +116,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480dc70>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -116,9 +127,9 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Tester>
+	INTERNAL TRANSITION in model <Controller.Tester>
 		New State: None
 		Output Port Configuration:
-			port <ui>:
+			port <Test_ui>:
 		Next scheduled internal transition at time inf
 

+ 14 - 12
tests/Test5/PyDEVS/target.py

@@ -73,13 +73,13 @@ class MainAppInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class MainApp(ObjectManagerBase):
+class MainApp(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
-        self.instances[self.next_instance] = MainAppInstance(self)
-        self.next_instance = self.next_instance + 1
+        self.glob_outputs["ui"] = self.addOutPort("ui")
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
     
     def constructObject(self, parameters):
         new_instance = MainAppInstance(self)
@@ -89,10 +89,10 @@ class ObjectManagerState:
     def __init__(self):
         self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
 
-class ObjectManager(TheObjectManager):
+class ObjectManager(ObjectManagerBase):
     def __init__(self, name):
-        TheObjectManager.__init__(self, name)
-        self.State = ObjectManagerState()
+        ObjectManagerBase.__init__(self, name)
+        self.state = ObjectManagerState()
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
 
@@ -104,7 +104,9 @@ class Controller(CoupledDEVS):
         self.out_ui = self.addOutPort("ui")
         Ports.addOutputPort("ui")
         self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomic0 = self.addSubModel(MainApp("MainApp"))
-        self.connectPorts(self.atomic0.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomic0.obj_manager_in)
-        self.connectPorts(self.atomic0.output, self.out_ui)
+        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)
+        self.connectPorts(self.in_ui, self.atomics[0].input)

+ 0 - 0
tests/Test6/PyDEVS/faulty_log.txt


+ 59 - 50
tests/Test6/PyDEVS/log.txt

@@ -2,22 +2,22 @@
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.A>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.A>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.MainApp>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.MainApp>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.ObjectManager>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.ObjectManager>
+		Initial State: <target.ObjectManagerState object at 0x104c7a120>
 		Next scheduled internal transition at time 0.000000
 
 
-	INITIAL CONDITIONS in model <Tester.Tester>
+	INITIAL CONDITIONS in model <Controller.Tester>
 		Initial State: None
 		Next scheduled internal transition at time 0.000000
 
@@ -25,18 +25,18 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
 			port <private_6_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x10480d8b0>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10480d880>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x104c7a120>
 		Output Port Configuration:
 			port <port1>:
 				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
@@ -47,19 +47,19 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
-				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
-		New State: <target.ObjectManagerState object at 0x10480d880>
+				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
+		New State: <target.ObjectManagerState object at 0x104c7a120>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480d8b0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
 			port <ui>:
 			port <linkA>:
 		Next scheduled internal transition at time 0.000000
@@ -68,19 +68,19 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
-				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
-		New State: <target.ObjectManagerState object at 0x10480d880>
+				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+		New State: <target.ObjectManagerState object at 0x104c7a120>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480d8b0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
+				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
 			port <ui>:
 			port <linkA>:
 		Next scheduled internal transition at time inf
@@ -89,28 +89,28 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
 			port <input>:
 			port <private_7_<narrow_cast>>:
-		New State: {0: <target.AInstance object at 0x10480f560>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
 			port <private_6_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x10480d8b0>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10480d880>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x104c7a120>
 		Output Port Configuration:
 			port <port1>:
 				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
@@ -122,19 +122,19 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
-				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
-		New State: <target.ObjectManagerState object at 0x10480d880>
+				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
+		New State: <target.ObjectManagerState object at 0x104c7a120>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.A>
-		New State: {0: <target.AInstance object at 0x10480f560>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
+				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
 			port <ui>:
 		Next scheduled internal transition at time inf
 
@@ -142,8 +142,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480d8b0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -154,8 +154,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480d8b0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -166,18 +166,18 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
 			port <input>:
 			port <private_6_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x10480d8b0>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10480d880>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x104c7a120>
 		Output Port Configuration:
 			port <port1>:
 				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
@@ -188,8 +188,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480d8b0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -200,12 +209,12 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480d8b0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
-				[(event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])]
+				(event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
 			port <linkA>:
 		Next scheduled internal transition at time inf
 
@@ -213,9 +222,9 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Tester>
+	INTERNAL TRANSITION in model <Controller.Tester>
 		New State: None
 		Output Port Configuration:
-			port <ui>:
+			port <Test_ui>:
 		Next scheduled internal transition at time inf
 

+ 23 - 20
tests/Test6/PyDEVS/target.py

@@ -75,14 +75,14 @@ class MainAppInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class MainApp(ObjectManagerBase):
+class MainApp(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
         self.outputs["linkA"] = self.addOutPort("linkA")
-        self.instances[self.next_instance] = MainAppInstance(self)
-        self.next_instance = self.next_instance + 1
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
     
     def constructObject(self, parameters):
         new_instance = MainAppInstance(self)
@@ -137,11 +137,11 @@ class AInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class A(ObjectManagerBase):
+class A(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
     
     def constructObject(self, parameters):
         new_instance = AInstance(self)
@@ -151,10 +151,10 @@ class ObjectManagerState:
     def __init__(self):
         self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
 
-class ObjectManager(TheObjectManager):
+class ObjectManager(ObjectManagerBase):
     def __init__(self, name):
-        TheObjectManager.__init__(self, name)
-        self.State = ObjectManagerState()
+        ObjectManagerBase.__init__(self, name)
+        self.state = ObjectManagerState()
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
         self.output["A"] = self.addOutPort()
@@ -167,12 +167,15 @@ class Controller(CoupledDEVS):
         self.out_ui = self.addOutPort("ui")
         Ports.addOutputPort("ui")
         self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomic0 = self.addSubModel(MainApp("MainApp"))
-        self.atomic1 = self.addSubModel(A("A"))
-        self.connectPorts(self.atomic0.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomic0.obj_manager_in)
-        self.connectPorts(self.atomic0.outputs["linkA"], self.atomic1.input)
-        self.connectPorts(self.atomic1.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["A"], self.atomic1.obj_manager_in)
-        self.connectPorts(self.atomic0.output, self.out_ui)
-        self.connectPorts(self.atomic1.output, self.out_ui)
+        self.atomics = []
+        self.atomics.append(self.addSubModel(MainApp("MainApp")))
+        self.atomics.append(self.addSubModel(A("A")))
+        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].outputs["linkA"], self.atomics[1].input)
+        self.connectPorts(self.atomics[1].obj_manager_out, self.objectmanager.input)
+        self.connectPorts(self.objectmanager.output["A"], self.atomics[1].obj_manager_in)
+        self.connectPorts(self.atomics[0].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[0].input)
+        self.connectPorts(self.atomics[1].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[1].input)

+ 5 - 0
tests/Test7/PyDEVS/faulty_log.txt

@@ -0,0 +1,5 @@
+0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
+0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
+0.00 (event name: instance_started_succesfully; port: ui; parameters: ['0.00', 'linkA[0]']), 
+0.00 (event name: instance_started_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
+0.00 (event name: instance_started_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])

+ 107 - 78
tests/Test7/PyDEVS/log.txt

@@ -2,22 +2,22 @@
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.A>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.A>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.MainApp>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.MainApp>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.ObjectManager>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.ObjectManager>
+		Initial State: <target.ObjectManagerState object at 0x106111310>
 		Next scheduled internal transition at time 0.000000
 
 
-	INITIAL CONDITIONS in model <Tester.Tester>
+	INITIAL CONDITIONS in model <Controller.Tester>
 		Initial State: None
 		Next scheduled internal transition at time 0.000000
 
@@ -25,18 +25,18 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
 			port <private_8_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x104806150>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x104806360>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106111310>
 		Output Port Configuration:
 			port <port1>:
 				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
@@ -47,19 +47,19 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
-				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
-		New State: <target.ObjectManagerState object at 0x104806360>
+				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
+		New State: <target.ObjectManagerState object at 0x106111310>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104806150>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
+				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
 			port <ui>:
 			port <linkA>:
 		Next scheduled internal transition at time 0.000000
@@ -68,19 +68,19 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
-				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
-		New State: <target.ObjectManagerState object at 0x104806360>
+				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
+		New State: <target.ObjectManagerState object at 0x106111310>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104806150>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
+				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))
 			port <ui>:
 			port <linkA>:
 		Next scheduled internal transition at time inf
@@ -89,28 +89,28 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A']))]
 			port <input>:
 			port <private_9_<narrow_cast>>:
-		New State: {0: <target.AInstance object at 0x10480c710>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
 			port <private_8_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x104806150>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x104806360>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106111310>
 		Output Port Configuration:
 			port <port1>:
 				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
@@ -122,19 +122,19 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
-				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
-		New State: <target.ObjectManagerState object at 0x104806360>
+				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
+		New State: <target.ObjectManagerState object at 0x106111310>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.A>
-		New State: {0: <target.AInstance object at 0x10480c710>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
+				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
 			port <ui>:
 		Next scheduled internal transition at time inf
 
@@ -142,8 +142,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104806150>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -154,8 +154,8 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104806150>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -166,18 +166,18 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
 			port <input>:
 			port <private_8_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x104806150>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x104806360>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106111310>
 		Output Port Configuration:
 			port <port1>:
 				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
@@ -188,8 +188,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104806150>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -200,12 +209,12 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104806150>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
-				[(event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])]
+				(event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
 			port <linkA>:
 		Next scheduled internal transition at time 0.000000
 
@@ -213,19 +222,19 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
-				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
-		New State: <target.ObjectManagerState object at 0x104806360>
+				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
+		New State: <target.ObjectManagerState object at 0x106111310>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104806150>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
+				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
 			port <ui>:
 			port <linkA>:
 		Next scheduled internal transition at time inf
@@ -234,18 +243,18 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
 			port <input>:
 			port <private_9_<narrow_cast>>:
-		New State: {0: <target.AInstance object at 0x10480c710>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x104806360>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106111310>
 		Output Port Configuration:
 			port <port1>:
 			port <port2>:
@@ -256,29 +265,40 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <ui>:
+				(event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
-				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
-		New State: <target.ObjectManagerState object at 0x104806360>
+				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
+		New State: <target.ObjectManagerState object at 0x106111310>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.A>
-		New State: {0: <target.AInstance object at 0x10480c710>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
+				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
 			port <ui>:
-				[(event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])]
 		Next scheduled internal transition at time 0.000000
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.A>
-		New State: {0: <target.AInstance object at 0x10480c710>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -288,18 +308,18 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
 			port <input>:
 			port <private_8_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x104806150>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x104806360>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x106111310>
 		Output Port Configuration:
 			port <port1>:
 				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
@@ -310,8 +330,17 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104806150>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(2), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
@@ -322,12 +351,12 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x104806150>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
 			port <ui>:
-				[(event name: instance_started_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])]
+				(event name: instance_started_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
 			port <linkA>:
 		Next scheduled internal transition at time inf
 
@@ -335,9 +364,9 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Tester>
+	INTERNAL TRANSITION in model <Controller.Tester>
 		New State: None
 		Output Port Configuration:
-			port <ui>:
+			port <Test_ui>:
 		Next scheduled internal transition at time inf
 

+ 23 - 20
tests/Test7/PyDEVS/target.py

@@ -86,14 +86,14 @@ class MainAppInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class MainApp(ObjectManagerBase):
+class MainApp(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
         self.outputs["linkA"] = self.addOutPort("linkA")
-        self.instances[self.next_instance] = MainAppInstance(self)
-        self.next_instance = self.next_instance + 1
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
     
     def constructObject(self, parameters):
         new_instance = MainAppInstance(self)
@@ -148,11 +148,11 @@ class AInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class A(ObjectManagerBase):
+class A(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
     
     def constructObject(self, parameters):
         new_instance = AInstance(self)
@@ -162,10 +162,10 @@ class ObjectManagerState:
     def __init__(self):
         self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
 
-class ObjectManager(TheObjectManager):
+class ObjectManager(ObjectManagerBase):
     def __init__(self, name):
-        TheObjectManager.__init__(self, name)
-        self.State = ObjectManagerState()
+        ObjectManagerBase.__init__(self, name)
+        self.state = ObjectManagerState()
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
         self.output["A"] = self.addOutPort()
@@ -178,12 +178,15 @@ class Controller(CoupledDEVS):
         self.out_ui = self.addOutPort("ui")
         Ports.addOutputPort("ui")
         self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomic0 = self.addSubModel(MainApp("MainApp"))
-        self.atomic1 = self.addSubModel(A("A"))
-        self.connectPorts(self.atomic0.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomic0.obj_manager_in)
-        self.connectPorts(self.atomic0.outputs["linkA"], self.atomic1.input)
-        self.connectPorts(self.atomic1.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["A"], self.atomic1.obj_manager_in)
-        self.connectPorts(self.atomic0.output, self.out_ui)
-        self.connectPorts(self.atomic1.output, self.out_ui)
+        self.atomics = []
+        self.atomics.append(self.addSubModel(MainApp("MainApp")))
+        self.atomics.append(self.addSubModel(A("A")))
+        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].outputs["linkA"], self.atomics[1].input)
+        self.connectPorts(self.atomics[1].obj_manager_out, self.objectmanager.input)
+        self.connectPorts(self.objectmanager.output["A"], self.atomics[1].obj_manager_in)
+        self.connectPorts(self.atomics[0].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[0].input)
+        self.connectPorts(self.atomics[1].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[1].input)

+ 4 - 4
tests/Test8/PyDEVS/faulty_log.txt

@@ -1,4 +1,4 @@
-0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
-0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
-0.00 (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}])
-0.00 (event name: instance_started_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
+0.00 (event name: instance_created_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]'])
+0.00 (event name: statechart_started_succesfully; port: Outport; parameters: ['0.00'])
+0.00 (event name: constructor_initialized_succesfully; port: Outport; parameters: ['0.00', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}])
+0.00 (event name: instance_started_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]'])

+ 213 - 61
tests/Test8/PyDEVS/log.txt

@@ -2,22 +2,22 @@
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.A>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.A>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.MainApp>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.MainApp>
+		Initial State: 
 		Next scheduled internal transition at time inf
 
 
-	INITIAL CONDITIONS in model <Tester.Controller.ObjectManager>
-		Initial State: None
+	INITIAL CONDITIONS in model <Controller.ObjectManager>
+		Initial State: <target.ObjectManagerState object at 0x10610d160>
 		Next scheduled internal transition at time 0.000000
 
 
-	INITIAL CONDITIONS in model <Tester.Tester>
+	INITIAL CONDITIONS in model <Controller.Tester>
 		Initial State: None
 		Next scheduled internal transition at time 0.000000
 
@@ -25,18 +25,18 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
 			port <private_10_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x10480e3f0>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10480d850>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10610d160>
 		Output Port Configuration:
 			port <port1>:
 				[('MainApp', 'MainApp', (event name: start_instance; port: None; parameters: ['MainApp[0]']))]
@@ -47,20 +47,20 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
-				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
-		New State: <target.ObjectManagerState object at 0x10480d850>
+				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
+		New State: <target.ObjectManagerState object at 0x10610d160>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480e3f0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
-			port <ui>:
+				('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))
+			port <Outport>:
 			port <linkA>:
 		Next scheduled internal transition at time 0.000000
 
@@ -68,20 +68,20 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
-				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}]))]
-		New State: <target.ObjectManagerState object at 0x10480d850>
+				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}]))
+		New State: <target.ObjectManagerState object at 0x10610d160>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480e3f0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}]))]
-			port <ui>:
+				('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}]))
+			port <Outport>:
 			port <linkA>:
 		Next scheduled internal transition at time inf
 
@@ -89,28 +89,28 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.A>
+	EXTERNAL TRANSITION in model <Controller.A>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('MainApp', 'A', (event name: create_instance; port: None; parameters: ['linkA', 'A', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}]))]
 			port <input>:
 			port <private_11_<narrow_cast>>:
-		New State: {0: <target.AInstance object at 0x104810e60>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
 			port <input>:
 			port <private_10_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x10480e3f0>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10480d850>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10610d160>
 		Output Port Configuration:
 			port <port1>:
 				[('MainApp', 'MainApp', (event name: instance_started; port: None; parameters: ['MainApp[0]']))]
@@ -122,31 +122,31 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
-				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
-		New State: <target.ObjectManagerState object at 0x10480d850>
+				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
+		New State: <target.ObjectManagerState object at 0x10610d160>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.A>
-		New State: {0: <target.AInstance object at 0x104810e60>}
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
-			port <ui>:
+				('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))
+			port <Outport>:
 		Next scheduled internal transition at time inf
 
 
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480e3f0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-			port <ui>:
+			port <Outport>:
 			port <linkA>:
 		Next scheduled internal transition at time 0.000000
 
@@ -154,11 +154,11 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480e3f0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-			port <ui>:
+			port <Outport>:
 			port <linkA>:
 		Next scheduled internal transition at time inf
 
@@ -166,18 +166,18 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.MainApp>
+	EXTERNAL TRANSITION in model <Controller.MainApp>
 		Input Port Configuration:
 			port <obj_manager_in>:
 				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
 			port <input>:
 			port <private_10_<narrow_cast>>:
-		New State: {0: <target.MainAppInstance object at 0x10480e3f0>}
+		New State: 
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
-		New State: <target.ObjectManagerState object at 0x10480d850>
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10610d160>
 		Output Port Configuration:
 			port <port1>:
 				[('A', 'MainApp', (event name: instance_created; port: None; parameters: ['linkA[0]']))]
@@ -188,11 +188,20 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480e3f0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
+			EXIT STATE in model <MainApp>
+			State: State(1) (name: /state1)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(1), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
 		Output Port Configuration:
 			port <obj_manager_out>:
-			port <ui>:
+			port <Outport>:
 			port <linkA>:
 		Next scheduled internal transition at time 0.000000
 
@@ -200,12 +209,12 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480e3f0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
-			port <ui>:
-				[(event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])]
+			port <Outport>:
+				(event name: instance_created_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]'])
 			port <linkA>:
 		Next scheduled internal transition at time 0.000000
 
@@ -213,20 +222,163 @@ __  Current Time:   0.000000 __________________________________________
 __  Current Time:   0.000000 __________________________________________ 
 
 
-	EXTERNAL TRANSITION in model <Tester.Controller.ObjectManager>
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
 		Input Port Configuration:
 			port <input>:
-				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
-		New State: <target.ObjectManagerState object at 0x10480d850>
+				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
+		New State: <target.ObjectManagerState object at 0x10610d160>
 		Next scheduled internal transition at time 0.000000
 
 
-	INTERNAL TRANSITION in model <Tester.Controller.MainApp>
-		New State: {0: <target.MainAppInstance object at 0x10480e3f0>}
+	INTERNAL TRANSITION in model <Controller.MainApp>
+		New State: 
 		Output Port Configuration:
 			port <obj_manager_out>:
+				('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))
+			port <Outport>:
+			port <linkA>:
+		Next scheduled internal transition at time inf
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.A>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
+			port <input>:
+			port <private_11_<narrow_cast>>:
+		New State: 
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10610d160>
+		Output Port Configuration:
+			port <port1>:
+			port <port2>:
 				[('MainApp', 'A', (event name: start_instance; port: None; parameters: ['linkA[0]']))]
-			port <ui>:
+		Next scheduled internal transition at time inf
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <Outport>:
+				(event name: statechart_started_succesfully; port: Outport; parameters: ['0.00'])
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <Outport>:
+				(event name: constructor_initialized_succesfully; port: Outport; parameters: ['0.00', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}])
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.ObjectManager>
+		Input Port Configuration:
+			port <input>:
+				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
+		New State: <target.ObjectManagerState object at 0x10610d160>
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+				('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))
+			port <Outport>:
+		Next scheduled internal transition at time 0.000000
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	INTERNAL TRANSITION in model <Controller.A>
+		New State: 
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <Outport>:
+		Next scheduled internal transition at time inf
+
+
+__  Current Time:   0.000000 __________________________________________ 
+
+
+	EXTERNAL TRANSITION in model <Controller.MainApp>
+		Input Port Configuration:
+			port <obj_manager_in>:
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
+			port <input>:
+			port <private_10_<narrow_cast>>:
+		New State: 
+		Next scheduled internal transition at time 0.000000
+
+
+	INTERNAL TRANSITION in model <Controller.ObjectManager>
+		New State: <target.ObjectManagerState object at 0x10610d160>
+		Output Port Configuration:
+			port <port1>:
+				[('A', 'MainApp', (event name: instance_started; port: None; parameters: ['linkA[0]']))]
+			port <port2>:
+		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(2) (name: /state2)
+
+			TRANSITION FIRED in model <MainApp>
+			Transition(State(2), State(2))
+
+			ENTER STATE in model <MainApp>
+			State: State(2) (name: /state2)
+
+		Output Port Configuration:
+			port <obj_manager_out>:
+			port <Outport>:
 			port <linkA>:
+		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: instance_started_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]'])
+			port <linkA>:
+		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_Inport>:
 		Next scheduled internal transition at time inf
 

+ 31 - 28
tests/Test8/PyDEVS/target.py

@@ -74,26 +74,26 @@ class MainAppInstance(RuntimeClassBase):
     
     def _state1_0_exec(self, parameters):
         association_name = parameters[0]
-        self.big_step.outputEvent(Event("instance_created_succesfully", self.getOutPortName("ui"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), association_name]))
+        self.big_step.outputEvent(Event("instance_created_succesfully", self.getOutPortName("Outport"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), association_name]))
         self.big_step.outputEventOM(Event("start_instance", None, [self, association_name]))
     
     def _state2_0_exec(self, parameters):
         association_name = parameters[0]
-        self.big_step.outputEvent(Event("instance_started_succesfully", self.getOutPortName("ui"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), association_name]))
+        self.big_step.outputEvent(Event("instance_started_succesfully", self.getOutPortName("Outport"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), association_name]))
     
     def initializeStatechart(self):
         # enter default state
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class MainApp(ObjectManagerBase):
+class MainApp(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["Outport"] = self.addOutPort("Outport")
         self.outputs["linkA"] = self.addOutPort("linkA")
-        self.instances[self.next_instance] = MainAppInstance(self)
-        self.next_instance = self.next_instance + 1
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
     
     def constructObject(self, parameters):
         new_instance = MainAppInstance(self)
@@ -145,19 +145,19 @@ class AInstance(RuntimeClassBase):
         self.states[""].default_state = self.states["/state1"]
     
     def _state1_enter(self):
-        self.big_step.outputEvent(Event("statechart_started_succesfully", self.getOutPortName("ui"), [str('%.2f' % (self.getSimulatedTime() / 1000.0))]))
-        self.big_step.outputEvent(Event("constructor_initialized_succesfully", self.getOutPortName("ui"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), self.integer, self.floating_point, self.astring, self.alist, self.adict]))
+        self.big_step.outputEvent(Event("statechart_started_succesfully", self.getOutPortName("Outport"), [str('%.2f' % (self.getSimulatedTime() / 1000.0))]))
+        self.big_step.outputEvent(Event("constructor_initialized_succesfully", self.getOutPortName("Outport"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), self.integer, self.floating_point, self.astring, self.alist, self.adict]))
     
     def initializeStatechart(self):
         # enter default state
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class A(ObjectManagerBase):
+class A(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["Outport"] = self.addOutPort("Outport")
     
     def constructObject(self, parameters):
         new_instance = AInstance(self, parameters[2], parameters[3], parameters[4], parameters[5], parameters[6])
@@ -167,10 +167,10 @@ class ObjectManagerState:
     def __init__(self):
         self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
 
-class ObjectManager(TheObjectManager):
+class ObjectManager(ObjectManagerBase):
     def __init__(self, name):
-        TheObjectManager.__init__(self, name)
-        self.State = ObjectManagerState()
+        ObjectManagerBase.__init__(self, name)
+        self.state = ObjectManagerState()
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
         self.output["A"] = self.addOutPort()
@@ -178,17 +178,20 @@ class ObjectManager(TheObjectManager):
 class Controller(CoupledDEVS):
     def __init__(self, name):
         CoupledDEVS.__init__(self, name)
-        self.in_ui = self.addInPort("ui")
-        Ports.addInputPort("ui")
-        self.out_ui = self.addOutPort("ui")
-        Ports.addOutputPort("ui")
+        self.in_Inport = self.addInPort("Inport")
+        Ports.addInputPort("Inport")
+        self.out_Outport = self.addOutPort("Outport")
+        Ports.addOutputPort("Outport")
         self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomic0 = self.addSubModel(MainApp("MainApp"))
-        self.atomic1 = self.addSubModel(A("A"))
-        self.connectPorts(self.atomic0.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomic0.obj_manager_in)
-        self.connectPorts(self.atomic0.outputs["linkA"], self.atomic1.input)
-        self.connectPorts(self.atomic1.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["A"], self.atomic1.obj_manager_in)
-        self.connectPorts(self.atomic0.output, self.out_ui)
-        self.connectPorts(self.atomic1.output, self.out_ui)
+        self.atomics = []
+        self.atomics.append(self.addSubModel(MainApp("MainApp")))
+        self.atomics.append(self.addSubModel(A("A")))
+        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].outputs["linkA"], self.atomics[1].input)
+        self.connectPorts(self.atomics[1].obj_manager_out, self.objectmanager.input)
+        self.connectPorts(self.objectmanager.output["A"], self.atomics[1].obj_manager_in)
+        self.connectPorts(self.atomics[0].glob_outputs["Outport"], self.out_Outport)
+        self.connectPorts(self.in_Inport, self.atomics[0].input)
+        self.connectPorts(self.atomics[1].glob_outputs["Outport"], self.out_Outport)
+        self.connectPorts(self.in_Inport, self.atomics[1].input)

+ 8 - 8
tests/Test8/Python/log.txt

@@ -6,15 +6,15 @@ EXIT STATE in model <MainApp>
 ENTER STATE in model <MainApp>
 		State: /state2
 
-OUTPUT EVENT to port <ui>
-	\Event: (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
+OUTPUT EVENT to port <Outport>
+	\Event: (event name: instance_created_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]'])
 
 
-OUTPUT EVENT to port <ui>
-	\Event: (event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
+OUTPUT EVENT to port <Outport>
+	\Event: (event name: statechart_started_succesfully; port: Outport; parameters: ['0.00'])
 
-OUTPUT EVENT to port <ui>
-	\Event: (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}])
+OUTPUT EVENT to port <Outport>
+	\Event: (event name: constructor_initialized_succesfully; port: Outport; parameters: ['0.00', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}])
 
 EXIT STATE in model <MainApp>
 		State: /state2
@@ -22,6 +22,6 @@ EXIT STATE in model <MainApp>
 ENTER STATE in model <MainApp>
 		State: /state2
 
-OUTPUT EVENT to port <ui>
-	\Event: (event name: instance_started_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
+OUTPUT EVENT to port <Outport>
+	\Event: (event name: instance_started_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]'])
 

+ 6 - 6
tests/Test8/Python/target.py

@@ -71,12 +71,12 @@ class MainApp(RuntimeClassBase):
     
     def _state1_0_exec(self, parameters):
         association_name = parameters[0]
-        self.big_step.outputEvent(Event("instance_created_succesfully", self.getOutPortName("ui"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), association_name]))
+        self.big_step.outputEvent(Event("instance_created_succesfully", self.getOutPortName("Outport"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), association_name]))
         self.big_step.outputEventOM(Event("start_instance", None, [self, association_name]))
     
     def _state2_0_exec(self, parameters):
         association_name = parameters[0]
-        self.big_step.outputEvent(Event("instance_started_succesfully", self.getOutPortName("ui"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), association_name]))
+        self.big_step.outputEvent(Event("instance_started_succesfully", self.getOutPortName("Outport"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), association_name]))
     
     def initializeStatechart(self):
         # enter default state
@@ -127,8 +127,8 @@ class A(RuntimeClassBase):
         self.states[""].default_state = self.states["/state1"]
     
     def _state1_enter(self):
-        self.big_step.outputEvent(Event("statechart_started_succesfully", self.getOutPortName("ui"), [str('%.2f' % (self.getSimulatedTime() / 1000.0))]))
-        self.big_step.outputEvent(Event("constructor_initialized_succesfully", self.getOutPortName("ui"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), self.integer, self.floating_point, self.astring, self.alist, self.adict]))
+        self.big_step.outputEvent(Event("statechart_started_succesfully", self.getOutPortName("Outport"), [str('%.2f' % (self.getSimulatedTime() / 1000.0))]))
+        self.big_step.outputEvent(Event("constructor_initialized_succesfully", self.getOutPortName("Outport"), [str('%.2f' % (self.getSimulatedTime() / 1000.0)), self.integer, self.floating_point, self.astring, self.alist, self.adict]))
     
     def initializeStatechart(self):
         # enter default state
@@ -156,6 +156,6 @@ class Controller(ThreadsControllerBase):
         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.addOutputPort("ui")
+        self.addInputPort("Inport")
+        self.addOutputPort("Outport")
         self.object_manager.createInstance("MainApp", [])

+ 4 - 4
tests/Test8/expected_trace.txt

@@ -1,4 +1,4 @@
-0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
-0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00'])
-0.00 (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}])
-0.00 (event name: instance_started_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
+0.00 (event name: instance_created_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]'])
+0.00 (event name: statechart_started_succesfully; port: Outport; parameters: ['0.00'])
+0.00 (event name: constructor_initialized_succesfully; port: Outport; parameters: ['0.00', 1, 3.14, 'test', [1, 2, 3], {'1': 1, '2': 2, '3': 3}])
+0.00 (event name: instance_started_succesfully; port: Outport; parameters: ['0.00', 'linkA[0]'])

+ 6 - 6
tests/Test8/sccd.xml

@@ -3,8 +3,8 @@
     <description>
         Test 8: Check if an instance is created and started successfully with constructor parameters (other than the main app)
     </description>
-    <inport name="ui"/>
-    <outport name="ui"/>
+    <inport name="Inport" />
+    <outport name="Outport"/>
     <class name="MainApp" default="true">
         <relationships>
             <association name="linkA" class="A" />
@@ -25,7 +25,7 @@
                 </onentry>
                 <transition event='instance_created' target='../state2'>
                     <parameter name="association_name" type="string"/>
-                    <raise port="ui" event="instance_created_succesfully">
+                    <raise port="Outport" event="instance_created_succesfully">
                         <parameter expr="str('%.2f' % (self.getSimulatedTime() / 1000.0))" />
                         <parameter expr="association_name" />
                     </raise>
@@ -37,7 +37,7 @@
             <state id="state2">
                 <transition event='instance_started' target='.'>
                     <parameter name="association_name" type="string"/>
-                    <raise port="ui" event="instance_started_succesfully">
+                    <raise port="Outport" event="instance_started_succesfully">
                         <parameter expr="str('%.2f' % (self.getSimulatedTime() / 1000.0))" />
                         <parameter expr="association_name" />
                     </raise>
@@ -64,10 +64,10 @@
         <scxml initial="state1">
             <state id="state1">
                 <onentry>
-                    <raise port="ui" event="statechart_started_succesfully">
+                    <raise port="Outport" event="statechart_started_succesfully">
                         <parameter expr="str('%.2f' % (self.getSimulatedTime() / 1000.0))" />
                     </raise>
-                    <raise port="ui" event="constructor_initialized_succesfully">
+                    <raise port="Outport" event="constructor_initialized_succesfully">
                         <parameter expr="str('%.2f' % (self.getSimulatedTime() / 1000.0))" />
                         <parameter expr="self.integer" />
                         <parameter expr="self.floating_point" />

+ 20 - 20
tests/Test9/PyDEVS/faulty_log.txt

@@ -1,30 +1,30 @@
 0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[0]'])
-0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 10])
-0.00 (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 10])
+0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 10]) 
+(event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 10])
 0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[1]'])
-0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 9])
-0.00 (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 9])
+0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 9]), 
+(event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 9])
 0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[2]'])
-0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 8])
-0.00 (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 8])
+0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 8]), 
+(event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 8])
 0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[3]'])
-0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 7])
-0.00 (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 7])
+0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 7]), 
+(event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 7])
 0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[4]'])
-0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 6])
-0.00 (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 6])
+0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 6]), 
+(event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 6])
 0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[5]'])
-0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 5])
-0.00 (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 5])
+0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 5]), 
+(event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 5])
 0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[6]'])
-0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 4])
-0.00 (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 4])
+0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 4]), 
+(event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 4])
 0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[7]'])
-0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 3])
-0.00 (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 3])
+0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 3]), 
+(event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 3])
 0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[8]'])
-0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 2])
-0.00 (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 2])
+0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 2]), 
+(event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 2])
 0.00 (event name: instance_created_succesfully; port: ui; parameters: ['0.00', 'linkA[9]'])
-0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 1])
-0.00 (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 1])
+0.00 (event name: statechart_started_succesfully; port: ui; parameters: ['0.00', 1]),
+ (event name: constructor_initialized_succesfully; port: ui; parameters: ['0.00', 1])

Plik diff jest za duży
+ 1255 - 505
tests/Test9/PyDEVS/log.txt


+ 23 - 20
tests/Test9/PyDEVS/target.py

@@ -105,14 +105,14 @@ class MainAppInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class MainApp(ObjectManagerBase):
+class MainApp(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
         self.outputs["linkA"] = self.addOutPort("linkA")
-        self.instances[self.next_instance] = MainAppInstance(self)
-        self.next_instance = self.next_instance + 1
+        self.state.instances[self.state.next_instance] = MainAppInstance(self)
+        self.state.next_instance = self.state.next_instance + 1
     
     def constructObject(self, parameters):
         new_instance = MainAppInstance(self)
@@ -168,11 +168,11 @@ class AInstance(RuntimeClassBase):
         self.default_targets = self.states["/state1"].getEffectiveTargetStates()
         RuntimeClassBase.initializeStatechart(self)
 
-class A(ObjectManagerBase):
+class A(ClassBase):
     def __init__(self, name):
-        ObjectManagerBase.__init__(self, name)
+        ClassBase.__init__(self, name)
         self.input = self.addInPort("input")
-        self.output = self.addOutPort("ui")
+        self.glob_outputs["ui"] = self.addOutPort("ui")
     
     def constructObject(self, parameters):
         new_instance = AInstance(self, parameters[2])
@@ -182,10 +182,10 @@ class ObjectManagerState:
     def __init__(self):
         self.to_send = [("MainApp", "MainApp", Event("start_instance", None, ["MainApp[0]"], 0))]
 
-class ObjectManager(TheObjectManager):
+class ObjectManager(ObjectManagerBase):
     def __init__(self, name):
-        TheObjectManager.__init__(self, name)
-        self.State = ObjectManagerState()
+        ObjectManagerBase.__init__(self, name)
+        self.state = ObjectManagerState()
         self.input = self.addInPort("input")
         self.output["MainApp"] = self.addOutPort()
         self.output["A"] = self.addOutPort()
@@ -198,12 +198,15 @@ class Controller(CoupledDEVS):
         self.out_ui = self.addOutPort("ui")
         Ports.addOutputPort("ui")
         self.objectmanager = self.addSubModel(ObjectManager("ObjectManager"))
-        self.atomic0 = self.addSubModel(MainApp("MainApp"))
-        self.atomic1 = self.addSubModel(A("A"))
-        self.connectPorts(self.atomic0.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["MainApp"], self.atomic0.obj_manager_in)
-        self.connectPorts(self.atomic0.outputs["linkA"], self.atomic1.input)
-        self.connectPorts(self.atomic1.obj_manager_out, self.objectmanager.input)
-        self.connectPorts(self.objectmanager.output["A"], self.atomic1.obj_manager_in)
-        self.connectPorts(self.atomic0.output, self.out_ui)
-        self.connectPorts(self.atomic1.output, self.out_ui)
+        self.atomics = []
+        self.atomics.append(self.addSubModel(MainApp("MainApp")))
+        self.atomics.append(self.addSubModel(A("A")))
+        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].outputs["linkA"], self.atomics[1].input)
+        self.connectPorts(self.atomics[1].obj_manager_out, self.objectmanager.input)
+        self.connectPorts(self.objectmanager.output["A"], self.atomics[1].obj_manager_in)
+        self.connectPorts(self.atomics[0].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[0].input)
+        self.connectPorts(self.atomics[1].glob_outputs["ui"], self.out_ui)
+        self.connectPorts(self.in_ui, self.atomics[1].input)