|
1 | 1 | from abc import ABC |
2 | | -from typing import Optional, Any, Dict, Generic |
| 2 | +from typing import Optional, Any, Dict, Generic, Tuple, List |
3 | 3 |
|
4 | 4 | from pm4py.algo.discovery.inductive.cuts.xor import ExclusiveChoiceCut, ExclusiveChoiceCutUVCL, T |
5 | 5 | from pm4py.algo.discovery.inductive.dtypes.im_ds import IMDataStructureUVCL |
6 | | -from pm4py.objects.powl.obj import OperatorPOWL |
| 6 | +from pm4py.objects.powl.obj import OperatorPOWL, POWL |
7 | 7 | from pm4py.objects.process_tree.obj import Operator |
8 | 8 |
|
9 | 9 |
|
10 | 10 | class POWLExclusiveChoiceCut(ExclusiveChoiceCut, ABC, Generic[T]): |
11 | 11 |
|
12 | 12 | @classmethod |
13 | 13 | def operator(cls, parameters: Optional[Dict[str, Any]] = None) -> OperatorPOWL: |
14 | | - return OperatorPOWL(Operator.XOR, []) |
| 14 | + raise Exception("This function should not be called!") |
| 15 | + |
| 16 | + @classmethod |
| 17 | + def apply(cls, obj: T, parameters: Optional[Dict[str, Any]] = None) -> Optional[Tuple[POWL, List[T]]]: |
| 18 | + g = cls.holds(obj, parameters) |
| 19 | + if g is None: |
| 20 | + return g |
| 21 | + else: |
| 22 | + children = cls.project(obj, g, parameters) |
| 23 | + return OperatorPOWL(Operator.XOR, children), children |
15 | 24 |
|
16 | 25 |
|
17 | 26 | class POWLExclusiveChoiceCutUVCL(ExclusiveChoiceCutUVCL, POWLExclusiveChoiceCut[IMDataStructureUVCL], ABC): |
|
0 commit comments