pm4py / pm4py-core

Public repository for the PM4Py (Process Mining for Python) project.
https://pm4py.fit.fraunhofer.de
GNU General Public License v3.0
722 stars 286 forks source link

Token-Based Replay enhancement with case count #363

Closed Widderiru closed 1 year ago

Widderiru commented 1 year ago

In the visualization of Petri nets after token-based replay the tokens are put but then it is unclear how many cases have been involved in this token count. Therefore, it would be good to have both next to each other so that we know 1. how often the activity happened 2. how many cases created this count. Maybe also the max count per case (and mean and min) would be interesting.

fit-alessandro-berti commented 1 year ago

Dear @Widderiru

Thanks for signaling. Actually you helped us identify a bug in the existing decorations so very thanks.

We'll add this possibility as parameter in the next release

Have a nice day :)

fit-alessandro-berti commented 1 year ago

Dear @Widderiru

We released the fix, and the possibility to decorate the arcs of the Petri net with the cases count.

Example:

import pm4py from pm4py.visualization.petri_net import visualizer as pn_visualizer

log = pm4py.read_xes("C:/running-example.xes")

net, im, fm = pm4py.discover_petri_net_inductive(log)

gviz1 = pn_visualizer.apply(net, im, fm, log=log, variant=pn_visualizer.Variants.FREQUENCY, parameters={"count_once_per_trace": False, "format": "png"}) pn_visualizer.view(gviz1)

gviz2 = pn_visualizer.apply(net, im, fm, log=log, variant=pn_visualizer.Variants.FREQUENCY, parameters={"count_once_per_trace": True}) pn_visualizer.view(gviz2)