LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
pnml.h File Reference

PNML (ISO/IEC 15909-2) place/transition nets, read and written. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <cstdio>
#include <fstream>
#include <limits>
#include <map>
#include <string>
#include <vector>
#include "line/lang/lang_types.h"
#include "line/lang/qn/network_builder.h"
#include "line/lang/qn/network_struct.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
#include "line/util/xml.h"
Include dependency graph for pnml.h:

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::io

Functions

template<class T>
void line::io::pnml_save (const qn::NetworkStruct< T > &sn, const std::string &path)
 Write the Petri net of a refreshed NetworkStruct to a PNML place/transition file.
template<class T>
qn::Network< T > line::io::pnml_load (const std::string &path, const std::string &net_id=std::string())
 Read one net of a PNML place/transition document into a Network.

Detailed Description

PNML (ISO/IEC 15909-2) place/transition nets, read and written.

Port of matlab/src/io/pnml_save.m and pnml_load.m, jar/src/main/java/jline/io/PnmlIO.java and python/line_solver/io/pnml_io.py. 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 dist_param_names() below.

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 and GreatSPN's own default.

PARAMETER NAMES ARE MATLAB'S, not this port's argument names. Distrib::params is documented to hold the constructor arguments in MATLAB getParam order, so the names below are attached positionally to that order; they are what makes a file written by any of the four codebases readable by the other three.

Definition in file pnml.h.