Przeglądaj źródła

Updated PN_print to also print the transitions

Yentl Van Tendeloo 8 lat temu
rodzic
commit
1cc7400847
1 zmienionych plików z 11 dodań i 0 usunięć
  1. 11 0
      models/pn_print.alc

+ 11 - 0
models/pn_print.alc

@@ -10,6 +10,8 @@ Element function pn_print(params : Element, output_mms : Element):
 	String place
 	String name
 	Integer tokens
+	String t
+	Element all_t
 
 	log(set_to_string(dict_keys(model["metamodel"]["model"])))
 
@@ -22,6 +24,15 @@ Element function pn_print(params : Element, output_mms : Element):
 
 		log((("  " + name) + ": ") + cast_v2s(tokens))
 
+		all_t = allIncomingAssociationInstances(model, place, "P2T")
+		while (read_nr_out(all_t) > 0):
+			t = set_pop(all_t)
+			log("    <-- " + cast_v2s(read_attribute(model, readAssociationSource(model, t), "name")))
+		all_t = allOutgoingAssociationInstances(model, place, "T2P")
+		while (read_nr_out(all_t) > 0):
+			t = set_pop(all_t)
+			log("    --> " + cast_v2s(read_attribute(model, readAssociationDestination(model, t), "name")))
+
 	log("Transitions:")
 	all_places = allInstances(model, "Transition")
 	while (read_nr_out(all_places) > 0):