Skip to content

Commit 02888e7

Browse files
Merge pull request #532 from olekuhlmann/feature/ocpn-occn-translation
Transformations between Object-Centric Causal Nets (OCCNs) and Object-Centric Petri Nets (OCPNs) as well as play-out and replay for both
2 parents 75cd2a3 + 51302a3 commit 02888e7

36 files changed

Lines changed: 16244 additions & 0 deletions
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'''
2+
PM4Py – A Process Mining Library for Python
3+
Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU Affero General Public License as
7+
published by the Free Software Foundation, either version 3 of the
8+
License, or any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU Affero General Public License for more details.
14+
15+
You should have received a copy of the GNU Affero General Public License
16+
along with this program. If not, see this software project's root or
17+
visit <https://www.gnu.org/licenses/>.
18+
19+
Website: https://processintelligence.solutions
20+
Contact: info@processintelligence.solutions
21+
'''
22+
from pm4py.algo.simulation.playout.oc_causal_net import algorithm, variants
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
'''
2+
PM4Py – A Process Mining Library for Python
3+
Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU Affero General Public License as
7+
published by the Free Software Foundation, either version 3 of the
8+
License, or any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU Affero General Public License for more details.
14+
15+
You should have received a copy of the GNU Affero General Public License
16+
along with this program. If not, see this software project's root or
17+
visit <https://www.gnu.org/licenses/>.
18+
19+
Website: https://processintelligence.solutions
20+
Contact: info@processintelligence.solutions
21+
'''
22+
from pm4py.algo.simulation.playout.ocpn.variants import extensive
23+
from pm4py.util import exec_utils
24+
from enum import Enum
25+
from pm4py.objects.oc_causal_net.obj import OCCausalNet
26+
from typing import Optional, Dict, Any
27+
from pm4py.objects.ocel.obj import OCEL
28+
29+
30+
class Variants(Enum):
31+
EXTENSIVE = extensive
32+
33+
34+
DEFAULT_VARIANT = Variants.EXTENSIVE
35+
VERSIONS = {Variants.EXTENSIVE}
36+
37+
38+
def apply(occn: OCCausalNet, objects, parameters: Optional[Dict[Any, Any]] = None, variant=DEFAULT_VARIANT) -> OCEL:
39+
"""
40+
Do the playout of an object-centric causal net generating an OCEL.
41+
42+
Parameters
43+
-----------
44+
occn
45+
Object-centric causal net to play-out
46+
objects
47+
Dictionary mapping object types to object ids. These objects will be introduced by the start activities of the occn at the beginning of every binding sequence.
48+
parameters
49+
Parameters of the algorithm
50+
variant
51+
Variant of the algorithm to use:
52+
- Variants.EXTENSIVE: gets all the traces from the model. can be expensive
53+
54+
Returns
55+
-----------
56+
OCEL
57+
Object-centric event log generated by the playout of the object-centric causal net
58+
"""
59+
return exec_utils.get_variant(variant).apply(occn, objects, parameters=parameters)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'''
2+
PM4Py – A Process Mining Library for Python
3+
Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU Affero General Public License as
7+
published by the Free Software Foundation, either version 3 of the
8+
License, or any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU Affero General Public License for more details.
14+
15+
You should have received a copy of the GNU Affero General Public License
16+
along with this program. If not, see this software project's root or
17+
visit <https://www.gnu.org/licenses/>.
18+
19+
Website: https://processintelligence.solutions
20+
Contact: info@processintelligence.solutions
21+
'''
22+
from pm4py.algo.simulation.playout.oc_causal_net.variants import extensive

0 commit comments

Comments
 (0)