pm4py.algo.simulation.playout.dfg.variants.classic module#

class pm4py.algo.simulation.playout.dfg.variants.classic.Parameters(*values)[source]#

Bases: Enum

MAX_NO_VARIANTS = 'max_no_variants'#
MIN_WEIGHTED_PROBABILITY = 'min_weighted_probability'#
MAX_NO_OCC_PER_ACTIVITY = 'max_no_occ_per_activitiy'#
ACTIVITY_KEY = 'pm4py:param:activity_key'#
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'#
INTERRUPT_SIMULATION_WHEN_DFG_COMPLETE = 'interrupt_simulation_when_dfg_complete'#
ADD_TRACE_IF_TAKES_NEW_ELS_TO_DFG = 'add_trace_if_takes_new_els_to_dfg'#
RETURN_VARIANTS = 'return_variants'#
MAX_EXECUTION_TIME = 'max_execution_time'#
RETURN_ONLY_IF_COMPLETE = 'return_only_if_complete'#
MIN_VARIANT_OCC = 'min_variant_occ'#
pm4py.algo.simulation.playout.dfg.variants.classic.get_node_tr_probabilities(dfg, start_activities, end_activities)[source]#

Gets the transition probabilities between the nodes of a DFG

Parameters:
  • dfg – DFG

  • start_activities – Start activities

  • end_activities – End activities

Returns:

  • weighted_start_activities – Start activities, with a relative weight going from 0 to 1

  • node_transition_probabilities – The transition probabilities between the nodes of the DFG (the end node is None)

pm4py.algo.simulation.playout.dfg.variants.classic.get_traces(dfg, start_activities, end_activities, parameters=None)[source]#

Gets the most probable traces from the DFG, one-by-one (iterator), until the least probable

Parameters:
  • dfgComplete DFG

  • start_activities – Start activities

  • end_activities – End activities

  • parameters – Parameters of the algorithm, including: - Parameters.MAX_NO_OCC_PER_ACTIVITY => the maximum number of occurrences per activity in the traces of the log

    (default: 2)

Returns:

Trace of the simulation

Return type:

yielded_trace

pm4py.algo.simulation.playout.dfg.variants.classic.apply(dfg: Dict[Tuple[str, str], int], start_activities: Dict[str, int], end_activities: Dict[str, int], parameters: Dict[str | Parameters, Any] | None = None) EventLog | Dict[Tuple[str, str], int][source]#

Applies the playout algorithm on a DFG, extracting the most likely traces according to the DFG

Parameters:
  • dfgComplete DFG

  • start_activities – Start activities

  • end_activities – End activities

  • parameters – Parameters of the algorithm, including: - Parameters.ACTIVITY_KEY => the activity key of the simulated log - Parameters.TIMESTAMP_KEY => the timestamp key of the simulated log - Parameters.MAX_NO_VARIANTS => the maximum number of variants generated by the method (default: 3000) - Parameters.MIN_WEIGHTED_PROBABILITY => the minimum overall weighted probability that makes the method stop

    (default: 1)

    • Parameters.MAX_NO_OCC_PER_ACTIVITY => the maximum number of occurrences per activity in the traces of the log

      (default: 2)

    • Parameters.INTERRUPT_SIMULATION_WHEN_DFG_COMPLETE => interrupts the simulation when the DFG of the simulated

      log has the same keys to the DFG of the original log (all behavior is contained) (default: False)

    • Parameters.ADD_TRACE_IF_TAKES_NEW_ELS_TO_DFG => adds a simulated trace to the simulated log only if it adds

      elements to the simulated DFG, e.g., it adds behavior; skip insertion otherwise (default: False)

    • Parameters.RETURN_VARIANTS => returns the traces as variants with a likely number of occurrences

Returns:

Simulated log

Return type:

simulated_log

pm4py.algo.simulation.playout.dfg.variants.classic.get_trace_probability(trace, dfg, start_activities, end_activities, parameters=None)[source]#

Given a trace of a log, gets its probability given the complete DFG

Parameters:
  • trace – Trace of a log

  • dfgComplete DFG

  • start_activities – Start activities of the model

  • end_activities – End activities of the model

  • parameters – Parameters of the algorithm: - Parameters.ACTIVITY_KEY => activity key

Returns:

The probability of the trace according to the DFG

Return type:

prob