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.


Example

This exemplary model of the Petri Net 2 DSML (depicted in graphical concrete syntax) consists of a Net containing one Transition t and two Placesp1 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 and xMOF-based configuration of Petri Net 2 DSML

Operation Specifications


Resources