File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed
Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,34 @@ See https://jitpack.io/#beamline/simple-pnml for further details (e.g., using it
3232### Importing a Petri net from a PNML file
3333
3434To import a Petri net from a PNML file you can use the following code:
35+
3536``` java
3637Object [] i = PnmlImportNet . importFromStream(new FileInputStream (new File (" file.pnml" )));
38+
39+ Petrinet net = (Petrinet ) i[0 ];
40+ Marking marking = (Marking ) i[1 ];
41+ ```
42+
43+ ### Importing a Petri net from a TPN file
44+
45+ To import a Petri net from a TPN file you can use the following code:
46+
47+ ``` java
48+ Object [] i = TpnImport . importFromStream(new FileInputStream (new File (" file.tpn" )));
49+
3750Petrinet net = (Petrinet ) i[0 ];
38- Marking m = (Marking ) i[1 ];
51+ Marking marking = (Marking ) i[1 ];
52+ ```
53+
54+
55+ ### Exporting a Petri net into a PNML file
56+
57+ To export a Petri net into a PNML file you can use the following code:
58+
59+ ``` java
60+ Petrinet net = ... ;
61+ Marking marking = ... ;
62+
63+ PnmlExportNetToPNML . exportPetriNetToPNMLFile(net, marking, new File (" file.pnml" ));
3964```
4065
You can’t perform that action at this time.
0 commit comments