ソースを参照

Cleanup of problems

Yentl Van Tendeloo 8 年 前
コミット
1a0e47637a

+ 0 - 6
core/core_algorithm.alc

@@ -1342,7 +1342,6 @@ Void function user_function_skip_init(user_id : String):
 								old_type_id = type_id
 								set_add(source, model_id)
 								set_add(all_formalisms, create_tuple(name, get_full_model(model_id)))
-								output("Model added as source")
 							elif (old_type_id != type_id):
 								// Already have a previous type_id and now another: CLASH
 								output("Cannot add model as types not compatible with previous models; try again")
@@ -1367,7 +1366,6 @@ Void function user_function_skip_init(user_id : String):
 								old_type_id = type_id
 								set_add(target, model_id)
 								set_add(all_formalisms, create_tuple(name, get_full_model(model_id)))
-								output("Model added as target")
 							elif (old_type_id != type_id):
 								// Already have a previous type_id and now another: CLASH
 								output("Cannot add model as types not compatible with previous models; try again")
@@ -1437,7 +1435,6 @@ Void function user_function_skip_init(user_id : String):
 				if (model_id != ""):
 					if (bool_not(set_in(source, model_id))):
 						set_add(source, model_id)
-						output("Model added as source")
 					else:
 						output("Model already selected as source")
 				else:
@@ -1452,7 +1449,6 @@ Void function user_function_skip_init(user_id : String):
 				if (model_id != ""):
 					if (bool_not(set_in(target, model_id))):
 						set_add(target, model_id)
-						output("Model added as target")
 					else:
 						output("Model already selected as target")
 				else:
@@ -1532,7 +1528,6 @@ Void function user_function_skip_init(user_id : String):
 							if (set_in(supported, model_id)):
 								if (bool_not(set_in(source, model_id))):
 									set_add(source, model_id)
-									output("Model added as source")
 								else:
 									output("Model already selected as source")
 							else:
@@ -1550,7 +1545,6 @@ Void function user_function_skip_init(user_id : String):
 							if (set_in(supported, model_id)):
 								if (bool_not(set_in(target, model_id))):
 									set_add(target, model_id)
-									output("Model added as target")
 								else:
 									output("Model already selected as target")
 							else:

ファイルの差分が大きいため隠しています
+ 78 - 1273
integration/test_powerwindow.py


+ 3 - 0
integration/utils.py

@@ -161,6 +161,9 @@ def run_file(files, parameters, expected, wait=False):
                 print(val)
         for e in expected:
             c = len(e) if isinstance(e, set) else 1
+            if isinstance(e, set):
+                # Copy set before we start popping from it, as it might be reused elsewhere
+                e = set(e)
             for _ in range(c):
                 val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "taskname": taskname})), timeout=TIMEOUT).read()
                 val = json.loads(val)

+ 2 - 1
models/bfs.alc

@@ -7,6 +7,7 @@ Element function bfs(params : Element, output_mms : Element):
 	String initial
 	Element options
 	Element worklist
+	Element work_unit
 	String state
 	Element path
 	Element path_copy
@@ -36,7 +37,7 @@ Element function bfs(params : Element, output_mms : Element):
 
 		while (read_nr_out(options) > 0):
 			option = set_pop(options)
-			path_copy = list_copy(path)
+			path_copy = dict_copy(path)
 			list_append(path_copy, read_attribute(model, option, "name"))
 			list_append(worklist, create_tuple(readAssociationDestination(model, option), path_copy))
 

+ 3 - 3
models/combine_EPN.mvc

@@ -33,12 +33,12 @@ A B {
                 Pre_Encapsulated_PetriNet/Port pre_5{
                     label = "5"
                 }
-                Pre_Encapsulated_PetriNet/Connects (pre_1, pre_4){
+                Pre_Architecture/Connects (pre_1, pre_4){
                     label = "6"
                 }
 
                 constraint = $
-                    Boolean constraint(model : Element, mapping : Element):
+                    Boolean function constraint(model : Element, mapping : Element):
                         if bool_not(value_eq(read_attribute(model, mapping["2"], "name"), string_join(string_join(read_attribute(model, mapping["0"], "name"), "/"), read_attribute(model, mapping["1"], "name")))):
                             return False!
                         if bool_not(value_eq(read_attribute(model, mapping["5"], "name"), string_join(string_join(read_attribute(model, mapping["3"], "name"), "/"), read_attribute(model, mapping["4"], "name")))):
@@ -71,7 +71,7 @@ A B {
                 Post_Encapsulated_PetriNet/Port post_5{
                     label = "5"
                 }
-                Post_Encapsulated_PetriNet/Connects (post_1, post_4){
+                Post_Architecture/Connects (post_1, post_4){
                     label = "6"
                 }
                 Post_Encapsulated_PetriNet/Related (post_2, post_5){

+ 80 - 42
models/pm_req_analyse.mvc

@@ -2,8 +2,8 @@ ProcessModel analyse_requirements {
     Start start {}
     Finish finish {}
 
-    Exec define_req {
-        name = "define_req"
+    Exec revise_req {
+        name = "revise_req"
     }
     Exec make_initial_models {
         name = "make_initial_models"
@@ -11,17 +11,20 @@ ProcessModel analyse_requirements {
 
     ForkJoin forkjoin1 {}
 
-    Exec refine_plant {
-        name = "refine_plant"
+    Exec revise_plant {
+        name = "revise_plant"
     }
-    Exec refine_environment {
-        name = "refine_environment"
+    Exec revise_environment {
+        name = "revise_environment"
     }
-    Exec refine_control {
-        name = "refine_control"
+    Exec revise_control {
+        name = "revise_control"
     }
-    Exec refine_query {
-        name = "refine_query"
+    Exec revise_query {
+        name = "revise_query"
+    }
+    Exec revise_architecture {
+        name = "revise_architecture"
     }
 
     Exec plant_to_EPN {
@@ -50,8 +53,12 @@ ProcessModel analyse_requirements {
 
     ForkJoin forkjoin3 {}
 
-    Exec matches {
-        name = "matches"
+    Exec match {
+        name = "match"
+    }
+
+    Exec bfs {
+        name = "bfs"
     }
 
     Decision found {}
@@ -100,30 +107,40 @@ ProcessModel analyse_requirements {
         name = "query"
         type = "Query"
     }
-
-    Next (start, define_req) {}
-    Next (define_req, make_initial_models) {}
-    Next (make_initial_models, forkjoin1) {}
-    Next (forkjoin1, refine_plant) {}
-    Next (forkjoin1, refine_environment) {}
-    Next (forkjoin1, refine_control) {}
-    Next (forkjoin1, refine_query) {}
-    Next (refine_plant, plant_to_EPN) {}
-    Next (refine_environment, environment_to_EPN) {}
-    Next (refine_control, control_to_EPN) {}
+    Data architecture {
+        name = "architecture"
+        type = "Architecture"
+    }
+
+    Next (start, make_initial_models) {}
+    Next (make_initial_models, revise_req) {}
+    Next (revise_req, forkjoin1) {}
+    Next (forkjoin1, revise_plant) {}
+    Next (forkjoin1, revise_environment) {}
+    Next (forkjoin1, revise_control) {}
+    Next (forkjoin1, revise_query) {}
+    Next (forkjoin1, revise_architecture) {}
+    Next (revise_plant, plant_to_EPN) {}
+    Next (revise_environment, environment_to_EPN) {}
+    Next (revise_control, control_to_EPN) {}
     Next (plant_to_EPN, forkjoin2) {}
     Next (environment_to_EPN, forkjoin2) {}
     Next (control_to_EPN, forkjoin2) {}
+    Next (revise_architecture, forkjoin2) {}
     Next (forkjoin2, combine_EPN) {}
     Next (combine_EPN, analyse) {}
     Next (analyse, forkjoin3) {}
-    Next (refine_query, forkjoin3) {}
-    Next (forkjoin3, matches) {}
-    Next (matches, found) {}
-    Then (found, forkjoin1) {}
+    Next (revise_query, forkjoin3) {}
+    Next (forkjoin3, match) {}
+    Next (match, found) {}
+    Then (found, bfs) {}
+    Next (bfs, revise_req) {}
     Else (found, finish) {}
 
-    Produces (define_req, req) {
+    Consumes (revise_req, req) {
+        name = "requirements"
+    }
+    Produces (revise_req, req) {
     }
 
     Produces (make_initial_models, plant_model) {
@@ -134,39 +151,51 @@ ProcessModel analyse_requirements {
     }
     Produces (make_initial_models, query) {
     }
+    Produces (make_initial_models, architecture) {
+    }
+    Produces (make_initial_models, req) {
+    }
 
-    Consumes (refine_plant, req) {
+    Consumes (revise_plant, req) {
         name = "requirements"
     }
-    Consumes (refine_environment, req) {
+    Consumes (revise_environment, req) {
         name = "requirements"
     }
-    Consumes (refine_control, req) {
+    Consumes (revise_control, req) {
         name = "requirements"
     }
-    Consumes (refine_query, req) {
+    Consumes (revise_query, req) {
+        name = "requirements"
+    }
+    Consumes (revise_architecture, req) {
         name = "requirements"
     }
 
-    Consumes (refine_plant, plant_model) {
+    Consumes (revise_plant, plant_model) {
         name = "plant"
     }
-    Consumes (refine_environment, environment_model) {
+    Consumes (revise_environment, environment_model) {
         name = "environment"
     }
-    Consumes (refine_control, control_model) {
+    Consumes (revise_control, control_model) {
         name = "control"
     }
-    Consumes (refine_query, query) {
+    Consumes (revise_query, query) {
         name = "query"
     }
-    Produces (refine_plant, plant_model) {
+    Consumes (revise_architecture, architecture) {
+        name = "architecture"
+    }
+    Produces (revise_plant, plant_model) {
     }
-    Produces (refine_control, control_model) {
+    Produces (revise_control, control_model) {
     }
-    Produces (refine_environment, environment_model) {
+    Produces (revise_environment, environment_model) {
     }
-    Produces (refine_query, query) {
+    Produces (revise_query, query) {
+    }
+    Produces (revise_architecture, architecture) {
     }
 
     Consumes (plant_to_EPN, plant_model) {
@@ -194,6 +223,9 @@ ProcessModel analyse_requirements {
     Consumes (combine_EPN, control_EPN) {
         name = "epn_3"
     }
+    Consumes (combine_EPN, architecture) {
+        name = "architecture"
+    }
     Produces (combine_EPN, pn) {
     }
 
@@ -203,10 +235,16 @@ ProcessModel analyse_requirements {
     Produces (analyse, reachability_graph) {
     }
 
-    Consumes (matches, reachability_graph) {
+    Consumes (match, reachability_graph) {
         name = "reachability_graph"
     }
-    Consumes (matches, query) {
+    Consumes (match, query) {
         name = "query"
     }
+    Produces (match, reachability_graph) {
+    }
+
+    Consumes (bfs, reachability_graph) {
+        name = "reachability_graph"
+    }
 }