Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/hotfixes' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
fit-alessandro-berti committed Nov 24, 2024
2 parents 945b705 + ab2aa78 commit cabff68
Show file tree
Hide file tree
Showing 15 changed files with 5,050 additions and 2,638 deletions.
577 changes: 375 additions & 202 deletions pm4py/analysis.py

Large diffs are not rendered by default.

1,334 changes: 951 additions & 383 deletions pm4py/conformance.py

Large diffs are not rendered by default.

363 changes: 228 additions & 135 deletions pm4py/connectors.py

Large diffs are not rendered by default.

354 changes: 234 additions & 120 deletions pm4py/convert.py

Large diffs are not rendered by default.

614 changes: 371 additions & 243 deletions pm4py/discovery.py

Large diffs are not rendered by default.

1,291 changes: 832 additions & 459 deletions pm4py/filtering.py

Large diffs are not rendered by default.

218 changes: 109 additions & 109 deletions pm4py/llm.py

Large diffs are not rendered by default.

408 changes: 289 additions & 119 deletions pm4py/ml.py

Large diffs are not rendered by default.

419 changes: 268 additions & 151 deletions pm4py/ocel.py

Large diffs are not rendered by default.

163 changes: 102 additions & 61 deletions pm4py/org.py

Large diffs are not rendered by default.

291 changes: 189 additions & 102 deletions pm4py/read.py

Large diffs are not rendered by default.

34 changes: 20 additions & 14 deletions pm4py/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Contact: info@processintelligence.solutions
'''
__doc__ = """
The ``pm4py.sim`` module contains the simulation algorithms offered in ``pm4py``
The ``pm4py.sim`` module contains simulation algorithms provided by ``pm4py``.
"""

from collections import Counter
Expand All @@ -33,15 +33,21 @@

def play_out(*args: Union[Tuple[PetriNet, Marking, Marking], dict, Counter, ProcessTree], **kwargs) -> EventLog:
"""
Performs the playout of the provided model,
i.e., gets a set of traces from the model.
The function either takes a petri net, initial and final marking, or, a process tree as an input.
:param args: model (Petri net with initial and final marking, or process tree)
:param kwargs: optional parameters of the method, including:
- parameters: dictionary containing the parameters of the playout, including:
- smap: (if provided) stochastic map to be used to stochastically choose the transition
- log: (if provided) EventLog to be used to compute the stochastic map, if smap not provided
Performs the playout of the provided model, generating a set of traces.
The function accepts one of the following inputs:
- A Petri net with initial and final markings.
- A Directly-Follows Graph (DFG) represented as a dictionary.
- A process tree.
:param args:
- For Petri net playout: a `PetriNet`, an initial `Marking`, and a final `Marking`.
- For DFG playout: a `dict` representing the DFG, followed by additional required arguments.
- For process tree playout: a single `ProcessTree`.
:param kwargs: Optional parameters of the method, including:
- `parameters`: A dictionary containing parameters of the playout, such as:
- `smap`: (optional) A stochastic map to be used for probabilistic transition selection.
- `log`: (optional) An `EventLog` used to compute the stochastic map if `smap` is not provided.
:rtype: ``EventLog``
.. code-block:: python3
Expand Down Expand Up @@ -85,20 +91,20 @@ def play_out(*args: Union[Tuple[PetriNet, Marking, Marking], dict, Counter, Proc
return dfg_playout.apply(args[0], args[1], args[2], **kwargs)
elif len(args) == 1:
from pm4py.objects.process_tree.obj import ProcessTree
if type(args[0]) is ProcessTree:
if isinstance(args[0], ProcessTree):
from pm4py.algo.simulation.playout.process_tree import algorithm
return algorithm.apply(args[0], **kwargs)
raise Exception("unsupported model for playout")
raise Exception("Unsupported model for playout")


def generate_process_tree(**kwargs) -> ProcessTree:
"""
Generates a process tree
Generates a process tree.
Reference paper:
PTandLogGenerator: A Generator for Artificial Event Data
:param kwargs: dictionary containing the parameters of the process tree generator algorithm
:param kwargs: Parameters for the process tree generator algorithm.
:rtype: ``ProcessTree``
.. code-block:: python3
Expand Down
Loading

0 comments on commit cabff68

Please sign in to comment.