pm4py.algo.simulation.playout.dfg.variants package#
PM4Py – A Process Mining Library for Python
Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.
Website: https://processintelligence.solutions Contact: info@processintelligence.solutions
Submodules#
pm4py.algo.simulation.playout.dfg.variants.classic module#
PM4Py – A Process Mining Library for Python
Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.
Website: https://processintelligence.solutions Contact: info@processintelligence.solutions
- class pm4py.algo.simulation.playout.dfg.variants.classic.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[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#
- dfg
Complete 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#
- yielded_trace
Trace of the simulation
- 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#
- dfg
Complete 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
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
- dfg
Complete 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#
- prob
The probability of the trace according to the DFG
pm4py.algo.simulation.playout.dfg.variants.performance module#
PM4Py – A Process Mining Library for Python
Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.
Website: https://processintelligence.solutions Contact: info@processintelligence.solutions
- class pm4py.algo.simulation.playout.dfg.variants.performance.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Bases:
Enum- NUM_TRACES = 'num_traces'#
- ACTIVITY_KEY = 'pm4py:param:activity_key'#
- TIMESTAMP_KEY = 'pm4py:param:timestamp_key'#
- CASE_ID_KEY = 'pm4py:param:case_id_key'#
- CASE_ARRIVAL_RATE = 'case_arrival_rate'#
- PERFORMANCE_DFG = 'performance_dfg'#
- PARAM_ARTIFICIAL_START_ACTIVITY = 'pm4py:param:art_start_act'#
- PARAM_ARTIFICIAL_END_ACTIVITY = 'pm4py:param:art_end_act'#
- pm4py.algo.simulation.playout.dfg.variants.performance.dict_based_choice(dct: Dict[str, float]) str[source]#
Performs a weighted choice, given a dictionary associating a weight to each possible choice
Parameters#
- dct
Dictionary associating a weight to each choice
Returns#
- choice
Choice
- pm4py.algo.simulation.playout.dfg.variants.performance.apply(frequency_dfg: Dict[Tuple[str, str], int], start_activities: Dict[str, int], end_activities: Dict[str, int], parameters: Dict[Any, Any] | None = None) EventLog[source]#
Simulates a log out with the transition probabilities provided by the frequency DFG, and the time deltas provided by the performance DFG
Parameters#
- frequency_dfg
Frequency DFG
- start_activities
Start activities
- end_activities
End activities
- parameters
Parameters of the algorithm, including: - Parameters.NUM_TRACES: the number of traces of the simulated log - Parameters.ACTIVITY_KEY: the activity key to be used in the simulated log - Parameters.TIMESTAMP_KEY: the timestamp key to be used in the simulated log - Parameters.CASE_ID_KEY: the case identifier key to be used in the simulated log - Parameters.CASE_ARRIVAL_RATE: the average distance (in seconds) between the start of two cases (default: 1) - Parameters.PERFORMANCE_DFG: (mandatory) the performance DFG that is used for the time deltas.
Returns#
- simulated_log
Simulated log