Add petrinet language
This commit is contained in:
parent
dd7a0536c9
commit
5240c7e21a
12 changed files with 137 additions and 7 deletions
16
examples/petrinet/metamodels/mm_runtime.od
Normal file
16
examples/petrinet/metamodels/mm_runtime.od
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# A place has a number of tokens, and that's it.
|
||||
|
||||
PlaceState:Class
|
||||
PlaceState_numTokens:AttributeLink (PlaceState -> Integer) {
|
||||
name = "numTokens";
|
||||
optional = False;
|
||||
constraint = `"numTokens cannot be negative" if get_value(get_target(this)) < 0 else None`;
|
||||
}
|
||||
|
||||
of:Association (PlaceState -> Place) {
|
||||
# one-to-one
|
||||
source_lower_cardinality = 1;
|
||||
source_upper_cardinality = 1;
|
||||
target_lower_cardinality = 1;
|
||||
target_upper_cardinality = 1;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue