discovery: Petri net discovery algorithms

Description Usage Arguments Value Examples

Description

PM4PY discovery algorithms that discover a Petri net and its initial and final marking. Currently the Inductive Miner and the Alpha Miner are implemented.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21

Arguments

eventlog

A bupaR event log or an R data frame.

parameters

A named list of PM4PY parameters (see parameters) as required by the discovery method. By default, if the eventlog is a bupaR event log, the activity_key, timestamp_key, and caseid_key are automatically determined.

variant

The variant of the discovery algorithm to be used. For Inductive Miner currently only variant_inductive_imdfb is supported.

convert

TRUE to automatically convert Python objects to their R equivalent. If you pass FALSE you can do manual conversion using the r-py-conversion function.

Value

A named list with elements petrinet, initial_marking, and final_marking or the original Python object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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)

  # Show details of the obtained bupaR Petri net
  print(net$petrinet)

  # initial marking is a character vector
  print(net$initial_marking)

  # final marking is a character vector
  print(net$final_marking)

  # Petri net can be used with other bupaR functions
  petrinetR::render_PN(net$petrinet)

  # Keep an unconverted PM4PY Petri net for use in other PM4PY functions
  py_net <- discovery_inductive(patients_completes, convert = FALSE)
}

pm4py documentation built on Jan. 8, 2020, 1:08 a.m.