pm4py.objects.petri_net.utils.performance_map module#

pm4py.objects.petri_net.utils.performance_map.calculate_annotation_for_trace(trace, net, initial_marking, act_trans, activity_key, ht_perf_method='last')[source]#

Calculate annotation for a trace in the variant, in order to retrieve information useful for calculate frequency/performance for all the traces belonging to the variant

Parameters:
  • trace – Trace

  • net – Petri net

  • initial_marking – Initial marking

  • act_trans – Activated transitions during token replay of the given trace

  • activity_key – Attribute that identifies the activity (must be specified if different from concept:name)

  • ht_perf_method – Method to use in order to annotate hidden transitions (performance value could be put on the last possible point (last) or in the first possible point (first)

Returns:

Statistics annotation for the given trace

Return type:

annotation

pm4py.objects.petri_net.utils.performance_map.single_element_statistics(log, net, initial_marking, aligned_traces, variants_idx, activity_key='concept:name', timestamp_key='time:timestamp', ht_perf_method='last', parameters=None)[source]#

Get single Petrinet element statistics

Parameters:
  • log – Log

  • net – Petri net

  • initial_marking – Initial marking

  • aligned_traces – Result of the token-based replay

  • variants_idx – Variants along with indexes of belonging traces

  • activity_key – Activity key (must be specified if different from concept:name)

  • timestamp_key – Timestamp key (must be specified if different from time:timestamp)

  • ht_perf_method – Method to use in order to annotate hidden transitions (performance value could be put on the last possible point (last) or in the first possible point (first)

  • parameters – Possible parameters of the algorithm

Returns:

Petri net element statistics (frequency, unaggregated performance)

Return type:

statistics

pm4py.objects.petri_net.utils.performance_map.find_min_max_trans_frequency(statistics)[source]#

Find minimum and maximum transition frequency

Parameters:

statistics – Element statistics

Returns:

  • min_frequency – Minimum transition frequency (in the replay)

  • max_frequency – Maximum transition frequency (in the replay)

pm4py.objects.petri_net.utils.performance_map.find_min_max_arc_frequency(statistics)[source]#

Find minimum and maximum arc frequency

Parameters:

statistics – Element statistics

Returns:

  • min_frequency – Minimum arc frequency

  • max_frequency – Maximum arc frequency

pm4py.objects.petri_net.utils.performance_map.aggregate_stats(statistics, elem, aggregation_measure)[source]#

Aggregate the statistics

Parameters:
  • statistics – Element statistics

  • elem – Current element

  • aggregation_measure – Aggregation measure (e.g. mean, min) to use

Returns:

Aggregated statistics

Return type:

aggr_stat

pm4py.objects.petri_net.utils.performance_map.find_min_max_arc_performance(statistics, aggregation_measure)[source]#

Find minimum and maximum arc performance

Parameters:
  • statistics – Element statistics

  • aggregation_measure – Aggregation measure (e.g. mean, min) to use

Returns:

  • min_performance – Minimum performance

  • max_performance – Maximum performance

pm4py.objects.petri_net.utils.performance_map.aggregate_statistics(statistics, measure='frequency', aggregation_measure=None)[source]#

Gets aggregated statistics

Parameters:
  • statistics – Individual element statistics (including unaggregated performances)

  • measure – Desidered view on data (frequency or performance)

  • aggregation_measure – Aggregation measure (e.g. mean, min) to use

Returns:

Aggregated statistics for arcs, transitions, places

Return type:

aggregated_statistics

pm4py.objects.petri_net.utils.performance_map.get_transition_performance_with_token_replay(log, net, im, fm)[source]#

Gets the transition performance through the usage of token-based replay

Parameters:
  • log – Event log

  • net – Petri net

  • im – Initial marking

  • fm – Final marking

Returns:

Dictionary where each transition label is associated to performance measures

Return type:

transition_performance

pm4py.objects.petri_net.utils.performance_map.get_idx_exceeding_specified_acti_performance(log, transition_performance, activity, lower_bound)[source]#

Get indexes of the cases exceeding the specified activity performance threshold

Parameters:
  • log – Event log

  • transition_performance – Dictionary where each transition label is associated to performance measures

  • activity – Target activity (of the filter)

  • lower_bound – Lower bound (filter cases which have a duration of the activity exceeding)

Returns:

A list of indexes in the log

Return type:

idx

pm4py.objects.petri_net.utils.performance_map.filter_cases_exceeding_specified_acti_performance(log, transition_performance, activity, lower_bound)[source]#

Filter cases exceeding the specified activity performance threshold

Parameters:
  • log – Event log

  • transition_performance – Dictionary where each transition label is associated to performance measures

  • activity – Target activity (of the filter)

  • lower_bound – Lower bound (filter cases which have a duration of the activity exceeding)

Returns:

Filtered log

Return type:

filtered_log