pm4py.algo.simulation.tree_generator.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.tree_generator.variants.basic 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.tree_generator.variants.basic.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

REC_DEPTH = 'rec_depth'#
MIN_REC_DEPTH = 'min_rec_depth'#
MAX_REC_DEPTH = 'max_rec_depth'#
PROB_LEAF = 'prob_leaf'#
pm4py.algo.simulation.tree_generator.variants.basic.generate_random_string(N)[source]#

Generate a random string

Parameters#

N

length of the string

Returns#

random_string

Random string

pm4py.algo.simulation.tree_generator.variants.basic.get_random_operator()[source]#

Gets a random operator

Returns#

operator

Operator

pm4py.algo.simulation.tree_generator.variants.basic.apply(parameters: Dict[str | Parameters, Any] | None = None) ProcessTree[source]#

Generate a process tree

Parameters#

parameters
Paramters of the algorithm, including:

Parameters.REC_DEPTH -> current recursion depth Parameters.MIN_REC_DEPTH -> minimum recursion depth Parameters.MAX_REC_DEPTH -> maximum recursion depth Parameters.PROB_LEAF -> Probability to get a leaf

Returns#

tree

Process tree

pm4py.algo.simulation.tree_generator.variants.ptandloggenerator 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

pm4py.algo.simulation.tree_generator.variants.ptandloggenerator.choices(population, weights=None, *, cum_weights=None, k=1)[source]#

Return a k sized list of population elements chosen with replacement. If the relative weights or cumulative weights are not specified, the selections are made with equal probability.

class pm4py.algo.simulation.tree_generator.variants.ptandloggenerator.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

SEQUENCE = 'sequence'#
CHOICE = 'choice'#
PARALLEL = 'parallel'#
LOOP = 'loop'#
OR = 'or'#
MODE = 'mode'#
MIN = 'min'#
MAX = 'max'#
SILENT = 'silent'#
DUPLICATE = 'duplicate'#
NO_MODELS = 'no_models'#
pm4py.algo.simulation.tree_generator.variants.ptandloggenerator.apply(parameters: Dict[str | Parameters, Any] | None = None) ProcessTree[source]#

Generate a process tree using the PTAndLogGenerator approach (see the paper PTandLogGenerator: A Generator for Artificial Event Data)

Parameters#

parameters

Parameters of the algorithm, according to the paper: - Parameters.MODE: most frequent number of visible activities - Parameters.MIN: minimum number of visible activities - Parameters.MAX: maximum number of visible activities - Parameters.SEQUENCE: probability to add a sequence operator to tree - Parameters.CHOICE: probability to add a choice operator to tree - Parameters.PARALLEL: probability to add a parallel operator to tree - Parameters.LOOP: probability to add a loop operator to tree - Parameters.OR: probability to add an or operator to tree - Parameters.SILENT: probability to add silent activity to a choice or loop operator - Parameters.DUPLICATE: probability to duplicate an activity label - Parameters.NO_MODELS: number of trees to generate from model population

pm4py.algo.simulation.tree_generator.variants.ptandloggenerator.assign_operator(operator)[source]#
class pm4py.algo.simulation.tree_generator.variants.ptandloggenerator.GeneratedTree(parameters)[source]#

Bases: object

alphabet = 'abcdefghijklmnopqrstuvwxyz'#
calculate_activity_distribution(mode, min, max)[source]#

Here, the triangular function is used, since the parameters for this function are given in the paramterfile. However, this approach can be applied on other distribution functions as well. :param mode: Mode of the distribution :param min: Smallest number :param max: Highest number :return: Distribution object

draw_random_number_from_distribution()[source]#
select_operator()[source]#
get_next_activity()[source]#
add_duplicates()[source]#

Replaces some leaves to add duplicated labels. Depends on parameter. :return:

add_node()[source]#
iter_all_strings()[source]#
create_process_tree()[source]#
generate()[source]#