Class PrimeMinerAlgorithmSteps
- java.lang.Object
-
- org.processmining.primeminer.algorithms.PrimeMinerAlgorithmSteps
-
public class PrimeMinerAlgorithmSteps extends java.lang.ObjectAlgorithmSteps contains all the calculations which are part of the steps of the prime miner. It contains on the first section the main steps of the prime miner in several methods. The middle part is filled with some helper functions, used by the main steps. Last but not least the setters and getters are on the end.- Author:
- Robin Bergenthum, Raphael Meyer
-
-
Constructor Summary
Constructors Constructor Description PrimeMinerAlgorithmSteps()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddStatesToPES(PrimeEventStructure pes)iterates over all events and add statesstatic java.lang.StringarrayToString(int[] array)Converts an array of ints into a Stringstatic java.util.ArrayList<Region>buildInitialRegions(java.util.ArrayList<Region> switchingRegions, java.util.ArrayList<Region> excitationRegions)Builds a Set of regions from the sets of switching and excitation region and avoid the availability of double regionsstatic org.processmining.models.graphbased.directed.petrinet.PetrinetbuildPetriNet()static java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>>calcConcurrentAlpha(java.util.ArrayList<java.util.ArrayList<java.lang.String>> language)STEP 2: ALPHA: Use the concurrency oracle "alpha" to detect concurrent elementsstatic java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>>calcConcurrentLaterThan(java.util.ArrayList<java.util.ArrayList<java.lang.String>> language)STEP 2: LATER-THAN: Use the concurrency oracle "later-than" to detect concurrent elementsstatic java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>>calcConcurrentLifecycle(java.util.ArrayList<java.util.ArrayList<java.lang.String>> language)STEP 2: LIFECYCLE: Use the concurrency oracle "lifecycle" to detect concurrent elementsstatic java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>>calcConcurrentNone(java.util.ArrayList<java.util.ArrayList<java.lang.String>> language)STEP 2: (NONE) Determine a concurrency relationship without an oraclestatic java.util.ArrayList<java.util.ArrayList<java.lang.String>>calcLanguage(org.deckfour.xes.model.XLog log)STEP 1: Calculate Language of an Event Log A language is based on words.static java.util.ArrayList<HasseDiagram>calcPartialLanguage(java.util.ArrayList<java.util.ArrayList<java.lang.String>> language, java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> concurrent)STEP 3: Folding language with concurrency to a partial languagestatic java.util.ArrayList<Region>calculateExcitationRegions(PrimeEventStructure pes)calculates an excitation regionstatic java.util.ArrayList<Region>calculateSwitchingRegions(PrimeEventStructure pes)calculates an switching regionstatic org.processmining.acceptingpetrinet.models.AcceptingPetriNetArraycreateStatsForDialog(org.processmining.acceptingpetrinet.models.AcceptingPetriNetArray acceptingPetriNetArray, java.util.ArrayList<java.util.ArrayList<java.lang.String>> language, java.lang.Boolean isShowHasse)This creates some final statistic data of the originally third dialogstatic java.util.ArrayList<java.lang.String>detectOracles(org.deckfour.xes.model.XLog log)Returns an ArrayList of Strings that contains all Oracles detected in the log.static org.processmining.acceptingpetrinet.models.AcceptingPetriNetArrayestablishHasseDiagrams(java.util.ArrayList<HasseDiagram> partialLanguage, int consideredHasses, boolean isShowHasse, org.processmining.framework.plugin.PluginContext context, org.processmining.acceptingpetrinet.models.impl.AcceptingPetriNetFactory acceptingPetriNetFactory, org.processmining.acceptingpetrinet.models.AcceptingPetriNetArray acceptingPetriNetArray, org.processmining.acceptingpetrinet.models.AcceptingPetriNetArray singleSolutionPetriNetArray)STEP 3: establish the hasse diagrams and calls the methods of STEP 4 and STEP 5 while runningstatic voidfire(org.processmining.models.graphbased.directed.petrinet.elements.Transition transition, org.processmining.models.semantics.petrinet.Marking marking, org.processmining.models.graphbased.directed.petrinet.Petrinet petriNet)firestatic java.util.ArrayList<Event>getAllEventsWithLabel(PrimeEventStructure pes, java.lang.String label)Searches all events in a PrimeEventStructure with this labelstatic java.util.ArrayList<java.lang.String>getAllLabels(PrimeEventStructure pes)Collect all labels of a given PrimeEventStructurestatic java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>>getConcurrent()static java.util.ArrayList<java.util.ArrayList<java.lang.String>>getLanguage()static int[]getLanguageDistribution()static intgetLanguageSize()static intgetLogSize()static intgetLogSizeWithoutPrefixes()static java.util.ArrayList<java.lang.String>getOracleChoice()static java.util.ArrayList<HasseDiagram>getPartialLanguage()static int[]getPartialLanguageDistribution()static intgetPartialLanguageSize()static org.processmining.models.graphbased.directed.petrinet.elements.TransitiongetTransition(org.processmining.models.graphbased.directed.petrinet.Petrinet petriNet, java.lang.String label)Searching a transition which is equal to a given label in a given petriNetstatic org.deckfour.xes.extension.std.XConceptExtensiongetXconcept()static org.deckfour.xes.extension.std.XCostExtensiongetXcost()static org.deckfour.xes.extension.std.XLifecycleExtensiongetXlifecycle()static voidinitInstances()this initialize several instances from the XES standardstatic booleanisDebug()static booleanisEnabled(org.processmining.models.graphbased.directed.petrinet.elements.Transition transition, org.processmining.models.semantics.petrinet.Marking marking, org.processmining.models.graphbased.directed.petrinet.Petrinet petriNet)shows up, if a marking contains a placestatic booleanisEqual(Region region1, Region region2)Checks if a region is equal to another onestatic booleanisSubset(Region subsetRegion, Region supersetRegion)Checks if a region is a subset of another onestatic booleannoNextStateSelectedYet(Event event, int coSet, Region region)checks if no nextState was selected in a region of the event in the cosetstatic booleannoPreviousStateSelectedYet(Event event, int coSet, Region region)checks if no previousState was selected in a region of the event in the cosetstatic voidsetConcurrent(java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> concurrent)static voidsetDebug(boolean debug)static voidsetLanguage(java.util.ArrayList<java.util.ArrayList<java.lang.String>> language)static voidsetLanguageDistribution(int[] languageDistribution)static voidsetLanguageSize(int languageSize)static voidsetLogSize(int logSize)static voidsetLogSizeWithoutPrefixes(int logSizeWithoutPrefixes)static voidsetOracleChoice(java.util.ArrayList<java.lang.String> oracleChoice)static voidsetPartialLanguage(java.util.ArrayList<HasseDiagram> partialLanguage)static voidsetPartialLanguageDistribution(int[] partialLanguageDistribution)static voidsetPartialLanguageSize(int partialLanguageSize)static voidsetXconcept(org.deckfour.xes.extension.std.XConceptExtension xconcept)static voidsetXcost(org.deckfour.xes.extension.std.XCostExtension xcost)static voidsetXlifecycle(org.deckfour.xes.extension.std.XLifecycleExtension xlifecycle)static org.processmining.models.graphbased.directed.petrinet.Petrinetsynthesize(org.processmining.framework.plugin.PluginContext context, PrimeEventStructure pes)STEP 5: Synthesize the workflow modelstatic java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>>useConcurrencyOracle(java.lang.String oracle, java.util.ArrayList<java.util.ArrayList<java.lang.String>> language)STEP 2: Base Method: Use the concurrency oracle to detect concurrent elements In this case selectedOracle can be (LaterThan,) Life cycle, Alpha or None.static java.lang.Stringwrite(java.util.ArrayList<java.lang.String> manyStrings)This concatenate a string from an ArrayList of Strings
-
-
-
Method Detail
-
detectOracles
public static java.util.ArrayList<java.lang.String> detectOracles(org.deckfour.xes.model.XLog log)
Returns an ArrayList of Strings that contains all Oracles detected in the log. Supported Oracles are ("later-than",) "lifecycle", "alpha" and "none". First we pull out every trace from the log. For each trace the events are pulled out. With each event we are looking for informations that fit to an oracle. this method is similar to the check from the EVE Algorithm- Parameters:
log- the given log-File, imported from User in PROM-Tool- Returns:
- a list of detected Oracles in the log
-
calcLanguage
public static java.util.ArrayList<java.util.ArrayList<java.lang.String>> calcLanguage(org.deckfour.xes.model.XLog log)
STEP 1: Calculate Language of an Event Log A language is based on words. Each trace which is added to the language represents a word. A trace contains several events. These events contains a name (maybe a transition, cost informations)- Parameters:
log- the given log-File, imported from User in PROM-Tool- Returns:
- calculated language from the given log with traces as words (composed of events) The language is an ArrayList which contains several ArrayLists of strings
-
useConcurrencyOracle
public static java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> useConcurrencyOracle(java.lang.String oracle, java.util.ArrayList<java.util.ArrayList<java.lang.String>> language)STEP 2: Base Method: Use the concurrency oracle to detect concurrent elements In this case selectedOracle can be (LaterThan,) Life cycle, Alpha or None. This method builds the starting point for the calculation of concurrent actions. Calls printConcurrentActions for output the concurrency relationships before return.- Parameters:
oracle- the selected oracle (by user or default)language- the calculated language from log with method calcLanguage(XLog log)- Returns:
- elements with concurrency relationships
-
calcConcurrentLaterThan
public static java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> calcConcurrentLaterThan(java.util.ArrayList<java.util.ArrayList<java.lang.String>> language)
STEP 2: LATER-THAN: Use the concurrency oracle "later-than" to detect concurrent elements- Parameters:
language- the calculated language from log with method calcLanguage(XLog log)- Returns:
- elements with concurrency relationships
-
calcConcurrentLifecycle
public static java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> calcConcurrentLifecycle(java.util.ArrayList<java.util.ArrayList<java.lang.String>> language)
STEP 2: LIFECYCLE: Use the concurrency oracle "lifecycle" to detect concurrent elements- Parameters:
language- the calculated language from log with method calcLanguage(XLog log)- Returns:
- elements with concurrency relationships
-
calcConcurrentAlpha
public static java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> calcConcurrentAlpha(java.util.ArrayList<java.util.ArrayList<java.lang.String>> language)
STEP 2: ALPHA: Use the concurrency oracle "alpha" to detect concurrent elements- Parameters:
language- the calculated language from log with method calcLanguage(XLog log)- Returns:
- elements with concurrency relationships
-
calcConcurrentNone
public static java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> calcConcurrentNone(java.util.ArrayList<java.util.ArrayList<java.lang.String>> language)
STEP 2: (NONE) Determine a concurrency relationship without an oracle- Parameters:
language- the calculated language from log with method calcLanguage(XLog log)- Returns:
- elements with concurrency relationships
-
calcPartialLanguage
public static java.util.ArrayList<HasseDiagram> calcPartialLanguage(java.util.ArrayList<java.util.ArrayList<java.lang.String>> language, java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> concurrent)
STEP 3: Folding language with concurrency to a partial language- Parameters:
language- the calculated language from log with method calcLanguage(XLog log)concurrent- the concurrent, calculated from previous steps like later-than, lifecycle, alpha- Returns:
- the partial language
-
establishHasseDiagrams
public static org.processmining.acceptingpetrinet.models.AcceptingPetriNetArray establishHasseDiagrams(java.util.ArrayList<HasseDiagram> partialLanguage, int consideredHasses, boolean isShowHasse, org.processmining.framework.plugin.PluginContext context, org.processmining.acceptingpetrinet.models.impl.AcceptingPetriNetFactory acceptingPetriNetFactory, org.processmining.acceptingpetrinet.models.AcceptingPetriNetArray acceptingPetriNetArray, org.processmining.acceptingpetrinet.models.AcceptingPetriNetArray singleSolutionPetriNetArray)
STEP 3: establish the hasse diagrams and calls the methods of STEP 4 and STEP 5 while running- Parameters:
partialLanguage- the partial Language from the previous step of folding the languageconsideredHasses- the maximum amount hasse which should considered and also the max runs the algorithm should doisShowHasse- boolean value; true stands for: show me the hasses; false means: mine the petrinetcontext- the plugin contextacceptingPetriNetFactory- the factory for acceptingpetrinetsacceptingPetriNetArray- an acceptingpetrinet arraysingleSolutionPetriNetArray- if oneSolution is true, only one petry net will store in this array to return- Returns:
- the workflow model as petrinet array
-
synthesize
public static org.processmining.models.graphbased.directed.petrinet.Petrinet synthesize(org.processmining.framework.plugin.PluginContext context, PrimeEventStructure pes)STEP 5: Synthesize the workflow model- Parameters:
context- the PluginContextpes- a given PrimeEventStructure- Returns:
- the workflow model as petrinet
-
write
public static java.lang.String write(java.util.ArrayList<java.lang.String> manyStrings)
This concatenate a string from an ArrayList of Strings- Parameters:
manyStrings- some Strings to concatenate- Returns:
- a concatenated string
-
isEqual
public static boolean isEqual(Region region1, Region region2)
Checks if a region is equal to another one- Parameters:
region1- first regionregion2- second region- Returns:
- whether two regions are equal
-
isSubset
public static boolean isSubset(Region subsetRegion, Region supersetRegion)
Checks if a region is a subset of another one- Parameters:
subsetRegion- the suspected subset regionsupersetRegion- the super region- Returns:
- whether a suspected subset region is a subset region
-
getAllLabels
public static java.util.ArrayList<java.lang.String> getAllLabels(PrimeEventStructure pes)
Collect all labels of a given PrimeEventStructure- Parameters:
pes- the given PrimeEventStructure- Returns:
- all labels of a given PrimeEventStructure
-
getAllEventsWithLabel
public static java.util.ArrayList<Event> getAllEventsWithLabel(PrimeEventStructure pes, java.lang.String label)
Searches all events in a PrimeEventStructure with this label- Parameters:
pes- a given PrimeEventStructurelabel- a given label- Returns:
- all events which are equal to the given label
-
getTransition
public static org.processmining.models.graphbased.directed.petrinet.elements.Transition getTransition(org.processmining.models.graphbased.directed.petrinet.Petrinet petriNet, java.lang.String label)Searching a transition which is equal to a given label in a given petriNet- Parameters:
petriNet- the given petriNetlabel- the given label- Returns:
- a transition with a lebel equal to given label
-
arrayToString
public static java.lang.String arrayToString(int[] array)
Converts an array of ints into a String- Parameters:
array- a given array with ints- Returns:
- a concatenated string with elements of the array
-
buildPetriNet
public static org.processmining.models.graphbased.directed.petrinet.Petrinet buildPetriNet()
- Returns:
- a built petriNet with label Test
-
calculateSwitchingRegions
public static java.util.ArrayList<Region> calculateSwitchingRegions(PrimeEventStructure pes)
calculates an switching region- Parameters:
pes- a given PrimeEventStructure- Returns:
- an switching region
-
calculateExcitationRegions
public static java.util.ArrayList<Region> calculateExcitationRegions(PrimeEventStructure pes)
calculates an excitation region- Parameters:
pes- a given PrimeEventStructure- Returns:
- an excitation region
-
buildInitialRegions
public static java.util.ArrayList<Region> buildInitialRegions(java.util.ArrayList<Region> switchingRegions, java.util.ArrayList<Region> excitationRegions)
Builds a Set of regions from the sets of switching and excitation region and avoid the availability of double regions- Parameters:
switchingRegions- the switching regionsexcitationRegions- the excitation regions- Returns:
- a set of regions
-
noNextStateSelectedYet
public static boolean noNextStateSelectedYet(Event event, int coSet, Region region)
checks if no nextState was selected in a region of the event in the coset- Parameters:
event- an eventcoSet- the cosetregion- the region of the event- Returns:
- whether nextState is selected
-
noPreviousStateSelectedYet
public static boolean noPreviousStateSelectedYet(Event event, int coSet, Region region)
checks if no previousState was selected in a region of the event in the coset- Parameters:
event- an eventcoSet- the cosetregion- the region of the event- Returns:
- whether previousState is selected
-
addStatesToPES
public static void addStatesToPES(PrimeEventStructure pes)
iterates over all events and add states- Parameters:
pes- a PrimeEventStructure to iterate
-
createStatsForDialog
public static org.processmining.acceptingpetrinet.models.AcceptingPetriNetArray createStatsForDialog(org.processmining.acceptingpetrinet.models.AcceptingPetriNetArray acceptingPetriNetArray, java.util.ArrayList<java.util.ArrayList<java.lang.String>> language, java.lang.Boolean isShowHasse)This creates some final statistic data of the originally third dialog- Parameters:
acceptingPetriNetArray- an acceptingPetriNetArray created by a factorylanguage- the language given from previous methosisShowHasse- should the plugin show the hasse diagrams (true) or mine the petrinet (false)- Returns:
- the accepting petrinet array
-
isEnabled
public static boolean isEnabled(org.processmining.models.graphbased.directed.petrinet.elements.Transition transition, org.processmining.models.semantics.petrinet.Marking marking, org.processmining.models.graphbased.directed.petrinet.Petrinet petriNet)shows up, if a marking contains a place- Parameters:
transition- a transitionmarking- a markingpetriNet- a petriNet on which the arc should exists- Returns:
- whether a marking is enabled
-
fire
public static void fire(org.processmining.models.graphbased.directed.petrinet.elements.Transition transition, org.processmining.models.semantics.petrinet.Marking marking, org.processmining.models.graphbased.directed.petrinet.Petrinet petriNet)fire- Parameters:
transition- a transitionmarking- the markingpetriNet- the petriNet to interact with
-
initInstances
public static void initInstances()
this initialize several instances from the XES standard
-
getPartialLanguageDistribution
public static int[] getPartialLanguageDistribution()
- Returns:
- the distribution of the partial language
-
setPartialLanguageDistribution
public static void setPartialLanguageDistribution(int[] partialLanguageDistribution)
- Parameters:
partialLanguageDistribution- set the distribution of the partial language
-
getPartialLanguageSize
public static int getPartialLanguageSize()
- Returns:
- the partial language size
-
setPartialLanguageSize
public static void setPartialLanguageSize(int partialLanguageSize)
- Parameters:
partialLanguageSize- set the partial language size
-
getXconcept
public static org.deckfour.xes.extension.std.XConceptExtension getXconcept()
- Returns:
- the XConceptExtension
-
setXconcept
public static void setXconcept(org.deckfour.xes.extension.std.XConceptExtension xconcept)
- Parameters:
xconcept- set the XConceptExtension
-
getXlifecycle
public static org.deckfour.xes.extension.std.XLifecycleExtension getXlifecycle()
- Returns:
- the XLifecycleExtension
-
setXlifecycle
public static void setXlifecycle(org.deckfour.xes.extension.std.XLifecycleExtension xlifecycle)
- Parameters:
xlifecycle- set the XLifecycleExtension
-
getXcost
public static org.deckfour.xes.extension.std.XCostExtension getXcost()
- Returns:
- the XCostExtension
-
setXcost
public static void setXcost(org.deckfour.xes.extension.std.XCostExtension xcost)
- Parameters:
xcost- the XCostExtension
-
isDebug
public static boolean isDebug()
- Returns:
- if debug is true or false
-
setDebug
public static void setDebug(boolean debug)
- Parameters:
debug- set debug to true or false
-
getLogSize
public static int getLogSize()
- Returns:
- the size of the log
-
setLogSize
public static void setLogSize(int logSize)
- Parameters:
logSize- set size of the log
-
getLogSizeWithoutPrefixes
public static int getLogSizeWithoutPrefixes()
- Returns:
- the log size adjusted, without prefix
-
setLogSizeWithoutPrefixes
public static void setLogSizeWithoutPrefixes(int logSizeWithoutPrefixes)
- Parameters:
logSizeWithoutPrefixes- set the log size adjusted, without prefix
-
getLanguageSize
public static int getLanguageSize()
- Returns:
- the language size
-
setLanguageSize
public static void setLanguageSize(int languageSize)
- Parameters:
languageSize- set the language size
-
getLanguageDistribution
public static int[] getLanguageDistribution()
- Returns:
- the distribution of the language
-
setLanguageDistribution
public static void setLanguageDistribution(int[] languageDistribution)
- Parameters:
languageDistribution- set the distribution of the language
-
getOracleChoice
public static java.util.ArrayList<java.lang.String> getOracleChoice()
- Returns:
- the selected oracle
-
setOracleChoice
public static void setOracleChoice(java.util.ArrayList<java.lang.String> oracleChoice)
- Parameters:
oracleChoice- set the selected oracle
-
getConcurrent
public static java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> getConcurrent()
- Returns:
- the concurrency which are detected by an oracle
-
setConcurrent
public static void setConcurrent(java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> concurrent)
- Parameters:
concurrent- the concurrency which are detected by an oracle
-
getPartialLanguage
public static java.util.ArrayList<HasseDiagram> getPartialLanguage()
- Returns:
- the partial language
-
setPartialLanguage
public static void setPartialLanguage(java.util.ArrayList<HasseDiagram> partialLanguage)
- Parameters:
partialLanguage- set the partial language
-
getLanguage
public static java.util.ArrayList<java.util.ArrayList<java.lang.String>> getLanguage()
- Returns:
- the language extracted from the log
-
setLanguage
public static void setLanguage(java.util.ArrayList<java.util.ArrayList<java.lang.String>> language)
- Parameters:
language- set the language
-
-