|
@@ -34,40 +34,40 @@ login("admin", "admin")
|
|
|
# Add the metamodels for PetriNet and ReachabilityGraph
|
|
|
print("Add metamodels")
|
|
|
try:
|
|
|
- model_add("PetriNet", "SimpleClassDiagrams", open("models/petrinets.mvc").read())
|
|
|
+ model_add("formalisms/PetriNet", "formalisms/SimpleClassDiagrams", open("models/petrinets.mvc").read())
|
|
|
except ModelExists:
|
|
|
pass
|
|
|
|
|
|
try:
|
|
|
- model_add("ReachabilityGraph", "SimpleClassDiagrams", open("models/reachability_graph.mvc").read())
|
|
|
+ model_add("formalisms/ReachabilityGraph", "formalisms/SimpleClassDiagrams", open("models/reachability_graph.mvc").read())
|
|
|
except ModelExists:
|
|
|
pass
|
|
|
|
|
|
print("Add model")
|
|
|
try:
|
|
|
- model_add("my_pn", "PetriNet", open("models/my_pn.mvc").read())
|
|
|
+ model_add("models/my_pn", "formalisms/PetriNet", open("models/my_pn.mvc").read())
|
|
|
except ModelExists:
|
|
|
pass
|
|
|
|
|
|
# Add the action language code to transform between them
|
|
|
print("Add AL model")
|
|
|
try:
|
|
|
- transformation_add_AL({"PetriNet": "PetriNet"}, {"ReachabilityGraph": "ReachabilityGraph"}, "analyseReachability", open("models/reachability.alc", "r").read())
|
|
|
+ transformation_add_AL({"PetriNet": "formalisms/PetriNet"}, {"ReachabilityGraph": "formalisms/ReachabilityGraph"}, "models/analyseReachability", open("models/reachability.alc", "r").read())
|
|
|
except ModelExists:
|
|
|
pass
|
|
|
|
|
|
# Add an example model transformation to print the reachability graph
|
|
|
print("Add MT model")
|
|
|
try:
|
|
|
- transformation_add_MT({"ReachabilityGraph": "ReachabilityGraph"}, {}, "printReachability", open("models/reachabilitygraph_print.mvc").read())
|
|
|
+ transformation_add_MT({"ReachabilityGraph": "formalisms/ReachabilityGraph"}, {}, "models/printReachability", open("models/reachabilitygraph_print.mvc").read())
|
|
|
except ModelExists:
|
|
|
pass
|
|
|
|
|
|
# Do the reachability graph generation
|
|
|
print("Execute AL")
|
|
|
-status = transformation_execute_AL("analyseReachability", {"PetriNet": "my_pn"}, {"ReachabilityGraph": "my_reachability"}, callback=print_mv)
|
|
|
+status = transformation_execute_AL("models/analyseReachability", {"PetriNet": "models/my_pn"}, {"ReachabilityGraph": "models/my_reachability"}, callback=print_mv)
|
|
|
print("Reachability generation success: " + str(status))
|
|
|
|
|
|
print("Execute MT")
|
|
|
-status = transformation_execute_MT("printReachability", {"ReachabilityGraph": "my_reachability"}, {}, callback=print_mv)
|
|
|
+status = transformation_execute_MT("models/printReachability", {"ReachabilityGraph": "models/my_reachability"}, {}, callback=print_mv)
|
|
|
print("Reachability printing success: " + str(status))
|