|
@@ -406,7 +406,7 @@ class ModelverseInterface(AtomicDEVS):
|
|
|
if prev_output.startswith("Please edit this model before sending next input: "):
|
|
|
_, model_name = prev_output.split("Please edit this model before sending next input: ", 1)
|
|
|
self.state.do_additional_operations = True
|
|
|
- self.state.send_operations = [[], ["admin"], ["admin"], ["quiet"], ["model_modify", model_name, "formalisms/SimpleClassDiagrams"]] + self.state.additional_operations[0] + [["exit"]]
|
|
|
+ self.state.send_operations = [[], ["admin"], ["admin"], ["quiet"], ["model_modify", model_name, ""]] + self.state.additional_operations[0] + [["exit"]]
|
|
|
self.state.additional_taskname = str(uuid.uuid4())
|
|
|
print("Modifying model " + str(model_name))
|
|
|
print("On taskname " + str(self.state.additional_taskname))
|
|
@@ -416,10 +416,29 @@ class ModelverseInterface(AtomicDEVS):
|
|
|
print("Spawned activity")
|
|
|
_, task_name = prev_output.split("Spawned activity on task: ", 1)
|
|
|
self.state.blocked = True
|
|
|
+ self.state.allow_progress = False
|
|
|
+ self.state.send_operations = [[], []]
|
|
|
+ # We now know that there is something to do on an other task, so we just wait for that event to come in
|
|
|
+ else:
|
|
|
+ print("UNKNOWN: " + str(prev_output))
|
|
|
|
|
|
elif inp[0] != self.taskname:
|
|
|
# Got some output on another task
|
|
|
- if self.state.send_operations == []:
|
|
|
+ if inp[1].startswith("Please edit this model before sending next input: "):
|
|
|
+ _, model_name = inp[1].split("Please edit this model before sending next input: ", 1)
|
|
|
+ self.state.do_additional_operations = True
|
|
|
+ self.state.send_operations = [[], ["admin"], ["admin"], ["quiet"], ["model_modify", model_name, ""]] + self.state.keyed_operations[self.state.op_name] + [["exit"]]
|
|
|
+ self.state.additional_taskname = str(uuid.uuid4())
|
|
|
+ print("Modifying model " + str(model_name))
|
|
|
+ print("On taskname " + str(self.state.additional_taskname))
|
|
|
+ self.state.create_additional_task = True
|
|
|
+ self.state.had_key = inp[0]
|
|
|
+ elif inp[1].startswith("Please perform manual operation "):
|
|
|
+ _, op_name = inp[1].split("Please perform manual operation ", 1)
|
|
|
+ self.state.op_name = op_name[1:-1]
|
|
|
+ elif inp[1].startswith("Success: ready for "):
|
|
|
+ pass
|
|
|
+ elif self.state.send_operations == []:
|
|
|
# At the end of these operations, so finish up!
|
|
|
if self.state.had_key is not None:
|
|
|
self.state.keyed_operations.pop(self.state.had_key)
|
|
@@ -434,15 +453,6 @@ class ModelverseInterface(AtomicDEVS):
|
|
|
self.state.send_operations = None
|
|
|
self.state.operations.pop(0)
|
|
|
print("Clear up to the normal task!")
|
|
|
- elif inp[1].startswith("Please edit this model before sending next input: "):
|
|
|
- _, model_name = inp[1].split("Please edit this model before sending next input: ", 1)
|
|
|
- self.state.do_additional_operations = True
|
|
|
- self.state.send_operations = [[], ["admin"], ["admin"], ["quiet"], ["model_modify", model_name, "formalisms/SimpleClassDiagrams"]] + self.state.keyed_operations[inp[0]] + [["exit"]]
|
|
|
- self.state.additional_taskname = str(uuid.uuid4())
|
|
|
- print("Modifying model " + str(model_name))
|
|
|
- print("On taskname " + str(self.state.additional_taskname))
|
|
|
- self.state.create_additional_task = True
|
|
|
- self.state.had_key = inp[0]
|
|
|
|
|
|
return self.state
|
|
|
|
|
@@ -613,6 +623,7 @@ class System(CoupledDEVS):
|
|
|
taskname = "test_task"
|
|
|
|
|
|
operations = json.loads(open("model/operations", 'r').read())
|
|
|
+operations = json.loads(open("model/operations_simple", 'r').read())
|
|
|
additional_operations = [[], # revise_req
|
|
|
[], # revise_environment
|
|
|
[], # revise_plant
|
|
@@ -624,11 +635,15 @@ additional_operations = [[], # revise_req
|
|
|
[["instantiate_edge", "Association", "CTRL2EPN_link", "PW_Control/State", "Encapsulated_PetriNet/Place"], ["instantiate_edge", "Association", "CTRL2EPN_tlink", "PW_Control/Transition", "Encapsulated_PetriNet/Transition"]], # control_to_EPN
|
|
|
[["instantiate_edge", "Association", "ENV2EPN_link", "PW_Environment/Event", "Encapsulated_PetriNet/Place"]], # environment_to_EPN
|
|
|
[["instantiate_edge", "Association", "EPN2PN_place_link", "Encapsulated_PetriNet/Place", "PetriNet/Place"], ["instantiate_edge", "Association", "EPN2PN_transition_link", "Encapsulated_PetriNet/Transition", "PetriNet/Transition"]], # EPN_to_PN
|
|
|
+ [], # match
|
|
|
[], # reachability
|
|
|
[], # bfs
|
|
|
[], # merge
|
|
|
]
|
|
|
+
|
|
|
+additional_operations = [[]]
|
|
|
keyed_operations = {}
|
|
|
+keyed_operations = {"models/modify_lang": [["instantiate_node", "PN/Class", ""]]}
|
|
|
finish_on = "FINISHED"
|
|
|
|
|
|
args = {
|