Class AbstractTimePredictor
- java.lang.Object
-
- org.processmining.plugins.stochasticpetrinet.prediction.AbstractTimePredictor
-
- Direct Known Subclasses:
TimePredictor,TimeseriesPredictor
public abstract class AbstractTimePredictor extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static doubleABS_ERROR_THRESHOLDstatic doubleCONFIDENCE_INTERVALthe confidence interval to be used for estimating bounds on the predicted remaining durationstatic doubleERROR_BOUND_PERCENTSimulation is allowed to stop, when relative error is below this valuestatic intMAX_RUNSIf we wanted to restrict the number of simulated runs, we could do it here
-
Constructor Summary
Constructors Constructor Description AbstractTimePredictor()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static voidaddAllEnabledTransitions(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.DoublecomputeRiskToMissTargetTime(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 voidexecuteTransition(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 doublegetConfidenceIntervalWidth(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 approachstatic 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 doublegetError(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics stats)protected doublegetErrorPercent(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics stats)protected abstract org.apache.commons.math3.stat.descriptive.DescriptiveStatisticsgetPredictionStats(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...
-
-
-
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
-
ABS_ERROR_THRESHOLD
public static final double ABS_ERROR_THRESHOLD
- 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
-
-
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 netuseOnlyPastTrainingData- indicator, whether the training data needs to be filtered with the current time as upper bound- Returns:
Pairof 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 netobservedEvents- 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 calculatedinitialMarking- initial marking of the netuseOnlyPastTrainingData- 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 dataobservedEvents- the current history of the trace (observed events so far)currentTime- the current time at predictionuseOnlyPastTrainingData- 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:
DescriptiveStatisticsgathered 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
-
-