Skip to content

Repository files navigation

SimplePNML for JVM

LicenseBuildCoverage

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!

Motivation

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.

Installation

Usage

// 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);

Differences to .NET version

  • 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.
  • The Builder pattern can be used to construct objects.

License

The software is licensed under the MIT license.

About

Simple Java implementation of the Petri Net Markup Language (PNML), limited to Place-Transition-(PT)-Nets

Topics

Resources

Contributing

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages