Ver código fonte

Add DEVS merge code

Yentl Van Tendeloo 7 anos atrás
pai
commit
405315d849

+ 0 - 22
models/WSC/ADEVS.mvc

@@ -1,22 +0,0 @@
-SimpleAttribute PythonCode {}
-SimpleAttribute String {}
-SimpleAttribute Natural {}
-
-Class AtomicDEVSBlock {
-    name : String
-    parameters : Natural
-    timeAdvance: PythonCode
-    outputFnc: PythonCode
-    intTransition: PythonCode
-    extTransition: PythonCode
-    initialState: PythonCode
-}
-
-Class Port {
-    name: String
-}
-
-Class InputPort: Port {}
-Class OutputPort: Port {}
-
-Association DEVSBlockToPort(AtomicDEVSBlock, Port) {}

+ 0 - 25
models/WSC/CDEVS.mvc

@@ -1,25 +0,0 @@
-SimpleAttribute PythonCode {}
-SimpleAttribute String {}
-
-Class CoupledDEVSBlock {
-    name : String
-}
-
-Class DEVSInstance {
-    name: String
-    type: String
-    parameters: String
-}
-
-Association SubModel(CoupledDEVSBlock, DEVSInstance) {}
-
-Class Port {
-    name: String
-}
-
-Class InputPort: Port {}
-Class OutputPort: Port {}
-
-Association DEVSBlockToPort(CoupledDEVSBlock, Port) {}
-Association DEVSInstanceToPort(DEVSInstance, Port) {}
-Association Channel (Port, Port) {}

+ 3 - 0
models/WSC/DEVS.mvc

@@ -1,8 +1,10 @@
 SimpleAttribute PythonCode {}
 SimpleAttribute String {}
+SimpleAttribute Natural {}
 
 Class BaseDEVSBlock {
     name: String
+    parameters : Natural
 }
 
 Class AtomicDEVSBlock: BaseDEVSBlock {
@@ -18,6 +20,7 @@ Class CoupledDEVSBlock: BaseDEVSBlock {}
 Class DEVSInstance {
     name: String
     type: String
+    parameters: String
 }
 
 Association SubModel(CoupledDEVSBlock, DEVSInstance) {}

+ 36 - 0
models/WSC/DEVS_merge.alc

@@ -0,0 +1,36 @@
+include "primitives.alh"
+include "object_operations.alh"
+include "modelling.alh"
+
+Boolean function main(model : Element):
+	// Find all source elements and add them to the target element
+	// We actually only have to change the type of each element and rename a bit!
+	// Model merge operations in the Modelverse take care of the rest automatically
+
+	Element all_elements
+	Element split
+	String key
+	String new_key
+	String type
+
+	all_elements = dict_keys(model["model"])
+
+	while (set_len(all_elements) > 0):
+		key = set_pop(all_elements)
+		// key now contains an element, which we must retype
+		split = string_split(key, "/")
+		if (list_len(split) > 1):
+			new_key = list_read(split, 1)
+			dict_add(model["model"], new_key, model["model"][key])
+			dict_delete(model["model"], key)
+			key = new_key
+
+		type = read_type(model, key)
+		split = string_split(type, "/")
+		// Got the type, which might contain a /
+		if (list_len(split) > 1):
+			type = list_read(split, 1)
+			// Strip of the part before the / and make it into "DEVS"
+			retype(model, key, "result/" + type)
+
+	return True!

+ 116 - 116
models/WSC/PM_to_DEVS.mvc

@@ -8,7 +8,7 @@ Composite schedule {
     {Contains} Atomic add_resource_handler {
         LHS {}
         RHS {
-            Post_CDEVS/DEVSInstance post_resource_1 {
+            Post_DEVS/DEVSInstance post_resource_1 {
                 label = "1"
                 value_name = $
                     String function value(model : Element, name : String, mapping : Element):
@@ -19,18 +19,18 @@ Composite schedule {
                         return "ResourceHandler"!
                     $
             }
-            Post_CDEVS/InputPort post_resource_2 {
+            Post_DEVS/InputPort post_resource_2 {
                 label = "2"
                 name = "resource_in"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_resource_1, post_resource_2) {
+            Post_DEVS/DEVSInstanceToPort (post_resource_1, post_resource_2) {
                 label = "3"
             }
-            Post_CDEVS/OutputPort post_resource_3 {
+            Post_DEVS/OutputPort post_resource_3 {
                 label = "4"
                 name = "resource_out"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_resource_1, post_resource_3) {
+            Post_DEVS/DEVSInstanceToPort (post_resource_1, post_resource_3) {
                 label = "5"
             }
         }
@@ -47,7 +47,7 @@ Composite schedule {
             Post_PM/Initial post_init_0 {
                 label = "0"
             }
-            Post_CDEVS/DEVSInstance post_init_1 {
+            Post_DEVS/DEVSInstance post_init_1 {
                 label = "1"
                 value_name = $
                     String function value(model : Element, name : String, mapping : Element):
@@ -62,11 +62,11 @@ Composite schedule {
                 label = "1"
             }
 
-            Post_CDEVS/OutputPort post_init_2 {
+            Post_DEVS/OutputPort post_init_2 {
                 label = "2"
                 name = "control_out"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_init_1, post_init_2) {
+            Post_DEVS/DEVSInstanceToPort (post_init_1, post_init_2) {
                 label = "3"
             }
         }
@@ -83,7 +83,7 @@ Composite schedule {
             Post_PM/Initial post_finish_0 {
                 label = "0"
             }
-            Post_CDEVS/DEVSInstance post_finish_1 {
+            Post_DEVS/DEVSInstance post_finish_1 {
                 label = "1"
                 value_name = $
                     String function value(model : Element, name : String, mapping : Element):
@@ -98,11 +98,11 @@ Composite schedule {
                 label = "2"
             }
 
-            Post_CDEVS/InputPort post_finish_2 {
+            Post_DEVS/InputPort post_finish_2 {
                 label = "3"
                 name = "control_in"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_finish_1, post_finish_2) {
+            Post_DEVS/DEVSInstanceToPort (post_finish_1, post_finish_2) {
                 label = "4"
             }
         }
@@ -119,7 +119,7 @@ Composite schedule {
             Post_PM/Initial post_activity_0 {
                 label = "0"
             }
-            Post_CDEVS/DEVSInstance post_activity_1 {
+            Post_DEVS/DEVSInstance post_activity_1 {
                 label = "1"
                 value_name = $
                     String function value(model : Element, name : String, mapping : Element):
@@ -138,35 +138,35 @@ Composite schedule {
                 label = "1"
             }
 
-            Post_CDEVS/InputPort post_activity_2 {
+            Post_DEVS/InputPort post_activity_2 {
                 label = "2"
                 name = "resource_in"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_activity_1, post_activity_2) {
+            Post_DEVS/DEVSInstanceToPort (post_activity_1, post_activity_2) {
                 label = "2"
             }
 
-            Post_CDEVS/OutputPort post_activity_3 {
+            Post_DEVS/OutputPort post_activity_3 {
                 label = "3"
                 name = "resource_out"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_activity_1, post_activity_3) {
+            Post_DEVS/DEVSInstanceToPort (post_activity_1, post_activity_3) {
                 label = "4"
             }
 
-            Post_CDEVS/InputPort post_activity_4 {
+            Post_DEVS/InputPort post_activity_4 {
                 label = "5"
                 name = "control_in"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_activity_1, post_activity_4) {
+            Post_DEVS/DEVSInstanceToPort (post_activity_1, post_activity_4) {
                 label = "6"
             }
 
-            Post_CDEVS/OutputPort post_activity_5 {
+            Post_DEVS/OutputPort post_activity_5 {
                 label = "7"
                 name = "control_out"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_activity_1, post_activity_5) {
+            Post_DEVS/DEVSInstanceToPort (post_activity_1, post_activity_5) {
                 label = "8"
             }
         }
@@ -183,7 +183,7 @@ Composite schedule {
             Post_PM/Initial post_split_0 {
                 label = "0"
             }
-            Post_CDEVS/DEVSInstance post_split_1 {
+            Post_DEVS/DEVSInstance post_split_1 {
                 label = "1"
                 value_name = $
                     String function value(model : Element, name : String, mapping : Element):
@@ -198,19 +198,19 @@ Composite schedule {
                 label = "2"
             }
 
-            Post_CDEVS/InputPort post_split_2 {
+            Post_DEVS/InputPort post_split_2 {
                 label = "3"
                 name = "control_in"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_split_1, post_split_2) {
+            Post_DEVS/DEVSInstanceToPort (post_split_1, post_split_2) {
                 label = "4"
             }
 
-            Post_CDEVS/OutputPort post_split_3 {
+            Post_DEVS/OutputPort post_split_3 {
                 label = "5"
                 name = "control_out"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_split_1, post_split_3) {
+            Post_DEVS/DEVSInstanceToPort (post_split_1, post_split_3) {
                 label = "6"
             }
         }
@@ -227,7 +227,7 @@ Composite schedule {
             Post_PM/Initial post_sync_0 {
                 label = "0"
             }
-            Post_CDEVS/DEVSInstance post_sync_1 {
+            Post_DEVS/DEVSInstance post_sync_1 {
                 label = "1"
                 value_name = $
                     String function value(model : Element, name : String, mapping : Element):
@@ -242,19 +242,19 @@ Composite schedule {
                 label = "2"
             }
 
-            Post_CDEVS/InputPort post_sync_2 {
+            Post_DEVS/InputPort post_sync_2 {
                 label = "3"
                 name = "control_in"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_sync_1, post_sync_2) {
+            Post_DEVS/DEVSInstanceToPort (post_sync_1, post_sync_2) {
                 label = "4"
             }
 
-            Post_CDEVS/OutputPort post_sync_3 {
+            Post_DEVS/OutputPort post_sync_3 {
                 label = "5"
                 name = "control_out"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_sync_1, post_sync_3) {
+            Post_DEVS/DEVSInstanceToPort (post_sync_1, post_sync_3) {
                 label = "6"
             }
         }
@@ -271,7 +271,7 @@ Composite schedule {
             Post_PM/Initial post_xor_0 {
                 label = "0"
             }
-            Post_CDEVS/DEVSInstance post_xor_1 {
+            Post_DEVS/DEVSInstance post_xor_1 {
                 label = "1"
                 value_name = $
                     String function value(model : Element, name : String, mapping : Element):
@@ -286,26 +286,26 @@ Composite schedule {
                 label = "2"
             }
 
-            Post_CDEVS/InputPort post_xor_2 {
+            Post_DEVS/InputPort post_xor_2 {
                 label = "3"
                 name = "control_in"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_xor_1, post_xor_2) {
+            Post_DEVS/DEVSInstanceToPort (post_xor_1, post_xor_2) {
                 label = "4"
             }
 
-            Post_CDEVS/OutputPort post_xor_3 {
+            Post_DEVS/OutputPort post_xor_3 {
                 label = "5"
                 name = "control_out1"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_xor_1, post_xor_3) {
+            Post_DEVS/DEVSInstanceToPort (post_xor_1, post_xor_3) {
                 label = "6"
             }
-            Post_CDEVS/OutputPort post_xor_4 {
+            Post_DEVS/OutputPort post_xor_4 {
                 label = "7"
                 name = "control_out2"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_xor_1, post_xor_4) {
+            Post_DEVS/DEVSInstanceToPort (post_xor_1, post_xor_4) {
                 label = "8"
             }
         }
@@ -322,7 +322,7 @@ Composite schedule {
             Post_PM/Initial post_merge_0 {
                 label = "0"
             }
-            Post_CDEVS/DEVSInstance post_merge_1 {
+            Post_DEVS/DEVSInstance post_merge_1 {
                 label = "1"
                 value_name = $
                     String function value(model : Element, name : String, mapping : Element):
@@ -337,19 +337,19 @@ Composite schedule {
                 label = "2"
             }
 
-            Post_CDEVS/InputPort post_merge_2 {
+            Post_DEVS/InputPort post_merge_2 {
                 label = "3"
                 name = "control_in"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_merge_1, post_merge_2) {
+            Post_DEVS/DEVSInstanceToPort (post_merge_1, post_merge_2) {
                 label = "4"
             }
 
-            Post_CDEVS/OutputPort post_merge_3 {
+            Post_DEVS/OutputPort post_merge_3 {
                 label = "5"
                 name = "control_out"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_merge_1, post_merge_3) {
+            Post_DEVS/DEVSInstanceToPort (post_merge_1, post_merge_3) {
                 label = "6"
             }
         }
@@ -366,7 +366,7 @@ Composite schedule {
             Post_PM/Initial post_multi_0 {
                 label = "0"
             }
-            Post_CDEVS/DEVSInstance post_multi_1 {
+            Post_DEVS/DEVSInstance post_multi_1 {
                 label = "1"
                 value_name = $
                     String function value(model : Element, name : String, mapping : Element):
@@ -385,35 +385,35 @@ Composite schedule {
                 label = "2"
             }
 
-            Post_CDEVS/InputPort post_multi_2 {
+            Post_DEVS/InputPort post_multi_2 {
                 label = "3"
                 name = "resource_in"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_multi_1, post_multi_2) {
+            Post_DEVS/DEVSInstanceToPort (post_multi_1, post_multi_2) {
                 label = "4"
             }
 
-            Post_CDEVS/OutputPort post_multi_3 {
+            Post_DEVS/OutputPort post_multi_3 {
                 label = "5"
                 name = "resource_out"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_multi_1, post_multi_3) {
+            Post_DEVS/DEVSInstanceToPort (post_multi_1, post_multi_3) {
                 label = "6"
             }
 
-            Post_CDEVS/InputPort post_multi_4 {
+            Post_DEVS/InputPort post_multi_4 {
                 label = "7"
                 name = "control_in"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_multi_1, post_multi_4) {
+            Post_DEVS/DEVSInstanceToPort (post_multi_1, post_multi_4) {
                 label = "8"
             }
 
-            Post_CDEVS/OutputPort post_multi_5 {
+            Post_DEVS/OutputPort post_multi_5 {
                 label = "9"
                 name = "control_out"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_multi_1, post_multi_5) {
+            Post_DEVS/DEVSInstanceToPort (post_multi_1, post_multi_5) {
                 label = "10"
             }
         }
@@ -421,65 +421,65 @@ Composite schedule {
 
     {Contains} ForAll map_resources_to {
         LHS {
-            Pre_CDEVS/DEVSInstance pre_mrt_0 {
+            Pre_DEVS/DEVSInstance pre_mrt_0 {
                 label = "0"
                 constraint_name = $
                     Boolean function constraint(model : Element, name : String):
                         return (cast_string(read_attribute(model, name, "type")) == "ResourceHandler")!
                     $
             }
-            Pre_CDEVS/Port pre_mrt_1 {
+            Pre_DEVS/Port pre_mrt_1 {
                 label = "1"
                 constraint_name = $
                     Boolean function constraint(model : Element, name : String):
                         return (cast_string(read_attribute(model, name, "type")) == "resource_in")!
                     $
             }
-            Pre_CDEVS/DEVSInstanceToPort (pre_mrt_0, pre_mrt_1) {
+            Pre_DEVS/DEVSInstanceToPort (pre_mrt_0, pre_mrt_1) {
                 label = "2"
             }
 
-            Pre_CDEVS/DEVSInstance pre_mrt_2 {
+            Pre_DEVS/DEVSInstance pre_mrt_2 {
                 label = "3"
                 constraint_name = $
                     Boolean function constraint(model : Element, name : String):
                         return (cast_string(read_attribute(model, name, "type")) != "ResourceHandler")!
                     $
             }
-            Pre_CDEVS/Port pre_mrt_3 {
+            Pre_DEVS/Port pre_mrt_3 {
                 label = "4"
                 constraint_name = $
                     Boolean function constraint(model : Element, name : String):
                         return (cast_string(read_attribute(model, name, "type")) == "resource_out")!
                     $
             }
-            Pre_CDEVS/DEVSInstanceToPort (pre_mrt_2, pre_mrt_3) {
+            Pre_DEVS/DEVSInstanceToPort (pre_mrt_2, pre_mrt_3) {
                 label = "5"
             }
         }
     
         RHS {
-            Post_CDEVS/DEVSInstance post_mrt_0 {
+            Post_DEVS/DEVSInstance post_mrt_0 {
                 label = "0"
             }
-            Post_CDEVS/Port post_mrt_1 {
+            Post_DEVS/Port post_mrt_1 {
                 label = "1"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_mrt_0, post_mrt_1) {
+            Post_DEVS/DEVSInstanceToPort (post_mrt_0, post_mrt_1) {
                 label = "2"
             }
 
-            Post_CDEVS/DEVSInstance post_mrt_2 {
+            Post_DEVS/DEVSInstance post_mrt_2 {
                 label = "3"
             }
-            Post_CDEVS/Port post_mrt_3 {
+            Post_DEVS/Port post_mrt_3 {
                 label = "4"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_mrt_2, post_mrt_3) {
+            Post_DEVS/DEVSInstanceToPort (post_mrt_2, post_mrt_3) {
                 label = "5"
             }
 
-            Post_CDEVS/Channel (post_mrt_3, post_mrt_1) {
+            Post_DEVS/Channel (post_mrt_3, post_mrt_1) {
                 label = "6"
             }
         }
@@ -487,65 +487,65 @@ Composite schedule {
 
     {Contains} ForAll map_resources_from {
         LHS {
-            Pre_CDEVS/DEVSInstance pre_mrf_0 {
+            Pre_DEVS/DEVSInstance pre_mrf_0 {
                 label = "0"
                 constraint_name = $
                     Boolean function constraint(model : Element, name : String):
                         return (cast_string(read_attribute(model, name, "type")) == "ResourceHandler")!
                     $
             }
-            Pre_CDEVS/Port pre_mrf_1 {
+            Pre_DEVS/Port pre_mrf_1 {
                 label = "1"
                 constraint_name = $
                     Boolean function constraint(model : Element, name : String):
                         return (cast_string(read_attribute(model, name, "type")) == "resource_out")!
                     $
             }
-            Pre_CDEVS/DEVSInstanceToPort (pre_mrf_0, pre_mrf_1) {
+            Pre_DEVS/DEVSInstanceToPort (pre_mrf_0, pre_mrf_1) {
                 label = "2"
             }
 
-            Pre_CDEVS/DEVSInstance pre_mrf_2 {
+            Pre_DEVS/DEVSInstance pre_mrf_2 {
                 label = "3"
                 constraint_name = $
                     Boolean function constraint(model : Element, name : String):
                         return (cast_string(read_attribute(model, name, "type")) != "ResourceHandler")!
                     $
             }
-            Pre_CDEVS/Port pre_mrf_3 {
+            Pre_DEVS/Port pre_mrf_3 {
                 label = "4"
                 constraint_name = $
                     Boolean function constraint(model : Element, name : String):
                         return (cast_string(read_attribute(model, name, "type")) == "resource_in")!
                     $
             }
-            Pre_CDEVS/DEVSInstanceToPort (pre_mrf_2, pre_mrf_3) {
+            Pre_DEVS/DEVSInstanceToPort (pre_mrf_2, pre_mrf_3) {
                 label = "5"
             }
         }
     
         RHS {
-            Post_CDEVS/DEVSInstance post_mrf_0 {
+            Post_DEVS/DEVSInstance post_mrf_0 {
                 label = "0"
             }
-            Post_CDEVS/Port post_mrf_1 {
+            Post_DEVS/Port post_mrf_1 {
                 label = "1"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_mrf_0, post_mrf_1) {
+            Post_DEVS/DEVSInstanceToPort (post_mrf_0, post_mrf_1) {
                 label = "2"
             }
 
-            Post_CDEVS/DEVSInstance post_mrf_2 {
+            Post_DEVS/DEVSInstance post_mrf_2 {
                 label = "3"
             }
-            Post_CDEVS/Port post_mrf_3 {
+            Post_DEVS/Port post_mrf_3 {
                 label = "4"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_mrf_2, post_mrf_3) {
+            Post_DEVS/DEVSInstanceToPort (post_mrf_2, post_mrf_3) {
                 label = "5"
             }
 
-            Post_CDEVS/Channel (post_mrf_1, post_mrf_3) {
+            Post_DEVS/Channel (post_mrf_1, post_mrf_3) {
                 label = "6"
             }
         }
@@ -553,31 +553,31 @@ Composite schedule {
 
     {Contains} ForAll map_control {
         LHS {
-            Pre_CDEVS/DEVSInstance pre_map_0 {
+            Pre_DEVS/DEVSInstance pre_map_0 {
                 label = "0"
             }
-            Pre_CDEVS/Port pre_map_1 {
+            Pre_DEVS/Port pre_map_1 {
                 label = "1"
                 constraint_name = $
                     Boolean function constraint(model : Element, name : String):
                         return (cast_string(read_attribute(model, name, "type")) == "control_out")!
                     $
             }
-            Pre_CDEVS/DEVSInstanceToPort (pre_map_0, pre_map_1) {
+            Pre_DEVS/DEVSInstanceToPort (pre_map_0, pre_map_1) {
                 label = "2"
             }
 
-            Pre_CDEVS/DEVSInstance pre_map_2 {
+            Pre_DEVS/DEVSInstance pre_map_2 {
                 label = "3"
             }
-            Pre_CDEVS/Port pre_map_3 {
+            Pre_DEVS/Port pre_map_3 {
                 label = "4"
                 constraint_name = $
                     Boolean function constraint(model : Element, name : String):
                         return (cast_string(read_attribute(model, name, "type")) == "control_in")!
                     $
             }
-            Pre_CDEVS/DEVSInstanceToPort (pre_map_2, pre_map_3) {
+            Pre_DEVS/DEVSInstanceToPort (pre_map_2, pre_map_3) {
                 label = "5"
             }
             Pre_PM/ProcessNode pre_map_4 {
@@ -599,23 +599,23 @@ Composite schedule {
         }
     
         RHS {
-            Post_CDEVS/DEVSInstance post_map_0 {
+            Post_DEVS/DEVSInstance post_map_0 {
                 label = "0"
             }
-            Post_CDEVS/Port post_map_1 {
+            Post_DEVS/Port post_map_1 {
                 label = "1"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_map_0, post_map_1) {
+            Post_DEVS/DEVSInstanceToPort (post_map_0, post_map_1) {
                 label = "2"
             }
 
-            Post_CDEVS/DEVSInstance post_map_2 {
+            Post_DEVS/DEVSInstance post_map_2 {
                 label = "3"
             }
-            Post_CDEVS/Port post_map_3 {
+            Post_DEVS/Port post_map_3 {
                 label = "4"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_map_2, post_map_3) {
+            Post_DEVS/DEVSInstanceToPort (post_map_2, post_map_3) {
                 label = "5"
             }
 
@@ -634,7 +634,7 @@ Composite schedule {
             Post_PM/Next (post_map_4, post_map_5) {
                 label = "10"
             }
-            Post_CDEVS/Channel (post_map_1, post_map_3) {
+            Post_DEVS/Channel (post_map_1, post_map_3) {
                 label = "11"
             }
         }
@@ -642,31 +642,31 @@ Composite schedule {
 
     {Contains} ForAll map_control_decision_true {
         LHS {
-            Pre_CDEVS/DEVSInstance pre_mdt_0 {
+            Pre_DEVS/DEVSInstance pre_mdt_0 {
                 label = "0"
             }
-            Pre_CDEVS/Port pre_mdt_1 {
+            Pre_DEVS/Port pre_mdt_1 {
                 label = "1"
                 constraint_name = $
                     Boolean function constraint(model : Element, name : String):
                         return (cast_string(read_attribute(model, name, "type")) == "control_out1")!
                     $
             }
-            Pre_CDEVS/DEVSInstanceToPort (pre_mdt_0, pre_mdt_1) {
+            Pre_DEVS/DEVSInstanceToPort (pre_mdt_0, pre_mdt_1) {
                 label = "2"
             }
 
-            Pre_CDEVS/DEVSInstance pre_mdt_2 {
+            Pre_DEVS/DEVSInstance pre_mdt_2 {
                 label = "3"
             }
-            Pre_CDEVS/Port pre_mdt_3 {
+            Pre_DEVS/Port pre_mdt_3 {
                 label = "4"
                 constraint_name = $
                     Boolean function constraint(model : Element, name : String):
                         return (cast_string(read_attribute(model, name, "type")) == "control_in")!
                     $
             }
-            Pre_CDEVS/DEVSInstanceToPort (pre_mdt_2, pre_mdt_3) {
+            Pre_DEVS/DEVSInstanceToPort (pre_mdt_2, pre_mdt_3) {
                 label = "5"
             }
             Pre_PM/ProcessNode pre_mdt_4 {
@@ -688,23 +688,23 @@ Composite schedule {
         }
     
         RHS {
-            Post_CDEVS/DEVSInstance post_mdt_0 {
+            Post_DEVS/DEVSInstance post_mdt_0 {
                 label = "0"
             }
-            Post_CDEVS/Port post_mdt_1 {
+            Post_DEVS/Port post_mdt_1 {
                 label = "1"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_mdt_0, post_mdt_1) {
+            Post_DEVS/DEVSInstanceToPort (post_mdt_0, post_mdt_1) {
                 label = "2"
             }
 
-            Post_CDEVS/DEVSInstance post_mdt_2 {
+            Post_DEVS/DEVSInstance post_mdt_2 {
                 label = "3"
             }
-            Post_CDEVS/Port post_mdt_3 {
+            Post_DEVS/Port post_mdt_3 {
                 label = "4"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_mdt_2, post_mdt_3) {
+            Post_DEVS/DEVSInstanceToPort (post_mdt_2, post_mdt_3) {
                 label = "5"
             }
 
@@ -723,7 +723,7 @@ Composite schedule {
             Post_PM/DecisionTrue (post_mdt_4, post_mdt_5) {
                 label = "10"
             }
-            Post_CDEVS/Channel (post_mdt_1, post_mdt_3) {
+            Post_DEVS/Channel (post_mdt_1, post_mdt_3) {
                 label = "11"
             }
         }
@@ -731,31 +731,31 @@ Composite schedule {
 
     {Contains} ForAll map_control_decision_false {
         LHS {
-            Pre_CDEVS/DEVSInstance pre_mdf_0 {
+            Pre_DEVS/DEVSInstance pre_mdf_0 {
                 label = "0"
             }
-            Pre_CDEVS/Port pre_mdf_1 {
+            Pre_DEVS/Port pre_mdf_1 {
                 label = "1"
                 constraint_name = $
                     Boolean function constraint(model : Element, name : String):
                         return (cast_string(read_attribute(model, name, "type")) == "control_out2")!
                     $
             }
-            Pre_CDEVS/DEVSInstanceToPort (pre_mdf_0, pre_mdf_1) {
+            Pre_DEVS/DEVSInstanceToPort (pre_mdf_0, pre_mdf_1) {
                 label = "2"
             }
 
-            Pre_CDEVS/DEVSInstance pre_mdf_2 {
+            Pre_DEVS/DEVSInstance pre_mdf_2 {
                 label = "3"
             }
-            Pre_CDEVS/Port pre_mdf_3 {
+            Pre_DEVS/Port pre_mdf_3 {
                 label = "4"
                 constraint_name = $
                     Boolean function constraint(model : Element, name : String):
                         return (cast_string(read_attribute(model, name, "type")) == "control_in")!
                     $
             }
-            Pre_CDEVS/DEVSInstanceToPort (pre_mdf_2, pre_mdf_3) {
+            Pre_DEVS/DEVSInstanceToPort (pre_mdf_2, pre_mdf_3) {
                 label = "5"
             }
             Pre_PM/ProcessNode pre_mdf_4 {
@@ -776,23 +776,23 @@ Composite schedule {
         }
     
         RHS {
-            Post_CDEVS/DEVSInstance post_mdf_0 {
+            Post_DEVS/DEVSInstance post_mdf_0 {
                 label = "0"
             }
-            Post_CDEVS/Port post_mdf_1 {
+            Post_DEVS/Port post_mdf_1 {
                 label = "1"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_mdf_0, post_mdf_1) {
+            Post_DEVS/DEVSInstanceToPort (post_mdf_0, post_mdf_1) {
                 label = "2"
             }
 
-            Post_CDEVS/DEVSInstance post_mdf_2 {
+            Post_DEVS/DEVSInstance post_mdf_2 {
                 label = "3"
             }
-            Post_CDEVS/Port post_mdf_3 {
+            Post_DEVS/Port post_mdf_3 {
                 label = "4"
             }
-            Post_CDEVS/DEVSInstanceToPort (post_mdf_2, post_mdf_3) {
+            Post_DEVS/DEVSInstanceToPort (post_mdf_2, post_mdf_3) {
                 label = "5"
             }
 
@@ -811,7 +811,7 @@ Composite schedule {
             Post_PM/DecisionFalse (post_mdf_4, post_mdf_5) {
                 label = "10"
             }
-            Post_CDEVS/Channel (post_mdf_1, post_mdf_3) {
+            Post_DEVS/Channel (post_mdf_1, post_mdf_3) {
                 label = "11"
             }
         }

+ 7 - 7
models/WSC/pm_PM_to_DEVS.mvc

@@ -26,12 +26,12 @@ Data pm_model {
 
 Data cdevs_model {
     name = ""
-    type = "formalisms/DEVS/CDEVS_MM"
+    type = "formalisms/DEVS/DEVS_MM"
 }
 
 Data adevs_model {
-    name = "ADEVS library"
-    type = "formalisms/DEVS/ADEVS_MM"
+    name = "DEVS library"
+    type = "formalisms/DEVS/DEVS_MM"
 }
 
 Data devs_model {
@@ -48,17 +48,17 @@ Consumes (translate, pm_model) {
     name = "PM"
 }
 Produces (translate, cdevs_model) {
-    name = "CDEVS"
+    name = "DEVS"
 }
 
 Consumes (merge, adevs_model) {
-    name = "ADEVS"
+    name = "model1"
 }
 Consumes (merge, cdevs_model) {
-    name = "CDEVS"
+    name = "model2"
 }
 Produces (merge, devs_model) {
-    name = "DEVS"
+    name = "result"
 }
 
 Consumes (simulate, devs_model) {

+ 6 - 8
models/pm_translate.py

@@ -6,25 +6,23 @@ from modelverse import *
 init()
 login("admin", "admin")
 
-model_add("formalisms/DEVS/CDEVS_MM", "formalisms/SimpleClassDiagrams", open("models/WSC/CDEVS.mvc", 'r').read())
-model_add("formalisms/DEVS/ADEVS_MM", "formalisms/SimpleClassDiagrams", open("models/WSC/ADEVS.mvc", 'r').read())
 model_add("formalisms/DEVS/DEVS_MM", "formalisms/SimpleClassDiagrams", open("models/WSC/DEVS.mvc", 'r').read())
 model_add("formalisms/Metrics/Metrics_MM", "formalisms/SimpleClassDiagrams", open("models/WSC/metrics.mvc", 'r').read())
 model_add("formalisms/PM/PM_Extended_MM", "formalisms/SimpleClassDiagrams", open("models/WSC/pm.mvc", 'r').read())
 
 model_add("models/PM/to_DEVS", "formalisms/ProcessModel", open("models/WSC/pm_PM_to_DEVS.mvc").read())
 
-model_add("models/DEVS/PM_library", "formalisms/DEVS/ADEVS_MM", open("models/WSC/pm_library.mvc", 'r').read())
+model_add("models/DEVS/PM_library", "formalisms/DEVS/DEVS_MM", open("models/WSC/pm_library.mvc", 'r').read())
 model_add("models/PM/example_PM", "formalisms/PM/PM_Extended_MM", open("models/WSC/pm_example.mvc", 'r').read())
 
 def traceability_pm_devs(model):
-    instantiate(model, "Association", ("PM/ProcessNode", "CDEVS/DEVSInstance"), ID="Trace")
+    instantiate(model, "Association", ("PM/ProcessNode", "DEVS/DEVSInstance"), ID="Trace")
     
-transformation_add_MT({"PM": "formalisms/PM/PM_Extended_MM"}, {"CDEVS": "formalisms/DEVS/CDEVS_MM"}, "formalisms/PM/to_DEVS", open("models/WSC/PM_to_DEVS.mvc", 'r').read(), traceability_pm_devs)
+transformation_add_MT({"PM": "formalisms/PM/PM_Extended_MM"}, {"DEVS": "formalisms/DEVS/DEVS_MM"}, "formalisms/PM/to_DEVS", open("models/WSC/PM_to_DEVS.mvc", 'r').read(), traceability_pm_devs)
 
+transformation_add_AL({"model1": "formalisms/DEVS/DEVS_MM", "model2": "formalisms/DEVS/DEVS_MM"}, {"result": "formalisms/DEVS/DEVS_MM"}, "formalisms/DEVS/merge", open("models/WSC/DEVS_merge.alc", 'r').read())
 """
-transformation_add_AL("formalisms/DEVS/merge", {"ADEVS": "formalisms/DEVS/ADEVS_MM", "CDEVS": "formalisms/DEVS/CDEVS_MM"}, {"DEVS": "formalisms/DEVS/DEVS_MM"}, open("models/WSC/DEVS_merge.alc", 'r').read())
-transformation_add_AL("formalisms/DEVS/simulate", {"DEVS": "formalisms/DEVS/DEVS_MM"}, {"metrics": "formalisms/Metrics/Metrics_MM"}, open("models/WSC/DEVS_simulate.alc", 'r').read())
+transformation_add_AL({"DEVS": "formalisms/DEVS/DEVS_MM"}, {"metrics": "formalisms/Metrics/Metrics_MM"}, "formalisms/DEVS/simulate", open("models/WSC/DEVS_simulate.alc", 'r').read())
 
-pm_execute("models/PM/to_DEVS", {"PM": "models/PM/example_PM", "ADEVS library": "models/DEVS/PM_library", "Graph": "models/Graph/graph"}, {})
+pm_execute("models/PM/to_DEVS", {"PM": "models/PM/example_PM", "DEVS library": "models/DEVS/PM_library", "Graph": "models/Graph/graph"}, {})
 """

+ 0 - 1
wrappers/classes/modelverse.xml

@@ -16,7 +16,6 @@
     <method name="dict_to_list">
         <parameter name="d"/>
         <body>
-            print("Making list out of " + str(d))
             l = []
             for k, v in d.items():
                 l.append(k)

+ 1 - 2
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
-Date:   Tue May 15 08:40:42 2018
+Date:   Tue May 15 09:18:35 2018
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server
@@ -67,7 +67,6 @@ class Modelverse(RuntimeClassBase):
     
     # user defined method
     def dict_to_list(self, d):
-        print("Making list out of " + str(d))
         l = []
         for k, v in d.items():
             l.append(k)