simple-pnml is a library to describe Petri nets and [de]serialize them as PNML XML files.
Attention: this library is actually the porting of the ProM PetriNets package, which has been isolated out of the ProM environment and has been made available as Maven dependency. Therefore, the authors of this simple-pnml library are the authors of the ProM version of the PetriNets package (module some changes made by Andrea Burattin for isolating the library from ProM and making it self-contained). The ProM package PetriNets is licensed as L-GPL so this distribution is as well. The original source code of the ProM PetriNets package is located at https://svn.win.tue.nl/repos/prom/Packages/PetriNets/. The ProM packages licenses are discussed in http://www.promtools.org/doku.php?id=packlicense and for general information on ProM you can visit http://www.promtools.org/.
Installing the library
To use the library in your Maven project it is necessary to include, in the
pom.xml file, the package repository:
Importing a Petri net from a PNML file
To import a Petri net from a PNML file you can use the following code:
Importing a Petri net from a TPN file
To import a Petri net from a TPN file you can use the following code:
Exporting a Petri net into a PNML file
To export a Petri net into a PNML file you can use the following code: