pm4py.algo.simulation.tree_generator.variants.ptandloggenerator module#

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(*values)[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]#