pm4py.simulation.tree_generator.variants package

Submodules

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

Bases: enum.Enum

An enumeration.

MAX_REC_DEPTH = 'max_rec_depth'
MIN_REC_DEPTH = 'min_rec_depth'
PROB_LEAF = 'prob_leaf'
REC_DEPTH = 'rec_depth'
pm4py.simulation.tree_generator.variants.basic.apply(parameters=None)[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

Process tree

Return type

tree

pm4py.simulation.tree_generator.variants.basic.generate_random_string(N)[source]

Generate a random string

Parameters

N – length of the string

Returns

Random string

Return type

random_string

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

Gets a random operator

Returns

Operator

Return type

operator

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

class pm4py.simulation.tree_generator.variants.ptandloggenerator.GeneratedTree(parameters)[source]

Bases: object

add_duplicates()[source]

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

add_node(next_activity)[source]

Add nodes to current tree. The general procedure is as follows: Select a random leaf (leaves have label). Next step, and opertor is chosen. The chosen operator then replaces the leaf, whereby the old label is then add as a leaf to the manipulated node. Then, next activity is added as a second leaf to the new operator node or a silent acticity (tau) is added. :return: Next activity

alphabet = 'abcdefghijklmnopqrstuvwxyz'
assign_root_opeartor()[source]
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

create_process_tree()[source]
draw_random_number_from_distribution()[source]
generate()[source]
get_next_activity(activity)[source]
select_operator()[source]
class pm4py.simulation.tree_generator.variants.ptandloggenerator.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

CHOICE = 'choice'
DUPLICATE = 'duplicate'
INFREQUENT = 'infrequent'
LOOP = 'loop'
LT_DEPENDENCY = 'lt_dependency'
MAX = 'max'
MAX_REPEAT = 'max_repeat'
MIN = 'min'
MODE = 'mode'
NO_MODELS = 'no_models'
OR = 'or'
PARALLEL = 'parallel'
SEQUENCE = 'sequence'
SILENT = 'silent'
UNFOLD = 'unfold'
pm4py.simulation.tree_generator.variants.ptandloggenerator.apply(parameters=None)[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.LT_DEPENDENCY: probability to add a random dependency to the tree - Parameters.INFREQUENT: probability to make a choice have infrequent paths - Parameters.NO_MODELS: number of trees to generate from model population - Parameters.UNFOLD: whether or not to unfold loops in order to include choices underneath in dependencies: 0=False, 1=True

if lt_dependency <= 0: this should always be 0 (False) if lt_dependency > 0: this can be 1 or 0 (True or False)

  • Parameters.MAX_REPEAT: maximum number of repetitions of a loop (only used when unfolding is True)

pm4py.simulation.tree_generator.variants.ptandloggenerator.assign_operator(operator)[source]
pm4py.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.

Module contents

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