Package jline.io

Class PnmlIO

java.lang.Object
jline.io.PnmlIO

public class PnmlIO extends Object
PNML (ISO/IEC 15909-2) place/transition nets, read and written.

Java twin of matlab/src/io/pnml_save.m and pnml_load.m. The grammar written is http://www.pnml.org/version-2009/grammar/ptnet, so that a LINE net can be read by the tools built around that corpus (GreatSPN, TINA, the Model Checking Contest harnesses) and a net from that corpus can be analysed here.

THE P/T GRAMMAR IS UNCOLOURED, so what it can carry is narrower than what LINE can express, and the difference is REFUSED rather than approximated: more than one job class, an open class or a Source/Sink, a queueing place, a firing-rate dependence, and any distribution outside the scalar-parameter families listed in distToXml(jline.lang.processes.Distribution, java.lang.String, int).

TIMING RIDES IN A TOOLSPECIFIC BLOCK, which is where the grammar puts what it does not define. Each LINE MODE becomes one PNML transition, so that the arcs of a mode are the arcs of a transition as the grammar requires; the block records which LINE transition and mode the PNML transition came from, so the reader regroups the modes the writer split. A reader that ignores the block still sees a correct untimed P/T net, and a P/T net with no such block is read with every transition TIMED and EXPONENTIAL AT RATE 1, the convention of the stochastic Petri net literature.

Since:
LINE 3.0
  • Method Details

    • save

      public static void save(Network model, String filename) throws IOException
      Write the Petri net held by a Network to a PNML place/transition file.
      Parameters:
      model - network holding only places and transitions, with one closed class
      filename - output path
      Throws:
      IOException - if the file cannot be written
    • load

      public static Network load(String filename)
      Read the first net of a PNML place/transition document.
      Parameters:
      filename - input path
      Returns:
      the equivalent LINE network
    • load

      public static Network load(String filename, String netId)
      Read one net of a PNML place/transition document.
      Parameters:
      filename - input path
      netId - id of the net to read, or null for the first
      Returns:
      the equivalent LINE network