xMOF Case Study: Petri Net 2


A Petri Net consists of places and transitions whereat transitions reference their input and output places. During runtime tokens can be held by places and a transition can fire if all input places hold at least one token. If a transition fires one token of each input place of the transition is removed and one token is added to each output place of the transition.

In this variant of the Petri Net DSML the initial token distribution is not incorporated in the abstract syntax of the language but considered as a runtime concept only. Thus, the semantics specification defines the need for an initial token distribution as input to the execution of a Petri Net.

Petri Net DSML Variant 1


This exemplary model of the Petri Net 2 DSML (depicted in graphical concrete syntax) consists of a Net containing one Transition t and two Places p1 and p2, whereat p1 serves as input and p2 as output of t.
To define the initial token distribution for executing this Petri Net model, we have to instantiate the initialization class called Initialization and add the Tokens contained in the initial token distribution accordingly (referencing the Place they reside in). In the depicted example we defined that one Token resides in the Place p1. Because this information is not part of the Petri Net model itself, the Token is depicted in gray color.
According to the specified behavioral semantics of the DSML when executing this model, the Transition t will consume the Token held by the input Place p1 and put one token to the output Place p2.

Petri Net 2 DSML Example

Language Specification



Ecore-based Metamodel: petrinet2.ecore (MetaModelbrowser: petrinet2.ecore)
xMOF-based Configuration: petrinet2.xmof

© 2018 moliz - modelexecution.org Suffusion theme by Sayontan Sinha