Class PnmlIO
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
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 classfilename- output path- Throws:
IOException- if the file cannot be written
-
load
Read the first net of a PNML place/transition document.- Parameters:
filename- input path- Returns:
- the equivalent LINE network
-
load
Read one net of a PNML place/transition document.- Parameters:
filename- input pathnetId- id of the net to read, or null for the first- Returns:
- the equivalent LINE network
-