xMOF Case Study: Petri Net 1

 

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 part of the abstract syntax of the language and thus introduced in its metamodel (Integer attribute initialToken of the metaclass Place). Additionally the tokens held by a place at runtime are represented by the Integer attribute tokens of the configuration class PlaceConfiguration.

Petri Net DSML Variant 2

Example

This exemplary model of the Petri Net 1 DSML (depicted in graphical concrete syntax) consists of a Net containing one Transition and two Places, whereat one Place serves as input and one Place as output of the Transition. The Place serving as input holds one initial token. According to the specified behavioral semantics of the DSML when executing this model, the Transition will consume the token held by the input Place of the Transition and put one token to the output Place.
Petri Net 1 DSML Example

Language Specification

 

Resources

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

© 2012 moliz by Vienna University of Technology Suffusion theme by Sayontan Sinha