pm4py.algo.conformance.alignments.petri_net package#

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.

Subpackages#

Submodules#

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

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.

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

Bases: Enum

An enumeration.

VERSION_STATE_EQUATION_A_STAR = <module 'pm4py.algo.conformance.alignments.petri_net.variants.state_equation_a_star' from 'C:\\Users\\berti\\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\\pm4py-core\\pm4py\\algo\\conformance\\alignments\\petri_net\\variants\\tweaked_state_equation_a_star.py'>#
VERSION_DIJKSTRA_NO_HEURISTICS = <module 'pm4py.algo.conformance.alignments.petri_net.variants.dijkstra_no_heuristics' from 'C:\\Users\\berti\\pm4py-core\\pm4py\\algo\\conformance\\alignments\\petri_net\\variants\\dijkstra_no_heuristics.py'>#
VERSION_DIJKSTRA_LESS_MEMORY = <module 'pm4py.algo.conformance.alignments.petri_net.variants.dijkstra_less_memory' from 'C:\\Users\\berti\\pm4py-core\\pm4py\\algo\\conformance\\alignments\\petri_net\\variants\\dijkstra_less_memory.py'>#
VERSION_DISCOUNTED_A_STAR = <module 'pm4py.algo.conformance.alignments.petri_net.variants.discounted_a_star' from 'C:\\Users\\berti\\pm4py-core\\pm4py\\algo\\conformance\\alignments\\petri_net\\variants\\discounted_a_star.py'>#
class pm4py.algo.conformance.alignments.petri_net.algorithm.Parameters(value)[source]#

Bases: Enum

An enumeration.

PARAM_TRACE_COST_FUNCTION = 'trace_cost_function'#
PARAM_MODEL_COST_FUNCTION = 'model_cost_function'#
PARAM_SYNC_COST_FUNCTION = 'sync_cost_function'#
PARAM_ALIGNMENT_RESULT_IS_SYNC_PROD_AWARE = 'ret_tuple_as_trans_desc'#
PARAM_TRACE_NET_COSTS = 'trace_net_costs'#
TRACE_NET_CONSTR_FUNCTION = 'trace_net_constr_function'#
TRACE_NET_COST_AWARE_CONSTR_FUNCTION = 'trace_net_cost_aware_constr_function'#
PARAM_MAX_ALIGN_TIME_TRACE = 'max_align_time_trace'#
PARAM_MAX_ALIGN_TIME = 'max_align_time'#
PARAMETER_VARIANT_DELIMITER = 'variant_delimiter'#
CASE_ID_KEY = 'pm4py:param:case_id_key'#
ACTIVITY_KEY = 'pm4py:param:activity_key'#
VARIANTS_IDX = 'variants_idx'#
SHOW_PROGRESS_BAR = 'show_progress_bar'#
CORES = 'cores'#
BEST_WORST_COST_INTERNAL = 'best_worst_cost_internal'#
FITNESS_ROUND_DIGITS = 'fitness_round_digits'#
SYNCHRONOUS = 'synchronous_dijkstra'#
EXPONENT = 'theta'#
pm4py.algo.conformance.alignments.petri_net.algorithm.apply(obj: Union[EventLog, EventStream, DataFrame, Trace], petri_net: PetriNet, initial_marking: Marking, final_marking: Marking, parameters: Optional[Dict[Any, Any]] = None, variant=Variants.VERSION_STATE_EQUATION_A_STAR) Union[Dict[str, Any], List[Dict[str, Any]]][source]#
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)[source]#

apply alignments to a trace Parameters ———– trace

pm4py.log.log.Trace trace of events

petri_net

pm4py.objects.petri.petrinet.PetriNet the model to use for the alignment

initial_marking

pm4py.objects.petri.petrinet.Marking initial marking of the net

final_marking

pm4py.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#

alignment

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.

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)[source]#

apply alignments to a log Parameters ———– log

object of the form pm4py.log.log.EventLog event log

petri_net

pm4py.objects.petri.petrinet.PetriNet the model to use for the alignment

initial_marking

pm4py.objects.petri.petrinet.Marking initial marking of the net

final_marking

pm4py.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,

Returns#

alignment

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.

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)[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#

aligned_traces

Alignments

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#

dataframe

Diagnostics dataframe