Class StochasticManifestCollector
- java.lang.Object
-
- org.processmining.plugins.stochasticpetrinet.enricher.StochasticManifestCollector
-
public class StochasticManifestCollector extends java.lang.ObjectSimple analyzer for a manifest based replay.Collects statistics of the network given an alignment. Does so by taking into account different semantics.
Aim is to reconstruct the original model parameters, such that a simulation of the model would give similar results, as observed in the log.
Problem: some semantics make it hard to reason about the original transition distributions. For example, in the race selection policy, only the winning transitions' time is recorded, and the other transitions that lose a race, might lose their progress depending on the memory policy:
1.) in the resampling case, these times are lost, and the reconstruction of distributions is hard. 2.) in the enabling memory case, all parallel transitions are fine, as they keep their progress, and only conflicting transitions that lose a race will not leave a trace of their sample in the event log. 3.) the age memory, allows losing transitions to keep their progress, even in conflict. However, if they will not have a chance to finish and fire eventually, before the process ends, their sample durations will be lost, too.
Learning distributions from data, that is partly censored is possible, and there are some algorithms (e.g., EM-algorithm) that can be used to fit a model to the data. See
RCensoredLogSplineDistribution, which provides such functionality through an R-binding.In the global preselection policy, only one transition is being processed, such that all other transitions have to wait, even if they are in parallel. Since the distribution times are never hidden, (there is no racing), collecting them is easy. We need to collect information about the weights in each marking and later average the weights out, such that their relation will be in accordance with the observed behavior. See
GradientDescentandMarkingBasedSelectionWeightCostFunctionin the optimizer package.- Author:
- Andreas Rogge-Solti
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.Integer,java.lang.Double>ageVariablesStores the age of a transition in model time units since the last sampling periodprotected java.util.Map<java.lang.Integer,java.util.List<java.lang.Double>>censoredTimesstores all censored sample times, where the transition could not use it's sampled duration, because it lost against another.static java.lang.StringDELIMITERprotected gnu.trove.map.hash.TIntObjectHashMap<short[]>encodedTrans2Predprotected gnu.trove.map.hash.TIntObjectHashMap<short[]>encodedTrans2Succprotected java.util.Map<java.lang.Integer,java.util.List<java.lang.Double>>firingTimesstores firing times for transitionsprotected org.processmining.models.graphbased.directed.petrinet.elements.Transition[]idx2TransMapping the Petri net to integer-encoded numbersprotected doublelongestTraceStores the longest trace's duration in time units of the modelprotected org.processmining.plugins.petrinet.manifestreplayresult.ManifestEvClassPatternmanifestprotected java.util.Map<java.lang.String,int[]>markingBasedSelectionsfor each visited marking, collect the number of times a transition was picked.static java.lang.StringRELATIVE_DURATIONstatic java.lang.StringSYSTEM_LOADstatic java.lang.StringTIMESTAMP
-
Constructor Summary
Constructors Constructor Description StochasticManifestCollector(org.processmining.plugins.petrinet.manifestreplayresult.ManifestEvClassPattern manifest, PerformanceEnricherConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddTrainingDataLine(java.lang.String trainingDataHeader, int encTrans, java.lang.String line)voidcollectDataFromManifest(org.deckfour.xes.model.XLog enrichedLog)CaseStatisticsgetCaseStatistics(int caseId)Only applicable, if the replay was done on aStochasticNetmodel.java.util.List<java.lang.Double>getCensoredFiringTimes(int indexOfTransition)intgetDataCount(int encodedTransID)intgetEncOfTrans(org.processmining.models.graphbased.directed.petrinet.elements.Transition t)java.util.List<java.lang.Double>getFiringTimes(int indexOfTransition)java.util.Map<java.lang.String,int[]>getMarkingBasedSelections()doublegetMaxTraceDuration()doublegetMeanTraceFitness()java.lang.StringgetTrainingData(int indexOfTransition)voidoutputCorrelationMatrix()
-
-
-
Field Detail
-
DELIMITER
public static final java.lang.String DELIMITER
- See Also:
- Constant Field Values
-
RELATIVE_DURATION
public static final java.lang.String RELATIVE_DURATION
- See Also:
- Constant Field Values
-
SYSTEM_LOAD
public static final java.lang.String SYSTEM_LOAD
- See Also:
- Constant Field Values
-
TIMESTAMP
public static final java.lang.String TIMESTAMP
- See Also:
- Constant Field Values
-
firingTimes
protected java.util.Map<java.lang.Integer,java.util.List<java.lang.Double>> firingTimes
stores firing times for transitions
-
censoredTimes
protected java.util.Map<java.lang.Integer,java.util.List<java.lang.Double>> censoredTimes
stores all censored sample times, where the transition could not use it's sampled duration, because it lost against another.
-
ageVariables
protected java.util.Map<java.lang.Integer,java.lang.Double> ageVariables
Stores the age of a transition in model time units since the last sampling period
-
manifest
protected org.processmining.plugins.petrinet.manifestreplayresult.ManifestEvClassPattern manifest
-
idx2Trans
protected org.processmining.models.graphbased.directed.petrinet.elements.Transition[] idx2Trans
Mapping the Petri net to integer-encoded numbers
-
encodedTrans2Pred
protected gnu.trove.map.hash.TIntObjectHashMap<short[]> encodedTrans2Pred
-
encodedTrans2Succ
protected gnu.trove.map.hash.TIntObjectHashMap<short[]> encodedTrans2Succ
-
markingBasedSelections
protected java.util.Map<java.lang.String,int[]> markingBasedSelections
for each visited marking, collect the number of times a transition was picked. the transitions are indexed by their encoded id used in the parent class's#getTrans2Idx()the values in the array are the counts for the different observed next transitions.
-
longestTrace
protected double longestTrace
Stores the longest trace's duration in time units of the model
-
-
Constructor Detail
-
StochasticManifestCollector
public StochasticManifestCollector(org.processmining.plugins.petrinet.manifestreplayresult.ManifestEvClassPattern manifest, PerformanceEnricherConfig config)
-
-
Method Detail
-
collectDataFromManifest
public void collectDataFromManifest(org.deckfour.xes.model.XLog enrichedLog)
-
addTrainingDataLine
protected void addTrainingDataLine(java.lang.String trainingDataHeader, int encTrans, java.lang.String line)
-
getMeanTraceFitness
public double getMeanTraceFitness()
-
getMarkingBasedSelections
public java.util.Map<java.lang.String,int[]> getMarkingBasedSelections()
-
getEncOfTrans
public int getEncOfTrans(org.processmining.models.graphbased.directed.petrinet.elements.Transition t)
-
getDataCount
public int getDataCount(int encodedTransID)
-
getFiringTimes
public java.util.List<java.lang.Double> getFiringTimes(int indexOfTransition)
-
getTrainingData
public java.lang.String getTrainingData(int indexOfTransition)
-
getCensoredFiringTimes
public java.util.List<java.lang.Double> getCensoredFiringTimes(int indexOfTransition)
-
getMaxTraceDuration
public double getMaxTraceDuration()
-
outputCorrelationMatrix
public void outputCorrelationMatrix()
-
getCaseStatistics
public CaseStatistics getCaseStatistics(int caseId)
Only applicable, if the replay was done on aStochasticNetmodel.- Parameters:
caseId- the position of the trace in the log to be analyzed.- Returns:
CaseStatisticsincluding the log-likelihood of the case
-
-