Class StochasticNetUtils
- java.lang.Object
-
- org.processmining.plugins.stochasticpetrinet.StochasticNetUtils
-
public class StochasticNetUtils extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStochasticNetUtils.DummyConnectionManagerstatic classStochasticNetUtils.DummyConsolePluginContextstatic classStochasticNetUtils.FakePluginContextCreated by andreas on 25/01/2017.static interfaceStochasticNetUtils.Renamer
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringGENERALIZATION_MEASUREstatic java.lang.StringITERATION_KEYstatic java.lang.StringPRECISION_MEASUREstatic java.lang.StringSEPARATOR_STRINGstatic java.lang.StringTIME_ATTRIBUTE_KEY
-
Constructor Summary
Constructors Constructor Description StochasticNetUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcacheFinalMarking(org.processmining.models.graphbased.directed.petrinet.PetrinetGraph net, org.processmining.models.semantics.petrinet.Marking finalMarking)static voidcacheInitialMarking(org.processmining.models.graphbased.directed.petrinet.PetrinetGraph net, org.processmining.models.semantics.petrinet.Marking initialMarking)static org.deckfour.xes.model.XLogcloneLog(org.deckfour.xes.model.XLog log)static <E extends java.lang.Comparable<E>>
intcompareSortedSets(java.util.SortedSet<E> first, java.util.SortedSet<E> second)static StochasticNetconvertToGSPN(StochasticNet spn)static StochasticNetconvertToNormal(StochasticNet spn)static java.lang.StringdebugTrace(org.deckfour.xes.model.XTrace trace)static java.lang.StringdebugTrace(org.deckfour.xes.model.XTrace trace, boolean bareEventsOnly)static voidexportAsDOTFile(org.processmining.models.graphbased.directed.petrinet.Petrinet net, java.lang.String relativeFolderName, java.lang.String fileName)Exports a stochastic net as astatic org.deckfour.xes.model.XLogfilterTracesBasedOnModulo(org.deckfour.xes.model.XLog log, int kFoldCount, int k, boolean returnModulo)Filter traces based on modulo Idea is to split log in two disjoint sets: the training set and the test set.static org.deckfour.xes.model.XLogflattenLifecycles(org.deckfour.xes.model.XLog log)static java.lang.StringformatMillisToHumanReadableTime(long millis)static <T> java.util.Set<java.util.Set<T>>generateAllSubsets(java.util.Set<T> original)Generates all subsets of a set.static <T> java.util.Set<java.util.Set<T>>generateAllSubsetsOfSize(java.util.Set<T> original, int minSize, int maxSize)static <T> java.util.Set<java.util.Set<T>>generateCrossProduct(java.util.Set<java.util.Set<T>> setA, java.util.Set<java.util.Set<T>> setB)static java.lang.StringgetActivityName(org.deckfour.xes.classification.XEventClass eClass)static double[]getAsDoubleArray(java.util.Collection<java.lang.Double> values)static org.processmining.framework.util.Pair<java.lang.Long,java.lang.Long>getBufferedTraceBounds(org.deckfour.xes.model.XTrace trace)static org.processmining.framework.util.Pair<java.lang.Long,java.lang.Long>getBufferedTraceBounds(org.deckfour.xes.model.XTrace trace, long buffer)static org.processmining.models.semantics.petrinet.MarkinggetDefaultInitialMarking(org.processmining.models.graphbased.directed.petrinet.PetrinetGraph petriNet)static java.util.Map<QualityCriterion,java.lang.Object>getDistance(org.processmining.framework.plugin.PluginContext context, org.processmining.ptconversions.pn.ProcessTree2Petrinet.PetrinetWithMarkings petriNet, org.deckfour.xes.model.XLog log)static java.util.Map<QualityCriterion,java.lang.Object>getDistance(org.processmining.ptconversions.pn.ProcessTree2Petrinet.PetrinetWithMarkings petriNet, org.deckfour.xes.model.XLog log)Aligns the petri net to a log and return the distance.static org.processmining.framework.plugin.PluginContextgetDummyConsoleProgressContext()static org.processmining.contexts.uitopia.UIPluginContextgetDummyUIContext()static org.apache.commons.math3.stat.descriptive.DescriptiveStatisticsgetDurationsStats(org.deckfour.xes.model.XLog log)static <E> doublegetEntropy(java.util.Map<E,java.lang.Double> probs)Computes entropy of a discrete probability distribution.static org.processmining.plugins.connectionfactories.logpetrinet.TransEvClassMappinggetEvClassMapping(org.processmining.models.graphbased.directed.petrinet.PetrinetGraph sNet, org.deckfour.xes.model.XLog log)static org.processmining.plugins.connectionfactories.logpetrinet.TransEvClassMappinggetEvClassMapping(org.processmining.models.graphbased.directed.petrinet.PetrinetGraph sNet, org.deckfour.xes.model.XLog log, org.deckfour.xes.classification.XEventClassifier classifier)Gets a very simple mapping based on the naming of activitiesstatic org.processmining.models.semantics.petrinet.MarkinggetFinalMarking(org.processmining.framework.plugin.PluginContext context, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph petriNet)static org.processmining.models.semantics.petrinet.MarkinggetFinalMarking(org.processmining.framework.plugin.PluginContext context, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph petriNet, boolean useCache)Gets the final marking that is associated with the Petri Netstatic doublegetFiringRate(org.processmining.models.graphbased.directed.petrinet.elements.Transition transition)static intgetIndexBinarySearch(double[] sortedValues, double valueToSearchFor)static intgetIndexBinarySearch(long[] sortedValues, long valueToSearchFor)static org.processmining.models.semantics.petrinet.MarkinggetInitialMarking(org.processmining.framework.plugin.PluginContext context, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph petriNet)Gets the initial marking, that is associated with the Petri Net Uses a cache to not bother with connections on multiple callsstatic org.processmining.models.semantics.petrinet.MarkinggetInitialMarking(org.processmining.framework.plugin.PluginContext context, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph petriNet, boolean useCache)Gets the initial marking, that is associated with the Petri Netstatic doublegetLogProbability(org.deckfour.xes.model.XTrace trace)Retrieves the log-probability of a trace that is stored in its attributes.static doublegetMean(java.util.Collection<? extends java.lang.Number> values)static doublegetMeanDuration(org.deckfour.xes.model.XLog log)Gets the mean duration of all the traces in the log in millisecondsstatic doublegetMeanDuration(StochasticNet net, org.processmining.models.semantics.petrinet.Marking initialMarking)Gets the mean duration of the model by a simple simulation.static java.util.DategetMinimalDate(org.deckfour.xes.model.XTrace trace)static org.processmining.plugins.petrinet.manifestreplayer.PNManifestReplayerParametergetParameters(org.deckfour.xes.model.XLog originalTrace, org.processmining.plugins.connectionfactories.logpetrinet.TransEvClassMapping mapping, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph net, org.processmining.models.semantics.petrinet.Marking initialMarking, org.processmining.models.semantics.petrinet.Marking finalMarking, org.deckfour.xes.classification.XEventClassifier classifier, org.processmining.plugins.petrinet.manifestreplayer.transclassifier.TransClasses transClasses)static org.processmining.models.graphbased.directed.petrinet.PetrinetgetPlainNet(org.processmining.contexts.uitopia.UIPluginContext context, org.processmining.models.graphbased.directed.petrinet.Petrinet net)Converts any advanced Petri net into a plain net -> (useful for stochastic nets, especially)static doublegetRandomDouble()static intgetRandomIndex(double[] weights, java.util.Random random)Takes a double[] of weights and selects an item randomly according to a random number generator such that each item in the array has a probability of (weight of item / sum of weights);static intgetRandomIndex_old(double[] weights, java.util.Random random)static intgetRandomInt(int n)static java.lang.LonggetReachableStateSpaceSize(org.processmining.models.graphbased.directed.petrinet.Petrinet net)static java.lang.LonggetReachableStateSpaceSize(org.processmining.models.graphbased.directed.petrinet.Petrinet net, org.processmining.models.semantics.petrinet.Marking marking)static org.processmining.models.semantics.Semantics<org.processmining.models.semantics.petrinet.Marking,org.processmining.models.graphbased.directed.petrinet.elements.Transition>getSemantics(org.processmining.models.graphbased.directed.petrinet.PetrinetGraph petriNet)Gets a regular semantic for a Petri Netstatic org.deckfour.xes.model.XLoggetSortedLog(org.deckfour.xes.model.XLog unsortedLog)static org.deckfour.xes.model.XTracegetSubTrace(org.deckfour.xes.model.XTrace trace, long timeUntil)This method extracts the portion of the trace that has happened before the timeUntil parameter.static java.util.DategetTraceDate(org.deckfour.xes.model.XEvent event)Extracts the date of an eventstatic booleangetTransitionClassIsInvisible(org.processmining.plugins.petrinet.manifestreplayer.transclassifier.TransClass tc, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph net)Checks whether at least one of the transitions of the transition class are invisible.static doublegetUpperBoundDuration(StochasticNet net, org.processmining.models.semantics.petrinet.Marking initialMarking)static doublegetWeight(org.processmining.models.graphbased.directed.petrinet.elements.Transition transition)Returns the weight of a transition.static javax.swing.JLabellinkify(java.lang.String text, java.lang.String url, java.lang.String toolTip)Creates aJLabelacting as a clickable link code from http://stackoverflow.com/questions/527719/how-to-add-hyperlink-in-jlabelstatic java.lang.StringprintDistribution(org.apache.commons.math3.distribution.RealDistribution distribution)static org.deckfour.xes.model.XLogremoveUnderScores(org.deckfour.xes.model.XLog log)static org.deckfour.xes.model.XLogrenameLog(org.deckfour.xes.model.XLog log, StochasticNetUtils.Renamer renamer)static org.deckfour.xes.model.XLogreplaceUnderscores(org.deckfour.xes.model.XLog log)static java.lang.ObjectreplayLog(org.processmining.framework.plugin.PluginContext context, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph net, org.deckfour.xes.model.XLog log, boolean getManifest, boolean addSmallDeltaCosts)Replays a log on a model based on selected parameters.static java.lang.ObjectreplayLog(org.processmining.framework.plugin.PluginContext context, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph net, org.deckfour.xes.model.XLog log, org.processmining.plugins.petrinet.manifestreplayer.PNManifestReplayerParameter parameters, boolean getManifest)protected static org.processmining.framework.util.Pair<org.processmining.plugins.petrinet.replayresult.PNRepResult,org.processmining.plugins.astar.petrinet.manifestreplay.PNManifestFlattener>replayLogWithMapping(org.deckfour.xes.model.XLog originalTrace, org.processmining.plugins.connectionfactories.logpetrinet.TransEvClassMapping mapping, org.processmining.models.graphbased.directed.petrinet.Petrinet net, org.processmining.models.semantics.petrinet.Marking initialMarking, org.processmining.models.semantics.petrinet.Marking finalMarking, org.deckfour.xes.classification.XEventClassifier classifier)static org.processmining.framework.util.Pair<org.processmining.plugins.replayer.replayresult.SyncReplayResult,org.processmining.plugins.astar.petrinet.manifestreplay.PNManifestFlattener>replayTrace(org.deckfour.xes.model.XLog originalTrace, org.processmining.plugins.connectionfactories.logpetrinet.TransEvClassMapping mapping, org.processmining.models.graphbased.directed.petrinet.Petrinet net, org.processmining.models.semantics.petrinet.Marking initialMarking, org.processmining.models.semantics.petrinet.Marking finalMarking, org.deckfour.xes.classification.XEventClassifier classifier)static doublesampleWithConstraint(org.apache.commons.math3.distribution.RealDistribution distribution, java.lang.String cacheLabel, double positiveConstraint)Samples a value from the distributionstatic doublesampleWithConstraint(TimedTransition transition, double positiveConstraint)Samples a value from the distribution of a timed transitionstatic voidsetCacheEnabled(boolean enabled)static voidsetRandomSeed(long seed)static booleansplinesSupported()Checks, whether the R-engine is accessible over JRIstatic org.processmining.framework.util.Pair<org.deckfour.xes.model.XLog,org.deckfour.xes.model.XLog>splitTracesBasedOnRatio(org.deckfour.xes.model.XLog log, double ratio)static java.lang.StringtoLoLaFromPetrinet(org.processmining.models.graphbased.directed.petrinet.Petrinet net, org.processmining.models.semantics.petrinet.Marking marking)static java.lang.StringtoLoLaFromPetrinnet(org.processmining.models.graphbased.directed.petrinet.Petrinet net)static voidupdateLogProbability(org.deckfour.xes.model.XTrace trace, double logProbability)The log of probability values is always less than or equal to zero.static voiduseCache(boolean useCache)Enables or disables cache of distributions.static booleanwriteLogToFile(org.deckfour.xes.model.XLog log, java.io.File file)static voidwriteStringToFile(java.lang.String string, java.lang.String fileName)Convenience utility function to write a string to a file specified by a file name.
-
-
-
Field Detail
-
ITERATION_KEY
public static final java.lang.String ITERATION_KEY
- See Also:
- Constant Field Values
-
TIME_ATTRIBUTE_KEY
public static final java.lang.String TIME_ATTRIBUTE_KEY
- See Also:
- Constant Field Values
-
PRECISION_MEASURE
public static final java.lang.String PRECISION_MEASURE
- See Also:
- Constant Field Values
-
GENERALIZATION_MEASURE
public static final java.lang.String GENERALIZATION_MEASURE
- See Also:
- Constant Field Values
-
SEPARATOR_STRING
public static final java.lang.String SEPARATOR_STRING
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRandomDouble
public static double getRandomDouble()
-
getRandomInt
public static int getRandomInt(int n)
-
setRandomSeed
public static void setRandomSeed(long seed)
-
setCacheEnabled
public static void setCacheEnabled(boolean enabled)
-
compareSortedSets
public static <E extends java.lang.Comparable<E>> int compareSortedSets(java.util.SortedSet<E> first, java.util.SortedSet<E> second)
-
getEntropy
public static <E> double getEntropy(java.util.Map<E,java.lang.Double> probs)
Computes entropy of a discrete probability distribution.- Parameters:
probs- a map assigning probabilities to objects. Note that probs.values() should sum to 1.- Returns:
- the entropy of the map.
-
getInitialMarking
public static org.processmining.models.semantics.petrinet.Marking getInitialMarking(org.processmining.framework.plugin.PluginContext context, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph petriNet)Gets the initial marking, that is associated with the Petri Net Uses a cache to not bother with connections on multiple calls- Parameters:
context-petriNet-- Returns:
-
getEvClassMapping
public static org.processmining.plugins.connectionfactories.logpetrinet.TransEvClassMapping getEvClassMapping(org.processmining.models.graphbased.directed.petrinet.PetrinetGraph sNet, org.deckfour.xes.model.XLog log)
-
getEvClassMapping
public static org.processmining.plugins.connectionfactories.logpetrinet.TransEvClassMapping getEvClassMapping(org.processmining.models.graphbased.directed.petrinet.PetrinetGraph sNet, org.deckfour.xes.model.XLog log, org.deckfour.xes.classification.XEventClassifier classifier)Gets a very simple mapping based on the naming of activities- Parameters:
sNet-log-- Returns:
-
getInitialMarking
public static org.processmining.models.semantics.petrinet.Marking getInitialMarking(org.processmining.framework.plugin.PluginContext context, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph petriNet, boolean useCache)Gets the initial marking, that is associated with the Petri Net- Parameters:
context-petriNet-useCache- indicates, whether markings should be cached, or not.- Returns:
-
getDefaultInitialMarking
public static org.processmining.models.semantics.petrinet.Marking getDefaultInitialMarking(org.processmining.models.graphbased.directed.petrinet.PetrinetGraph petriNet)
-
getFinalMarking
public static org.processmining.models.semantics.petrinet.Marking getFinalMarking(org.processmining.framework.plugin.PluginContext context, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph petriNet)
-
getFinalMarking
public static org.processmining.models.semantics.petrinet.Marking getFinalMarking(org.processmining.framework.plugin.PluginContext context, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph petriNet, boolean useCache)Gets the final marking that is associated with the Petri Net- Parameters:
context-petriNet-- Returns:
-
cacheFinalMarking
public static void cacheFinalMarking(org.processmining.models.graphbased.directed.petrinet.PetrinetGraph net, org.processmining.models.semantics.petrinet.Marking finalMarking)
-
cacheInitialMarking
public static void cacheInitialMarking(org.processmining.models.graphbased.directed.petrinet.PetrinetGraph net, org.processmining.models.semantics.petrinet.Marking initialMarking)
-
sampleWithConstraint
public static double sampleWithConstraint(TimedTransition transition, double positiveConstraint)
Samples a value from the distribution of a timed transition- Parameters:
transition-TimedTransitionpositiveConstraint- sample should be bigger than this value (results in truncated distribution)- Returns:
-
sampleWithConstraint
public static double sampleWithConstraint(org.apache.commons.math3.distribution.RealDistribution distribution, java.lang.String cacheLabel, double positiveConstraint)Samples a value from the distribution- Parameters:
distribution-RealDistributionsampling distributioncacheLabel- String denoting the key for this distribution to be cachedpositiveConstraint- sample should be bigger than this value (results in truncated distribution)- Returns:
-
getRandomIndex
public static int getRandomIndex(double[] weights, java.util.Random random)Takes a double[] of weights and selects an item randomly according to a random number generator such that each item in the array has a probability of (weight of item / sum of weights);- Parameters:
weights- double[] containing weights- Returns:
- index randomly chosen among the items
-
getRandomIndex_old
public static int getRandomIndex_old(double[] weights, java.util.Random random)
-
getSemantics
public static org.processmining.models.semantics.Semantics<org.processmining.models.semantics.petrinet.Marking,org.processmining.models.graphbased.directed.petrinet.elements.Transition> getSemantics(org.processmining.models.graphbased.directed.petrinet.PetrinetGraph petriNet)
Gets a regular semantic for a Petri Net- Parameters:
petriNet-- Returns:
-
filterTracesBasedOnModulo
public static org.deckfour.xes.model.XLog filterTracesBasedOnModulo(org.deckfour.xes.model.XLog log, int kFoldCount, int k, boolean returnModulo)Filter traces based on modulo Idea is to split log in two disjoint sets: the training set and the test set.- Parameters:
log- the log to be partitionedkFoldCount- the fold countk- the iteration numberreturnModulo- if true -> returns only the fraction, where the modulo by kFoldCount is k (for the test set) if false -> returns the rest, where the modulo by kFoldCount is not k (for the training set)- Returns:
-
splitTracesBasedOnRatio
public static org.processmining.framework.util.Pair<org.deckfour.xes.model.XLog,org.deckfour.xes.model.XLog> splitTracesBasedOnRatio(org.deckfour.xes.model.XLog log, double ratio)
-
generateAllSubsets
public static <T> java.util.Set<java.util.Set<T>> generateAllSubsets(java.util.Set<T> original)
Generates all subsets of a set.- Parameters:
original-- Returns:
-
generateAllSubsetsOfSize
public static <T> java.util.Set<java.util.Set<T>> generateAllSubsetsOfSize(java.util.Set<T> original, int minSize, int maxSize)
-
generateCrossProduct
public static <T> java.util.Set<java.util.Set<T>> generateCrossProduct(java.util.Set<java.util.Set<T>> setA, java.util.Set<java.util.Set<T>> setB)
-
getSubTrace
public static org.deckfour.xes.model.XTrace getSubTrace(org.deckfour.xes.model.XTrace trace, long timeUntil)This method extracts the portion of the trace that has happened before the timeUntil parameter.Assumption: The events in the trace are ordered incrementally by their time!
- Parameters:
trace- the original trace containing a number of eventstimeUntil- only events up to this point in time (inclusive) are added to the resulting sub-trace- Returns:
- the sub-trace with events filtered to be less or equal to timeUntil
-
getMeanDuration
public static double getMeanDuration(org.deckfour.xes.model.XLog log)
Gets the mean duration of all the traces in the log in milliseconds- Parameters:
log-- Returns:
-
getDurationsStats
public static org.apache.commons.math3.stat.descriptive.DescriptiveStatistics getDurationsStats(org.deckfour.xes.model.XLog log)
-
getMeanDuration
public static double getMeanDuration(StochasticNet net, org.processmining.models.semantics.petrinet.Marking initialMarking)
Gets the mean duration of the model by a simple simulation. TODO: Replace with analytical calculations, as for example done in the tool ORIS (www.oris-tool.org)- Parameters:
net-initialMarking-- Returns:
-
getUpperBoundDuration
public static double getUpperBoundDuration(StochasticNet net, org.processmining.models.semantics.petrinet.Marking initialMarking)
-
replayLog
public static java.lang.Object replayLog(org.processmining.framework.plugin.PluginContext context, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph net, org.deckfour.xes.model.XLog log, boolean getManifest, boolean addSmallDeltaCosts)Replays a log on a model based on selected parameters. Returns either aPNRepResultreplay result, or converts that into aManifest(parameter getManifest)- Parameters:
net- the Petri net that captures the execution possibilitieslog- the Log that contains time information (time stamps) for performance analysisgetManifest-addSmallDeltaCosts- specifies, if a small cost should be added to increase the cost of uncommon transitions (favors alignment containing more frequent activities)- Returns:
PNRepResultorManifest, depending on the flag getManifest.
-
replayTrace
public static org.processmining.framework.util.Pair<org.processmining.plugins.replayer.replayresult.SyncReplayResult,org.processmining.plugins.astar.petrinet.manifestreplay.PNManifestFlattener> replayTrace(org.deckfour.xes.model.XLog originalTrace, org.processmining.plugins.connectionfactories.logpetrinet.TransEvClassMapping mapping, org.processmining.models.graphbased.directed.petrinet.Petrinet net, org.processmining.models.semantics.petrinet.Marking initialMarking, org.processmining.models.semantics.petrinet.Marking finalMarking, org.deckfour.xes.classification.XEventClassifier classifier) throws java.lang.Exception- Throws:
java.lang.Exception
-
replayLogWithMapping
protected static org.processmining.framework.util.Pair<org.processmining.plugins.petrinet.replayresult.PNRepResult,org.processmining.plugins.astar.petrinet.manifestreplay.PNManifestFlattener> replayLogWithMapping(org.deckfour.xes.model.XLog originalTrace, org.processmining.plugins.connectionfactories.logpetrinet.TransEvClassMapping mapping, org.processmining.models.graphbased.directed.petrinet.Petrinet net, org.processmining.models.semantics.petrinet.Marking initialMarking, org.processmining.models.semantics.petrinet.Marking finalMarking, org.deckfour.xes.classification.XEventClassifier classifier)
-
debugTrace
public static java.lang.String debugTrace(org.deckfour.xes.model.XTrace trace)
-
debugTrace
public static java.lang.String debugTrace(org.deckfour.xes.model.XTrace trace, boolean bareEventsOnly)
-
replayLog
public static java.lang.Object replayLog(org.processmining.framework.plugin.PluginContext context, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph net, org.deckfour.xes.model.XLog log, org.processmining.plugins.petrinet.manifestreplayer.PNManifestReplayerParameter parameters, boolean getManifest)
-
getParameters
public static org.processmining.plugins.petrinet.manifestreplayer.PNManifestReplayerParameter getParameters(org.deckfour.xes.model.XLog originalTrace, org.processmining.plugins.connectionfactories.logpetrinet.TransEvClassMapping mapping, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph net, org.processmining.models.semantics.petrinet.Marking initialMarking, org.processmining.models.semantics.petrinet.Marking finalMarking, org.deckfour.xes.classification.XEventClassifier classifier, org.processmining.plugins.petrinet.manifestreplayer.transclassifier.TransClasses transClasses)
-
getTransitionClassIsInvisible
public static boolean getTransitionClassIsInvisible(org.processmining.plugins.petrinet.manifestreplayer.transclassifier.TransClass tc, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph net)Checks whether at least one of the transitions of the transition class are invisible.- Parameters:
tc-TransClassnet- Petri net graphPetrinetGraph- Returns:
-
splinesSupported
public static boolean splinesSupported()
Checks, whether the R-engine is accessible over JRI- Returns:
-
writeStringToFile
public static void writeStringToFile(java.lang.String string, java.lang.String fileName)Convenience utility function to write a string to a file specified by a file name.- Parameters:
string-fileName-
-
linkify
public static javax.swing.JLabel linkify(java.lang.String text, java.lang.String url, java.lang.String toolTip)Creates aJLabelacting as a clickable link code from http://stackoverflow.com/questions/527719/how-to-add-hyperlink-in-jlabel- Parameters:
text- the title / content of the linkurl- the URL that will be opened in the system browsertoolTip- the tooltip of the- Returns:
- a JLabel
-
getPlainNet
public static org.processmining.models.graphbased.directed.petrinet.Petrinet getPlainNet(org.processmining.contexts.uitopia.UIPluginContext context, org.processmining.models.graphbased.directed.petrinet.Petrinet net)Converts any advanced Petri net into a plain net -> (useful for stochastic nets, especially)- Parameters:
context- plugin contextnet- the net- Returns:
-
getAsDoubleArray
public static double[] getAsDoubleArray(java.util.Collection<java.lang.Double> values)
-
getIndexBinarySearch
public static int getIndexBinarySearch(double[] sortedValues, double valueToSearchFor)
-
getIndexBinarySearch
public static int getIndexBinarySearch(long[] sortedValues, long valueToSearchFor)
-
getBufferedTraceBounds
public static org.processmining.framework.util.Pair<java.lang.Long,java.lang.Long> getBufferedTraceBounds(org.deckfour.xes.model.XTrace trace)
-
getBufferedTraceBounds
public static org.processmining.framework.util.Pair<java.lang.Long,java.lang.Long> getBufferedTraceBounds(org.deckfour.xes.model.XTrace trace, long buffer)
-
useCache
public static void useCache(boolean useCache)
Enables or disables cache of distributions.- Parameters:
useCache-
-
convertToNormal
public static StochasticNet convertToNormal(StochasticNet spn)
- Parameters:
spn- a stochastic Petri net containing all kinds of timed distributions- Returns:
- a stochastic Petri net containing only immediate and normal distributions. Timed transitions of other distribution shape are replaced by normal approximations.
-
convertToGSPN
public static StochasticNet convertToGSPN(StochasticNet spn)
- Parameters:
spn- a stochastic Petri net containing all kinds of timed distributions- Returns:
- a stochastic Petri net containing only immediate and exponential distributions. Timed transitions of other distribution shape are replaced by exponential approximations.
-
exportAsDOTFile
public static void exportAsDOTFile(org.processmining.models.graphbased.directed.petrinet.Petrinet net, java.lang.String relativeFolderName, java.lang.String fileName)Exports a stochastic net as a- Parameters:
net-Petrinetto exportrelativeFolderName- String a relative folder name (e.g. "tests/testfiles/output")fileName- String a name for the output file (e.g. "myProcess") an extension to mark it as PostScript (".ps") will be appended.
-
getTraceDate
public static java.util.Date getTraceDate(org.deckfour.xes.model.XEvent event)
Extracts the date of an event- Parameters:
event-- Returns:
-
getMinimalDate
public static java.util.Date getMinimalDate(org.deckfour.xes.model.XTrace trace)
- Parameters:
trace-- Returns:
-
printDistribution
public static java.lang.String printDistribution(org.apache.commons.math3.distribution.RealDistribution distribution)
-
getMean
public static double getMean(java.util.Collection<? extends java.lang.Number> values)
-
updateLogProbability
public static void updateLogProbability(org.deckfour.xes.model.XTrace trace, double logProbability)The log of probability values is always less than or equal to zero. This method updates the probability of a trace by adding the log probabilities. That is, the probabilities get multiplied with each new event that occurred for the trace.- Parameters:
trace-XTracetrace that stores the log-probability value in an attribute.logProbability-
-
getLogProbability
public static double getLogProbability(org.deckfour.xes.model.XTrace trace)
Retrieves the log-probability of a trace that is stored in its attributes.- Parameters:
trace-- Returns:
-
getWeight
public static double getWeight(org.processmining.models.graphbased.directed.petrinet.elements.Transition transition)
Returns the weight of a transition. By default a transition has a weight of one.- Parameters:
transition-- Returns:
-
getFiringRate
public static double getFiringRate(org.processmining.models.graphbased.directed.petrinet.elements.Transition transition)
-
cloneLog
public static org.deckfour.xes.model.XLog cloneLog(org.deckfour.xes.model.XLog log)
-
getSortedLog
public static org.deckfour.xes.model.XLog getSortedLog(org.deckfour.xes.model.XLog unsortedLog)
-
flattenLifecycles
public static org.deckfour.xes.model.XLog flattenLifecycles(org.deckfour.xes.model.XLog log)
-
removeUnderScores
public static org.deckfour.xes.model.XLog removeUnderScores(org.deckfour.xes.model.XLog log)
-
replaceUnderscores
public static org.deckfour.xes.model.XLog replaceUnderscores(org.deckfour.xes.model.XLog log)
-
renameLog
public static org.deckfour.xes.model.XLog renameLog(org.deckfour.xes.model.XLog log, StochasticNetUtils.Renamer renamer)
-
formatMillisToHumanReadableTime
public static java.lang.String formatMillisToHumanReadableTime(long millis)
-
toLoLaFromPetrinnet
public static java.lang.String toLoLaFromPetrinnet(org.processmining.models.graphbased.directed.petrinet.Petrinet net)
-
toLoLaFromPetrinet
public static java.lang.String toLoLaFromPetrinet(org.processmining.models.graphbased.directed.petrinet.Petrinet net, org.processmining.models.semantics.petrinet.Marking marking)
-
getReachableStateSpaceSize
public static java.lang.Long getReachableStateSpaceSize(org.processmining.models.graphbased.directed.petrinet.Petrinet net) throws java.lang.InterruptedException, java.io.IOException- Throws:
java.lang.InterruptedExceptionjava.io.IOException
-
getReachableStateSpaceSize
public static java.lang.Long getReachableStateSpaceSize(org.processmining.models.graphbased.directed.petrinet.Petrinet net, org.processmining.models.semantics.petrinet.Marking marking) throws java.lang.InterruptedException, java.io.IOException- Throws:
java.lang.InterruptedExceptionjava.io.IOException
-
writeLogToFile
public static boolean writeLogToFile(org.deckfour.xes.model.XLog log, java.io.File file)
-
getActivityName
public static java.lang.String getActivityName(org.deckfour.xes.classification.XEventClass eClass)
-
getDistance
public static java.util.Map<QualityCriterion,java.lang.Object> getDistance(org.processmining.framework.plugin.PluginContext context, org.processmining.ptconversions.pn.ProcessTree2Petrinet.PetrinetWithMarkings petriNet, org.deckfour.xes.model.XLog log)
-
getDistance
public static java.util.Map<QualityCriterion,java.lang.Object> getDistance(org.processmining.ptconversions.pn.ProcessTree2Petrinet.PetrinetWithMarkings petriNet, org.deckfour.xes.model.XLog log)
Aligns the petri net to a log and return the distance. TODO: incorporate further quality criteria!- Parameters:
petriNet-log-- Returns:
- Map of
QualityCriterionto (mostly) Double
-
getDummyUIContext
public static org.processmining.contexts.uitopia.UIPluginContext getDummyUIContext()
-
getDummyConsoleProgressContext
public static org.processmining.framework.plugin.PluginContext getDummyConsoleProgressContext()
-
-