public class StochasticManifestCollector
extends java.lang.Object
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 GradientDescent
and MarkingBasedSelectionWeightCostFunction
in the optimizer package.
Modifier and Type | Field and Description |
---|---|
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
|
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.
|
static java.lang.String |
DELIMITER |
protected gnu.trove.map.hash.TIntObjectHashMap<short[]> |
encodedTrans2Pred |
protected gnu.trove.map.hash.TIntObjectHashMap<short[]> |
encodedTrans2Succ |
protected java.util.Map<java.lang.Integer,java.util.List<java.lang.Double>> |
firingTimes
stores firing times for transitions
|
protected org.processmining.models.graphbased.directed.petrinet.elements.Transition[] |
idx2Trans
Mapping the Petri net to integer-encoded numbers
|
protected double |
longestTrace
Stores the longest trace's duration in time units of the model
|
protected org.processmining.plugins.petrinet.manifestreplayresult.ManifestEvClassPattern |
manifest |
protected java.util.Map<java.lang.String,int[]> |
markingBasedSelections
for each visited marking, collect the number of times a transition was picked.
|
static java.lang.String |
RELATIVE_DURATION |
static java.lang.String |
SYSTEM_LOAD |
static java.lang.String |
TIMESTAMP |
Constructor and Description |
---|
StochasticManifestCollector(org.processmining.plugins.petrinet.manifestreplayresult.ManifestEvClassPattern manifest,
PerformanceEnricherConfig config) |
Modifier and Type | Method and Description |
---|---|
protected void |
addTrainingDataLine(java.lang.String trainingDataHeader,
int encTrans,
java.lang.String line) |
void |
collectDataFromManifest(org.deckfour.xes.model.XLog enrichedLog) |
CaseStatistics |
getCaseStatistics(int caseId)
Only applicable, if the replay was done on a
StochasticNet model. |
java.util.List<java.lang.Double> |
getCensoredFiringTimes(int indexOfTransition) |
int |
getDataCount(int encodedTransID) |
int |
getEncOfTrans(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() |
double |
getMaxTraceDuration() |
double |
getMeanTraceFitness() |
java.lang.String |
getTrainingData(int indexOfTransition) |
void |
outputCorrelationMatrix() |
public static final java.lang.String DELIMITER
public static final java.lang.String RELATIVE_DURATION
public static final java.lang.String SYSTEM_LOAD
public static final java.lang.String TIMESTAMP
protected java.util.Map<java.lang.Integer,java.util.List<java.lang.Double>> firingTimes
protected java.util.Map<java.lang.Integer,java.util.List<java.lang.Double>> censoredTimes
protected java.util.Map<java.lang.Integer,java.lang.Double> ageVariables
protected org.processmining.plugins.petrinet.manifestreplayresult.ManifestEvClassPattern manifest
protected org.processmining.models.graphbased.directed.petrinet.elements.Transition[] idx2Trans
protected gnu.trove.map.hash.TIntObjectHashMap<short[]> encodedTrans2Pred
protected gnu.trove.map.hash.TIntObjectHashMap<short[]> encodedTrans2Succ
protected java.util.Map<java.lang.String,int[]> markingBasedSelections
#getTrans2Idx()
the values in the array are the counts for the different observed next transitions.protected double longestTrace
public StochasticManifestCollector(org.processmining.plugins.petrinet.manifestreplayresult.ManifestEvClassPattern manifest, PerformanceEnricherConfig config)
public void collectDataFromManifest(org.deckfour.xes.model.XLog enrichedLog)
protected void addTrainingDataLine(java.lang.String trainingDataHeader, int encTrans, java.lang.String line)
public double getMeanTraceFitness()
public java.util.Map<java.lang.String,int[]> getMarkingBasedSelections()
public int getEncOfTrans(org.processmining.models.graphbased.directed.petrinet.elements.Transition t)
public int getDataCount(int encodedTransID)
public java.util.List<java.lang.Double> getFiringTimes(int indexOfTransition)
public java.lang.String getTrainingData(int indexOfTransition)
public java.util.List<java.lang.Double> getCensoredFiringTimes(int indexOfTransition)
public double getMaxTraceDuration()
public void outputCorrelationMatrix()
public CaseStatistics getCaseStatistics(int caseId)
StochasticNet
model.caseId
- the position of the trace in the log to be analyzed.CaseStatistics
including the log-likelihood of the case