pm4py.algo.conformance.alignments.petri_net package

Submodules

pm4py.algo.conformance.alignments.petri_net.algorithm module

class pm4py.algo.conformance.alignments.petri_net.algorithm.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'
CASE_ID_KEY = 'case_id_glue'
CORES = 'cores'
PARAMETER_VARIANT_DELIMITER = 'variant_delimiter'
PARAM_ALIGNMENT_RESULT_IS_SYNC_PROD_AWARE = 'ret_tuple_as_trans_desc'
PARAM_MAX_ALIGN_TIME = 'max_align_time'
PARAM_MAX_ALIGN_TIME_TRACE = 'max_align_time_trace'
PARAM_MODEL_COST_FUNCTION = 'model_cost_function'
PARAM_SYNC_COST_FUNCTION = 'sync_cost_function'
PARAM_TRACE_COST_FUNCTION = 'trace_cost_function'
PARAM_TRACE_NET_COSTS = 'trace_net_costs'
SHOW_PROGRESS_BAR = 'show_progress_bar'
TRACE_NET_CONSTR_FUNCTION = 'trace_net_constr_function'
TRACE_NET_COST_AWARE_CONSTR_FUNCTION = 'trace_net_cost_aware_constr_function'
VARIANTS_IDX = 'variants_idx'
class pm4py.algo.conformance.alignments.petri_net.algorithm.Variants(value)[source]

Bases: enum.Enum

An enumeration.

VERSION_DIJKSTRA_LESS_MEMORY = <module 'pm4py.algo.conformance.alignments.petri_net.variants.dijkstra_less_memory' from 'C:\\Users\\berti\\FRAUNHOFER\\pm4py-core\\pm4py\\algo\\conformance\\alignments\\petri_net\\variants\\dijkstra_less_memory.py'>
VERSION_DIJKSTRA_NO_HEURISTICS = <module 'pm4py.algo.conformance.alignments.petri_net.variants.dijkstra_no_heuristics' from 'C:\\Users\\berti\\FRAUNHOFER\\pm4py-core\\pm4py\\algo\\conformance\\alignments\\petri_net\\variants\\dijkstra_no_heuristics.py'>
VERSION_STATE_EQUATION_A_STAR = <module 'pm4py.algo.conformance.alignments.petri_net.variants.state_equation_a_star' from 'C:\\Users\\berti\\FRAUNHOFER\\pm4py-core\\pm4py\\algo\\conformance\\alignments\\petri_net\\variants\\state_equation_a_star.py'>
VERSION_TWEAKED_STATE_EQUATION_A_STAR = <module 'pm4py.algo.conformance.alignments.petri_net.variants.tweaked_state_equation_a_star' from 'C:\\Users\\berti\\FRAUNHOFER\\pm4py-core\\pm4py\\algo\\conformance\\alignments\\petri_net\\variants\\tweaked_state_equation_a_star.py'>
pm4py.algo.conformance.alignments.petri_net.algorithm.apply(obj, petri_net, initial_marking, final_marking, parameters=None, variant=<Variants.VERSION_STATE_EQUATION_A_STAR: <module 'pm4py.algo.conformance.alignments.petri_net.variants.state_equation_a_star' from 'C:\\Users\\berti\\FRAUNHOFER\\pm4py-core\\pm4py\\algo\\conformance\\alignments\\petri_net\\variants\\state_equation_a_star.py'>>)[source]
pm4py.algo.conformance.alignments.petri_net.algorithm.apply_log(log, petri_net, initial_marking, final_marking, parameters=None, variant=<Variants.VERSION_STATE_EQUATION_A_STAR: <module 'pm4py.algo.conformance.alignments.petri_net.variants.state_equation_a_star' from 'C:\\Users\\berti\\FRAUNHOFER\\pm4py-core\\pm4py\\algo\\conformance\\alignments\\petri_net\\variants\\state_equation_a_star.py'>>)[source]

apply alignments to a log :Parameters: * log – object of the form pm4py.log.log.EventLog event log

  • petri_netpm4py.objects.petri.petrinet.PetriNet the model to use for the alignment

  • initial_markingpm4py.objects.petri.petrinet.Marking initial marking of the net

  • final_markingpm4py.objects.petri.petrinet.Marking final marking of the net

  • variant – selected variant of the algorithm, possible values: {‘Variants.VERSION_STATE_EQUATION_A_STAR, Variants.VERSION_DIJKSTRA_NO_HEURISTICS ‘}

  • parametersdict parameters of the algorithm,

Returns

list of dict with keys alignment, cost, visited_states, queued_states and traversed_arcs The alignment is a sequence of labels of the form (a,t), (a,>>), or (>>,t) representing synchronous/log/model-moves.

Return type

alignment

pm4py.algo.conformance.alignments.petri_net.algorithm.apply_multiprocessing(log, petri_net, initial_marking, final_marking, parameters=None, variant=<Variants.VERSION_STATE_EQUATION_A_STAR: <module 'pm4py.algo.conformance.alignments.petri_net.variants.state_equation_a_star' from 'C:\\Users\\berti\\FRAUNHOFER\\pm4py-core\\pm4py\\algo\\conformance\\alignments\\petri_net\\variants\\state_equation_a_star.py'>>)[source]

Applies the alignments using a process pool (multiprocessing)

Parameters
  • log – Event log

  • petri_net – Petri net

  • initial_marking – Initial marking

  • final_marking – Final marking

  • parameters – Parameters of the algorithm

Returns

Alignments

Return type

aligned_traces

pm4py.algo.conformance.alignments.petri_net.algorithm.apply_trace(trace, petri_net, initial_marking, final_marking, parameters=None, variant=<Variants.VERSION_STATE_EQUATION_A_STAR: <module 'pm4py.algo.conformance.alignments.petri_net.variants.state_equation_a_star' from 'C:\\Users\\berti\\FRAUNHOFER\\pm4py-core\\pm4py\\algo\\conformance\\alignments\\petri_net\\variants\\state_equation_a_star.py'>>)[source]

apply alignments to a trace :Parameters: * tracepm4py.log.log.Trace trace of events

  • petri_netpm4py.objects.petri.petrinet.PetriNet the model to use for the alignment

  • initial_markingpm4py.objects.petri.petrinet.Marking initial marking of the net

  • final_markingpm4py.objects.petri.petrinet.Marking final marking of the net

  • variant – selected variant of the algorithm, possible values: {‘Variants.VERSION_STATE_EQUATION_A_STAR, Variants.VERSION_DIJKSTRA_NO_HEURISTICS ‘}

  • parameters

    dict parameters of the algorithm, for key ‘state_equation_a_star’:

    Parameters.ACTIVITY_KEY -> Attribute in the log that contains the activity Parameters.PARAM_MODEL_COST_FUNCTION -> mapping of each transition in the model to corresponding synchronous costs Parameters.PARAM_SYNC_COST_FUNCTION -> mapping of each transition in the model to corresponding model cost Parameters.PARAM_TRACE_COST_FUNCTION -> mapping of each index of the trace to a positive cost value

Returns

dict with keys alignment, cost, visited_states, queued_states and traversed_arcs The alignment is a sequence of labels of the form (a,t), (a,>>), or (>>,t) representing synchronous/log/model-moves.

Return type

alignment

pm4py.algo.conformance.alignments.petri_net.algorithm.get_diagnostics_dataframe(log, align_output, parameters=None)[source]

Gets the diagnostics results of alignments (of a log) in a dataframe

Parameters
  • log – Event log

  • align_output – Output of the alignments

Returns

Diagnostics dataframe

Return type

dataframe

Module contents