Class StochasticNetUtils


  • public class StochasticNetUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void cacheFinalMarking​(org.processmining.models.graphbased.directed.petrinet.PetrinetGraph net, org.processmining.models.semantics.petrinet.Marking finalMarking)  
      static void cacheInitialMarking​(org.processmining.models.graphbased.directed.petrinet.PetrinetGraph net, org.processmining.models.semantics.petrinet.Marking initialMarking)  
      static org.deckfour.xes.model.XLog cloneLog​(org.deckfour.xes.model.XLog log)  
      static <E extends java.lang.Comparable<E>>
      int
      compareSortedSets​(java.util.SortedSet<E> first, java.util.SortedSet<E> second)  
      static StochasticNet convertToGSPN​(StochasticNet spn)  
      static StochasticNet convertToNormal​(StochasticNet spn)  
      static java.lang.String debugTrace​(org.deckfour.xes.model.XTrace trace)  
      static java.lang.String debugTrace​(org.deckfour.xes.model.XTrace trace, boolean bareEventsOnly)  
      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
      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.
      static org.deckfour.xes.model.XLog flattenLifecycles​(org.deckfour.xes.model.XLog log)  
      static java.lang.String formatMillisToHumanReadableTime​(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.String getActivityName​(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.Marking getDefaultInitialMarking​(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.PluginContext getDummyConsoleProgressContext()  
      static org.processmining.contexts.uitopia.UIPluginContext getDummyUIContext()  
      static org.apache.commons.math3.stat.descriptive.DescriptiveStatistics getDurationsStats​(org.deckfour.xes.model.XLog log)  
      static <E> double getEntropy​(java.util.Map<E,​java.lang.Double> probs)
      Computes entropy of a discrete probability distribution.
      static org.processmining.plugins.connectionfactories.logpetrinet.TransEvClassMapping getEvClassMapping​(org.processmining.models.graphbased.directed.petrinet.PetrinetGraph sNet, org.deckfour.xes.model.XLog log)  
      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
      static org.processmining.models.semantics.petrinet.Marking getFinalMarking​(org.processmining.framework.plugin.PluginContext context, org.processmining.models.graphbased.directed.petrinet.PetrinetGraph petriNet)  
      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
      static double getFiringRate​(org.processmining.models.graphbased.directed.petrinet.elements.Transition transition)  
      static int getIndexBinarySearch​(double[] sortedValues, double valueToSearchFor)  
      static int getIndexBinarySearch​(long[] sortedValues, long valueToSearchFor)  
      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
      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
      static double getLogProbability​(org.deckfour.xes.model.XTrace trace)
      Retrieves the log-probability of a trace that is stored in its attributes.
      static double getMean​(java.util.Collection<? extends java.lang.Number> values)  
      static double getMeanDuration​(org.deckfour.xes.model.XLog log)
      Gets the mean duration of all the traces in the log in milliseconds
      static double getMeanDuration​(StochasticNet net, org.processmining.models.semantics.petrinet.Marking initialMarking)
      Gets the mean duration of the model by a simple simulation.
      static java.util.Date getMinimalDate​(org.deckfour.xes.model.XTrace trace)  
      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)  
      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)
      static double getRandomDouble()  
      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);
      static int getRandomIndex_old​(double[] weights, java.util.Random random)  
      static int getRandomInt​(int n)  
      static java.lang.Long getReachableStateSpaceSize​(org.processmining.models.graphbased.directed.petrinet.Petrinet net)  
      static java.lang.Long getReachableStateSpaceSize​(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 Net
      static org.deckfour.xes.model.XLog getSortedLog​(org.deckfour.xes.model.XLog unsortedLog)  
      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.
      static java.util.Date getTraceDate​(org.deckfour.xes.model.XEvent event)
      Extracts the date of an event
      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.
      static double getUpperBoundDuration​(StochasticNet net, org.processmining.models.semantics.petrinet.Marking initialMarking)  
      static double getWeight​(org.processmining.models.graphbased.directed.petrinet.elements.Transition transition)
      Returns the weight of a transition.
      static javax.swing.JLabel linkify​(java.lang.String text, java.lang.String url, java.lang.String toolTip)
      Creates a JLabel acting as a clickable link code from http://stackoverflow.com/questions/527719/how-to-add-hyperlink-in-jlabel
      static java.lang.String printDistribution​(org.apache.commons.math3.distribution.RealDistribution distribution)  
      static org.deckfour.xes.model.XLog removeUnderScores​(org.deckfour.xes.model.XLog log)  
      static org.deckfour.xes.model.XLog renameLog​(org.deckfour.xes.model.XLog log, StochasticNetUtils.Renamer renamer)  
      static org.deckfour.xes.model.XLog replaceUnderscores​(org.deckfour.xes.model.XLog log)  
      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.
      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)  
      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 double sampleWithConstraint​(org.apache.commons.math3.distribution.RealDistribution distribution, java.lang.String cacheLabel, double positiveConstraint)
      Samples a value from the distribution
      static double sampleWithConstraint​(TimedTransition transition, double positiveConstraint)
      Samples a value from the distribution of a timed transition
      static void setCacheEnabled​(boolean enabled)  
      static void setRandomSeed​(long seed)  
      static boolean splinesSupported()
      Checks, whether the R-engine is accessible over JRI
      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)  
      static java.lang.String toLoLaFromPetrinet​(org.processmining.models.graphbased.directed.petrinet.Petrinet net, org.processmining.models.semantics.petrinet.Marking marking)  
      static java.lang.String toLoLaFromPetrinnet​(org.processmining.models.graphbased.directed.petrinet.Petrinet net)  
      static void updateLogProbability​(org.deckfour.xes.model.XTrace trace, double logProbability)
      The log of probability values is always less than or equal to zero.
      static void useCache​(boolean useCache)
      Enables or disables cache of distributions.
      static boolean writeLogToFile​(org.deckfour.xes.model.XLog log, java.io.File file)  
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StochasticNetUtils

        public StochasticNetUtils()
    • 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 - TimedTransition
        positiveConstraint - 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 - RealDistribution sampling distribution
        cacheLabel - String denoting the key for this distribution to be cached
        positiveConstraint - 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 partitioned
        kFoldCount - the fold count
        k - the iteration number
        returnModulo - 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 events
        timeUntil - 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 a PNRepResult replay result, or converts that into a Manifest (parameter getManifest)
        Parameters:
        net - the Petri net that captures the execution possibilities
        log - the Log that contains time information (time stamps) for performance analysis
        getManifest -
        addSmallDeltaCosts - specifies, if a small cost should be added to increase the cost of uncommon transitions (favors alignment containing more frequent activities)
        Returns:
        PNRepResult or Manifest, 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 - TransClass
        net - Petri net graph PetrinetGraph
        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 a JLabel acting as a clickable link code from http://stackoverflow.com/questions/527719/how-to-add-hyperlink-in-jlabel
        Parameters:
        text - the title / content of the link
        url - the URL that will be opened in the system browser
        toolTip - 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 context
        net - 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 - Petrinet to export
        relativeFolderName - 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 - XTrace trace 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.InterruptedException
        java.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.InterruptedException
        java.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 QualityCriterion to (mostly) Double
      • getDummyUIContext

        public static org.processmining.contexts.uitopia.UIPluginContext getDummyUIContext()
      • getDummyConsoleProgressContext

        public static org.processmining.framework.plugin.PluginContext getDummyConsoleProgressContext()