pm4py.objects.conversion.process_tree.variants.to_petri_net module#
- class pm4py.objects.conversion.process_tree.variants.to_petri_net.Counts[source]#
Bases:
objectShared variables among executions
Increase the number of hidden transitions
- pm4py.objects.conversion.process_tree.variants.to_petri_net.clean_duplicate_transitions(net)[source]#
Clean duplicate transitions in a Petri net
- Parameters:
net – Petri net
- Returns:
Cleaned Petri net
- Return type:
net
- pm4py.objects.conversion.process_tree.variants.to_petri_net.get_new_place(counts)[source]#
Create a new place in the Petri net
Create a new hidden transition in the Petri net
- pm4py.objects.conversion.process_tree.variants.to_petri_net.get_transition(counts, label)[source]#
Create a transitions with the specified label in the Petri net
- pm4py.objects.conversion.process_tree.variants.to_petri_net.get_first_terminal_child_transitions(tree)[source]#
Gets the list of transitions belonging to the first terminal child node of the current tree
- Parameters:
tree – Process tree
- Returns:
List of transitions belonging to the first terminal child node
- Return type:
transitions_list
- pm4py.objects.conversion.process_tree.variants.to_petri_net.get_last_terminal_child_transitions(tree)[source]#
Gets the list of transitions belonging to the last terminal child node of the current tree
- Parameters:
tree – Process tree
- Returns:
List of transitions belonging to the first terminal child node
- Return type:
transitions_list
- pm4py.objects.conversion.process_tree.variants.to_petri_net.check_loop_to_first_operator(tree)[source]#
Checks if loop to first operator
- Parameters:
tree – Process tree
- Returns:
Check if no loop to the first operator
- Return type:
boolean
- pm4py.objects.conversion.process_tree.variants.to_petri_net.check_loop_to_last_operator(tree)[source]#
Checks if loop to last operator
- Parameters:
tree – Process tree
- Returns:
Check if no loop to the last operator
- Return type:
boolean
- pm4py.objects.conversion.process_tree.variants.to_petri_net.check_initial_loop(tree)[source]#
Check if the tree, on-the-left, starts with a loop
- Parameters:
tree – Process tree
- Returns:
True if it starts with an initial loop
- Return type:
boolean
- pm4py.objects.conversion.process_tree.variants.to_petri_net.check_terminal_loop(tree)[source]#
Check if the tree, on-the-right, ends with a loop
- Parameters:
tree – Process tree
- Returns:
True if it ends with a terminal loop
- Return type:
boolean
- pm4py.objects.conversion.process_tree.variants.to_petri_net.check_tau_mandatory_at_initial_marking(tree)[source]#
When a conversion to a Petri net is operated, check if is mandatory to add a hidden transition at initial marking
- Parameters:
tree – Process tree
- Returns:
Boolean that is true if it is mandatory to add a hidden transition connecting the initial marking to the rest of the process
- Return type:
boolean
- pm4py.objects.conversion.process_tree.variants.to_petri_net.check_tau_mandatory_at_final_marking(tree)[source]#
When a conversion to a Petri net is operated, check if is mandatory to add a hidden transition at final marking
- Returns:
Boolean that is true if it is mandatory to add a hidden transition connecting the rest of the process to the final marking
- Return type:
boolean
- pm4py.objects.conversion.process_tree.variants.to_petri_net.recursively_add_tree(parent_tree, tree, net, initial_entity_subtree, final_entity_subtree, counts, rec_depth, force_add_skip=False)[source]#
Recursively add the subtrees to the Petri net
- Parameters:
parent_tree – Parent tree
tree – Current subtree
net – Petri net
initial_entity_subtree – Initial entity (place/transition) that should be attached from the subtree
final_entity_subtree – Final entity (place/transition) that should be attached from the subtree
counts – Counts object (keeps the number of places, transitions and hidden transitions)
rec_depth – Recursion depth of the current iteration
force_add_skip – Boolean value that tells if the addition of a skip is mandatory
- Returns:
net – Updated Petri net
counts – Updated counts object (keeps the number of places, transitions and hidden transitions)
final_place – Last place added in this recursion