|
@@ -76,7 +76,6 @@ Element function petrinet_fire(model : Element):
|
|
|
new_value = integer_subtraction(readAttribute(model, working_place, "tokens"), readAttribute(model, working_arc, "weight"))
|
|
|
unset_attribute(model, getName(model, working_place), "tokens")
|
|
|
instantiate_attribute(model, getName(model, working_place), "tokens", new_value)
|
|
|
- //setAttribute(model, working_place, "tokens", integer_subtraction(readAttribute(model, working_place, "tokens"), readAttribute(model, working_arc, "weight")))
|
|
|
output(((" " + getName(model, working_place)) + ": ") + cast_i2s(readAttribute(model, working_place, "tokens")))
|
|
|
|
|
|
// Add tokens
|
|
@@ -87,7 +86,6 @@ Element function petrinet_fire(model : Element):
|
|
|
new_value = integer_addition(readAttribute(model, working_place, "tokens"), readAttribute(model, working_arc, "weight"))
|
|
|
unset_attribute(model, getName(model, working_place), "tokens")
|
|
|
instantiate_attribute(model, getName(model, working_place), "tokens", new_value)
|
|
|
- //setAttribute(model, working_place, "tokens", integer_addition(readAttribute(model, working_place, "tokens"), readAttribute(model, working_arc, "weight")))
|
|
|
output(((" " + getName(model, working_place)) + ": ") + cast_i2s(readAttribute(model, working_place, "tokens")))
|
|
|
output("Transition fired!")
|
|
|
else:
|
|
@@ -370,8 +368,7 @@ Element function initial_prompt():
|
|
|
if (dict_in(root, name)):
|
|
|
output("Model exists; aborting")
|
|
|
else:
|
|
|
- //my_model = instantiate_new_model(root[mm_name], create_node())
|
|
|
- //dict_add(root, name, my_model)
|
|
|
+ my_model = instantiate_model(root[mm_name])
|
|
|
petrinet_loaded(my_model)
|
|
|
else:
|
|
|
output("Unknown metamodel; aborting")
|