Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

write_pnml

Write Petri net as PNML


Description

Write Petri net as PNML

Usage

write_pnml(petrinet, file, initial_marking = NULL, final_marking = NULL)

Arguments

petrinet

A bupaR or PM4PY Petri net.

file

File name of the PNML file

initial_marking

A R vector with the place identifiers of the initial marking or a PM4PY marking. By default the initial marking of the bupaR Petri net will be used if available.

final_marking

A R vector with the place identifiers of the final marking or a PM4PY marking.

Examples

# don't test automatically since this writes a file

if (pm4py_available()) {
  library(eventdataR)
  data(patients)

  # As Inductive Miner of PM4PY is not life-cycle aware, keep only `complete` events:
  patients_completes <- patients[patients$registration_type == "complete", ]

  net <- discovery_inductive(patients_completes)
  write_pnml(net$petrinet,
             "test.pnml",
             net$initial_marking,
             net$final_marking)
}

pm4py

Interface to the 'PM4py' Process Mining Library

v1.2.7
GPL-3
Authors
Felix Mannhardt [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.