Class AbstractTimePredictor

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static double ABS_ERROR_THRESHOLD  
      static double CONFIDENCE_INTERVAL
      the confidence interval to be used for estimating bounds on the predicted remaining duration
      static double ERROR_BOUND_PERCENT
      Simulation is allowed to stop, when relative error is below this value
      static int MAX_RUNS
      If we wanted to restrict the number of simulated runs, we could do it here
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected static void addAllEnabledTransitions​(org.processmining.models.semantics.Semantics<org.processmining.models.semantics.petrinet.Marking,​org.processmining.models.graphbased.directed.petrinet.elements.Transition> semantics, java.util.ArrayList<org.processmining.framework.util.Pair<org.processmining.models.semantics.petrinet.Marking,​org.processmining.models.graphbased.directed.petrinet.elements.Transition>> searchState)  
      java.lang.Double computeRiskToMissTargetTime​(StochasticNet model, org.deckfour.xes.model.XTrace observedEvents, java.util.Date currentTime, java.util.Date targetTime, org.processmining.models.semantics.petrinet.Marking initialMarking, boolean useOnlyPastTrainingData)
      Maximum likelihood estimate for the risk of missing a deadline until the end of the process.
      protected static void executeTransition​(org.processmining.models.semantics.Semantics<org.processmining.models.semantics.petrinet.Marking,​org.processmining.models.graphbased.directed.petrinet.elements.Transition> semantics, org.processmining.models.graphbased.directed.petrinet.elements.Transition transition, java.lang.Long time)  
      protected double getConfidenceIntervalWidth​(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics summaryStatistics, double confidence)  
      static org.processmining.models.semantics.Semantics<org.processmining.models.semantics.petrinet.Marking,​org.processmining.models.graphbased.directed.petrinet.elements.Transition> getCurrentState​(StochasticNet model, org.processmining.models.semantics.petrinet.Marking initialMarking, org.deckfour.xes.model.XTrace observedEvents)
      TODO: Maybe switch to alignment approach
      static org.processmining.models.semantics.Semantics<org.processmining.models.semantics.petrinet.Marking,​org.processmining.models.graphbased.directed.petrinet.elements.Transition> getCurrentStateWithAlignment​(StochasticNet model, org.processmining.models.semantics.petrinet.Marking initialMarking, org.deckfour.xes.model.XTrace observedEvents)  
      protected double getError​(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics stats)  
      protected double getErrorPercent​(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics stats)  
      protected abstract org.apache.commons.math3.stat.descriptive.DescriptiveStatistics getPredictionStats​(StochasticNet model, org.deckfour.xes.model.XTrace observedEvents, java.util.Date currentTime, boolean useOnlyPastTrainingData, org.processmining.models.semantics.Semantics<org.processmining.models.semantics.petrinet.Marking,​org.processmining.models.graphbased.directed.petrinet.elements.Transition> semantics)
      Computes some stats by running a Monte Carlo simulation of the process.
      org.processmining.models.semantics.Semantics<org.processmining.models.semantics.petrinet.Marking,​org.processmining.models.graphbased.directed.petrinet.elements.Transition> getSemantics​(StochasticNet model, org.deckfour.xes.model.XTrace observedEvents, org.processmining.models.semantics.petrinet.Marking initialMarking)  
      org.processmining.framework.util.Pair<java.lang.Double,​java.lang.Double> predict​(StochasticNet model, org.deckfour.xes.model.XTrace observedEvents, java.util.Date currentTime, boolean useOnlyPastTrainingData, org.processmining.models.semantics.Semantics<org.processmining.models.semantics.petrinet.Marking,​org.processmining.models.graphbased.directed.petrinet.elements.Transition> semantics)  
      org.processmining.framework.util.Pair<java.lang.Double,​java.lang.Double> predict​(StochasticNet model, org.deckfour.xes.model.XTrace observedEvents, java.util.Date currentTime, org.processmining.models.semantics.petrinet.Marking initialMarking)  
      org.processmining.framework.util.Pair<java.lang.Double,​java.lang.Double> predict​(StochasticNet model, org.deckfour.xes.model.XTrace observedEvents, java.util.Date currentTime, org.processmining.models.semantics.petrinet.Marking initialMarking, boolean useOnlyPastTrainingData)
      Does not care about final markings -> simulates net until no transitions are enabled any more...
      • Methods inherited from class java.lang.Object

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

      • CONFIDENCE_INTERVAL

        public static final double CONFIDENCE_INTERVAL
        the confidence interval to be used for estimating bounds on the predicted remaining duration
        See Also:
        Constant Field Values
      • ERROR_BOUND_PERCENT

        public static final double ERROR_BOUND_PERCENT
        Simulation is allowed to stop, when relative error is below this value
        See Also:
        Constant Field Values
      • MAX_RUNS

        public static final int MAX_RUNS
        If we wanted to restrict the number of simulated runs, we could do it here
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractTimePredictor

        public AbstractTimePredictor()
    • Method Detail

      • predict

        public org.processmining.framework.util.Pair<java.lang.Double,​java.lang.Double> predict​(StochasticNet model,
                                                                                                      org.deckfour.xes.model.XTrace observedEvents,
                                                                                                      java.util.Date currentTime,
                                                                                                      org.processmining.models.semantics.petrinet.Marking initialMarking)
      • predict

        public org.processmining.framework.util.Pair<java.lang.Double,​java.lang.Double> predict​(StochasticNet model,
                                                                                                      org.deckfour.xes.model.XTrace observedEvents,
                                                                                                      java.util.Date currentTime,
                                                                                                      boolean useOnlyPastTrainingData,
                                                                                                      org.processmining.models.semantics.Semantics<org.processmining.models.semantics.petrinet.Marking,​org.processmining.models.graphbased.directed.petrinet.elements.Transition> semantics)
      • predict

        public org.processmining.framework.util.Pair<java.lang.Double,​java.lang.Double> predict​(StochasticNet model,
                                                                                                      org.deckfour.xes.model.XTrace observedEvents,
                                                                                                      java.util.Date currentTime,
                                                                                                      org.processmining.models.semantics.petrinet.Marking initialMarking,
                                                                                                      boolean useOnlyPastTrainingData)
        Does not care about final markings -> simulates net until no transitions are enabled any more... Time
        Parameters:
        observedEvents - the monitored partial trace (complete, i.e., no visible transition missing)
        currentTime - the time of prediction (can be later than the last event's time stamp)
        initialMarking - initial marking of the net
        useOnlyPastTrainingData - indicator, whether the training data needs to be filtered with the current time as upper bound
        Returns:
        Pair of doubles (the point predictor, and the associated 99 percent confidence interval)
      • getSemantics

        public final org.processmining.models.semantics.Semantics<org.processmining.models.semantics.petrinet.Marking,​org.processmining.models.graphbased.directed.petrinet.elements.Transition> getSemantics​(StochasticNet model,
                                                                                                                                                                                                                    org.deckfour.xes.model.XTrace observedEvents,
                                                                                                                                                                                                                    org.processmining.models.semantics.petrinet.Marking initialMarking)
      • computeRiskToMissTargetTime

        public java.lang.Double computeRiskToMissTargetTime​(StochasticNet model,
                                                            org.deckfour.xes.model.XTrace observedEvents,
                                                            java.util.Date currentTime,
                                                            java.util.Date targetTime,
                                                            org.processmining.models.semantics.petrinet.Marking initialMarking,
                                                            boolean useOnlyPastTrainingData)
        Maximum likelihood estimate for the risk of missing a deadline until the end of the process. (Currently, we did not implement the time until we reach a certain state)
        Parameters:
        model - StochasticNet capturing the stochastic behavior of the net
        observedEvents - the monitored partial trace (complete, i.e., no visible transition missing)
        currentTime - the time of prediction (can be later than the last event's time stamp)
        targetTime - the deadline with respect to which the risk is calculated
        initialMarking - initial marking of the net
        useOnlyPastTrainingData - indicator, whether the training data needs to be filtered with the current time as upper bound
        Returns:
      • getPredictionStats

        protected abstract org.apache.commons.math3.stat.descriptive.DescriptiveStatistics getPredictionStats​(StochasticNet model,
                                                                                                              org.deckfour.xes.model.XTrace observedEvents,
                                                                                                              java.util.Date currentTime,
                                                                                                              boolean useOnlyPastTrainingData,
                                                                                                              org.processmining.models.semantics.Semantics<org.processmining.models.semantics.petrinet.Marking,​org.processmining.models.graphbased.directed.petrinet.elements.Transition> semantics)
        Computes some stats by running a Monte Carlo simulation of the process.
        Parameters:
        model - the model that is enriched by some training data
        observedEvents - the current history of the trace (observed events so far)
        currentTime - the current time at prediction
        useOnlyPastTrainingData - indicator that tells us whether to only rely on training data that was observed in the past (relative to the currentTime)
        semantics - the semantics with the current marking of the model that shows the starting point
        Returns:
        DescriptiveStatistics gathered from a set of simulated continuations of the current process
      • getConfidenceIntervalWidth

        protected double getConfidenceIntervalWidth​(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics summaryStatistics,
                                                    double confidence)
      • getErrorPercent

        protected double getErrorPercent​(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics stats)
      • getError

        protected double getError​(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics stats)
      • getCurrentState

        public static org.processmining.models.semantics.Semantics<org.processmining.models.semantics.petrinet.Marking,​org.processmining.models.graphbased.directed.petrinet.elements.Transition> getCurrentState​(StochasticNet model,
                                                                                                                                                                                                                        org.processmining.models.semantics.petrinet.Marking initialMarking,
                                                                                                                                                                                                                        org.deckfour.xes.model.XTrace observedEvents)
        TODO: Maybe switch to alignment approach
        Parameters:
        model -
        initialMarking -
        observedEvents -
        Returns:
      • getCurrentStateWithAlignment

        public static org.processmining.models.semantics.Semantics<org.processmining.models.semantics.petrinet.Marking,​org.processmining.models.graphbased.directed.petrinet.elements.Transition> getCurrentStateWithAlignment​(StochasticNet model,
                                                                                                                                                                                                                                     org.processmining.models.semantics.petrinet.Marking initialMarking,
                                                                                                                                                                                                                                     org.deckfour.xes.model.XTrace observedEvents)
      • addAllEnabledTransitions

        protected static void addAllEnabledTransitions​(org.processmining.models.semantics.Semantics<org.processmining.models.semantics.petrinet.Marking,​org.processmining.models.graphbased.directed.petrinet.elements.Transition> semantics,
                                                       java.util.ArrayList<org.processmining.framework.util.Pair<org.processmining.models.semantics.petrinet.Marking,​org.processmining.models.graphbased.directed.petrinet.elements.Transition>> searchState)
      • executeTransition

        protected static void executeTransition​(org.processmining.models.semantics.Semantics<org.processmining.models.semantics.petrinet.Marking,​org.processmining.models.graphbased.directed.petrinet.elements.Transition> semantics,
                                                org.processmining.models.graphbased.directed.petrinet.elements.Transition transition,
                                                java.lang.Long time)
                                         throws org.processmining.models.semantics.IllegalTransitionException
        Throws:
        org.processmining.models.semantics.IllegalTransitionException