-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpetrinets.m2
25 lines (21 loc) · 1.1 KB
/
petrinets.m2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
root=MetaModel()
net=Element(of=root, name="Petrinet")
place=Element(of=root, name="Place")
transition=Element(of=root, name="Transition")
iplace=Element(of=root, name="InterfacePlace", extends=place)
itransition=Element(of=root, name="InterfaceTransition", extends=transition)
inedge=Element(of=root, name="InputArc")
outedge=Element(of=root, name="OutputArc")
Attribute(of=net, name="name")
Attribute(of=place, name="name")
Attribute(of=transition, name="name")
Attribute(of=place, name="capacity")
Attribute(of=place, name="tokens")
Attribute(of=inedge, name="weight")
Attribute(of=outedge, name="weight")
Association(parent=net, child=place, parentname="of", childname="places")
Association(parent=net, child=transition, parentname="of", childname="transitions")
Association(parent=place, child=inedge, parentname="source", childname="totransitions")
Association(parent=transition, child=inedge, parentname="dest", childname="fromplaces")
Association(parent=transition, child=outedge, parentname="source", childname="toplaces")
Association(parent=place, child=outedge, parentname="dest", childname="fromtransitions")