Simple JVM implementation of the Petri Net Markup Language (PNML), limited to Place-Transition-(PT)-Nets
Check out SimplePNML for .NET to handle PNML files from .NET languages like C# and VB.NET!
The Petri Net Markup Language (PNML) was developed as an interchange format for petri nets. It can describe logical relations between petri net elements as well as visualization information. Its high expandability and conceptual support for a variety of different petri net types comes with the price of high complexity. Since most use cases and applications are focused on Place-Transition-(PT)-Nets, this library provides a simple way to access and modify this kind of petri nets programmatically.
// Create a place, a transition and an arcPlaceplace = Place.builder()
.id("my-place")
.initialMarking(newLabel("1"))
.build();
Transitiontransition = Transition.builder()
.id("my-transition")
.build();
Arcarc = Arc.builder()
// no explicit identifier
.inscription(newLabel("1"))
.build();
// Let the arc connect the place and the transitionarc.connect(place, transition);
// Add all the elements to a new pagePagepage = newPage();
page.getPlaces().add(page);
page.getTransitions().add(transition);
page.getArcs().add(arc);- The element relations can be accessed via getters and setters.
- Naming conventions from the Java world are applied. This includes:
- Methods are named using
camelCase. - Enum members are named using
UPPER_CASE.
- Methods are named using
- The
Builderpattern can be used to construct objects.
The software is licensed under the MIT license.