22
33import org .deckfour .xes .model .XLog ;
44import org .processmining .placebasedlpmdiscovery .model .Place ;
5+ import org .processmining .placebasedlpmdiscovery .prom .placediscovery .PlaceDiscoveryAlgorithmId ;
56import org .processmining .placebasedlpmdiscovery .prom .placediscovery .algorithms .PlaceDiscoveryAlgorithm ;
67import org .processmining .placebasedlpmdiscovery .prom .placediscovery .algorithms .PlaceDiscoveryAlgorithmFactory ;
7- import org .processmining .placebasedlpmdiscovery .prom .placediscovery .parameters .EstMinerPlaceDiscoveryParameters ;
8- import org .processmining .placebasedlpmdiscovery .prom .placediscovery .parameters .SPECppPlaceDiscoveryParameters ;
8+ import org .processmining .placebasedlpmdiscovery .prom .placediscovery .parameters .*;
99
1010import java .util .Set ;
1111
@@ -19,6 +19,36 @@ public FromLogPlacesProvider(XLog log, PlaceDiscoveryAlgorithm<?, ?> algorithm)
1919 this .algorithm = algorithm ;
2020 }
2121
22+ /**
23+ * Creates a PlacesProvider that discovers places using the specified algorithm.
24+ * @param log the XLog to discover places from
25+ * @param algorithmId the algorithm to use for place discovery
26+ * @return a PlacesProvider that discovers places using the specified algorithm
27+ */
28+ public static PlacesProvider getInstance (XLog log , PlaceDiscoveryAlgorithmId algorithmId ) {
29+ if (algorithmId == PlaceDiscoveryAlgorithmId .ESTMiner ) {
30+ return est (log );
31+ } else if (algorithmId == PlaceDiscoveryAlgorithmId .SPECpp ) {
32+ return specpp (log );
33+ } else if (algorithmId == PlaceDiscoveryAlgorithmId .HeuristicMiner ) {
34+ return heuristicMiner (log );
35+ } else if (algorithmId == PlaceDiscoveryAlgorithmId .InductiveMiner ) {
36+ return inductiveMiner (log );
37+ }
38+ throw new IllegalArgumentException ("Unsupported PlaceDiscoveryAlgorithmId: " + algorithmId );
39+ }
40+
41+ /**
42+ * Creates a PlacesProvider that discovers places using the specified parameters.
43+ * @param log the XLog to discover places from
44+ * @param placeDiscoveryParameters the parameters to use for place discovery
45+ * @return a PlacesProvider that discovers places using the specified parameters
46+ */
47+ public static PlacesProvider getInstance (XLog log , PlaceDiscoveryParameters placeDiscoveryParameters ) {
48+ PlaceDiscoveryAlgorithmFactory factory = PlaceDiscoveryAlgorithmFactory .getInstance ();
49+ return new FromLogPlacesProvider (log , placeDiscoveryParameters .getAlgorithm (factory ));
50+ }
51+
2252 @ Override
2353 public Set <Place > provide () {
2454 return algorithm .getPlaces (this .log ).getPlaces ();
@@ -39,9 +69,8 @@ public static PlacesProvider recommended(XLog log) {
3969 * @return a PlacesProvider that discovers places using the EST-Miner algorithm
4070 */
4171 public static PlacesProvider est (XLog log ) {
42- PlaceDiscoveryAlgorithmFactory factory = new PlaceDiscoveryAlgorithmFactory ();
4372 EstMinerPlaceDiscoveryParameters parameters = new EstMinerPlaceDiscoveryParameters ();
44- return new FromLogPlacesProvider (log , parameters . getAlgorithm ( factory ) );
73+ return getInstance (log , parameters );
4574 }
4675
4776 /**
@@ -50,9 +79,27 @@ public static PlacesProvider est(XLog log) {
5079 * @return a PlacesProvider that discovers places using the SPECpp algorithm
5180 */
5281 public static PlacesProvider specpp (XLog log ) {
53- PlaceDiscoveryAlgorithmFactory factory = new PlaceDiscoveryAlgorithmFactory ();
5482 SPECppPlaceDiscoveryParameters parameters = new SPECppPlaceDiscoveryParameters ();
55- return new FromLogPlacesProvider (log , parameters . getAlgorithm ( factory ) );
83+ return getInstance (log , parameters );
5684 }
5785
86+ /**
87+ * Creates a PlacesProvider that discovers places using the Heuristic Miner algorithm.
88+ * @param log the XLog to discover places from
89+ * @return a PlacesProvider that discovers places using the Heuristic Miner algorithm
90+ */
91+ public static PlacesProvider heuristicMiner (XLog log ) {
92+ HeuristicMinerPlaceDiscoveryParameters parameters = new HeuristicMinerPlaceDiscoveryParameters ();
93+ return getInstance (log , parameters );
94+ }
95+
96+ /**
97+ * Creates a PlacesProvider that discovers places using the Inductive Miner algorithm.
98+ * @param log the XLog to discover places from
99+ * @return a PlacesProvider that discovers places using the Inductive Miner algorithm
100+ */
101+ public static PlacesProvider inductiveMiner (XLog log ) {
102+ InductiveMinerPlaceDiscoveryParameters parameters = new InductiveMinerPlaceDiscoveryParameters ();
103+ return getInstance (log , parameters );
104+ }
58105}
0 commit comments