Example #1
0
#     present = queue.pop(0)
#     if present.lst not in dict: # this should be optimised with dictionary and need to store parents id in a list (because we can have more than one parent)
#         dict.append(present.lst)
#     # never going to change or touch present.
#     for i in range(m):
#         if transitionlst[i].can_fire(present):
#             tmptoken = Tokenslist(present.lst)
#             transitionlst[i].fire(tmptoken)
#             queue.append(tmptoken)
# print(dict)

p1 = Place("P1", 1)
t1 = Transition("T1")
a1 = Arc("A1")
a1.initialize(p1, t1, "input")
t1.add_arc(a1)
p2 = Place("P2", 0)
p3 = Place("P3", 0)
p4 = Place("P4", 0)
p5 = Place("P5", 0)
p6 = Place("P6", 0)
p7 = Place("P7", 0)
p8 = Place("P8", 0)
t2 = Transition("T2")
t3 = Transition("T3")
t4 = Transition("T4")
t5 = Transition("T5")
a2 = Arc("A2")
a2.initialize(t1, p2, "output")
t1.add_arc(a2)
a3 = Arc("A3")