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

Submodules#

pm4py.algo.simulation.tree_generator.variants.basic 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.simulation.tree_generator.variants.basic.Parameters(value)[source]#

Bases: Enum

An enumeration.

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: Optional[Dict[Union[str, Parameters], Any]] = 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#

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/>.

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

Bases: Enum

An enumeration.

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: Optional[Dict[Union[str, Parameters], Any]] = 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]#