from modelverse import *
import random

init()
login("admin", "admin")
model_add("formalisms/PetriNet", "formalisms/SimpleClassDiagrams", open("models/petrinets.mvc").read())
model_add("formalisms/ReachabilityGraph", "formalisms/SimpleClassDiagrams", open("models/reachability_graph.mvc").read())
model_add("models/my_pn", "formalisms/PetriNet", open("models/my_pn.mvc").read())
transformation_add_AL({"PetriNet": "formalisms/PetriNet"}, {"ReachabilityGraph": "formalisms/ReachabilityGraph"}, "models/analyseReachability", open("models/reachability.alc", "r").read())
transformation_add_MT({"ReachabilityGraph": "formalisms/ReachabilityGraph"}, {}, "models/printReachability", open("models/reachabilitygraph_print.mvc").read())
transformation_execute_AL("models/analyseReachability", {"PetriNet": "models/my_pn"}, {"ReachabilityGraph": "models/my_reachability"}, tracability_model="trac")
transformation_execute_MT("models/printReachability", {"ReachabilityGraph": "models/my_reachability"}, {})

time.sleep(5)
print(model_list(""))
