Class TimedTransition
- java.lang.Object
-
- org.processmining.models.graphbased.AbstractGraphElement
-
- org.processmining.models.graphbased.AbstractGraphNode
-
- org.processmining.models.graphbased.directed.AbstractDirectedGraphNode
-
- org.processmining.models.graphbased.directed.petrinet.PetrinetNode
-
- org.processmining.models.graphbased.directed.petrinet.elements.Transition
-
- org.processmining.models.graphbased.directed.petrinet.elements.TimedTransition
-
- All Implemented Interfaces:
java.lang.Cloneable,java.lang.Comparable<org.processmining.models.graphbased.directed.DirectedGraphNode>,org.processmining.models.graphbased.AttributeMapOwner,org.processmining.models.graphbased.directed.ContainableDirectedGraphElement,org.processmining.models.graphbased.directed.DirectedGraphElement,org.processmining.models.graphbased.directed.DirectedGraphNode
public class TimedTransition extends org.processmining.models.graphbased.directed.petrinet.elements.TransitionA timed transition to be used in Stochastic Petri Nets with arbitrary distributionsContains both logic of immediate and timed transitions.
That way different semantics can be realized. weights: - preselection can be achieved for timed transitions based on the weights - race semantics can be implemented by sampling from the distributions and choosing the transition with less time priority: - priority groups could be used also for timed transitions (non-standard behavior)
- Version:
- 0.5 (added a transient cached view for easier access to the training data to not repeatedly call String.split() on it)
- Author:
- Andreas Rogge-Solti
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.commons.math3.distribution.RealDistributiondistributionThe distribution to sample from when a timer is requested.protected double[]distributionParametersThe parameters for the parameterized distribution, or the observations to generate a non-parametric distribution of.protected StochasticNet.DistributionTypedistributionTypeTheStochasticNet.DistributionTypewhich determines the parametric or non-parametric shape of the distributionprotected intpriorityThe priority groupprotected java.lang.StringtrainingDataContains the data that was used to train the model (Basically, this is a table with a header to describe the data and each line represents one entry)protected com.google.common.collect.SortedMultiset<ComparablePair<java.lang.Long,java.util.List<java.lang.Object>>>trainingDataCachea sorted view on all the training data that was used to train this transition.protected doubleweightThe weight of the transition If multiple immediate transitions are enabled concurrently, the decision which one to fire is done on a probabilistic basis.
-
Constructor Summary
Constructors Constructor Description TimedTransition(java.lang.String label, org.processmining.models.graphbased.directed.AbstractDirectedGraph<org.processmining.models.graphbased.directed.petrinet.PetrinetNode,org.processmining.models.graphbased.directed.petrinet.PetrinetEdge<? extends org.processmining.models.graphbased.directed.petrinet.PetrinetNode,? extends org.processmining.models.graphbased.directed.petrinet.PetrinetNode>> net)By default generate a timed transition with exponential firing rate lambda=1TimedTransition(java.lang.String label, org.processmining.models.graphbased.directed.AbstractDirectedGraph<org.processmining.models.graphbased.directed.petrinet.PetrinetNode,org.processmining.models.graphbased.directed.petrinet.PetrinetEdge<? extends org.processmining.models.graphbased.directed.petrinet.PetrinetNode,? extends org.processmining.models.graphbased.directed.petrinet.PetrinetNode>> net, org.processmining.models.graphbased.directed.petrinet.elements.ExpandableSubNet parent, double weight, int priority, StochasticNet.DistributionType type, double... parameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.commons.math3.distribution.RealDistributionfitGaussianKernels()org.apache.commons.math3.distribution.RealDistributiongetDistribution()double[]getDistributionParameters()StochasticNet.DistributionTypegetDistributionType()intgetPriority()java.lang.StringgetTrainingData()com.google.common.collect.SortedMultiset<ComparablePair<java.lang.Long,java.util.List<java.lang.Object>>>getTrainingDataUpTo(long currentTime)doublegetWeight()org.apache.commons.math3.distribution.RealDistributioninitDistribution(double maxValue)voidsetDistribution(org.apache.commons.math3.distribution.RealDistribution dist)voidsetDistributionParameters(double... parameters)voidsetDistributionParameters(java.util.List<java.lang.Double> transitionStats)voidsetDistributionType(StochasticNet.DistributionType distType)voidsetImmediate(boolean immediate)voidsetPriority(int priority)voidsetTrainingData(java.lang.String trainingData)voidsetWeight(double weight)-
Methods inherited from class org.processmining.models.graphbased.directed.petrinet.elements.Transition
getVisiblePredecessors, getVisibleSuccessors, isInvisible, setInvisible
-
Methods inherited from class org.processmining.models.graphbased.directed.petrinet.PetrinetNode
getGraph, getLocalID, getParent, setLocalID
-
Methods inherited from class org.processmining.models.graphbased.directed.AbstractDirectedGraphNode
compareTo
-
Methods inherited from class org.processmining.models.graphbased.AbstractGraphNode
equals, getId, hashCode
-
Methods inherited from class org.processmining.models.graphbased.AbstractGraphElement
getAttributeMap, getLabel, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.processmining.models.graphbased.AttributeMapOwner
getAttributeMap
-
-
-
-
Field Detail
-
priority
protected int priority
The priority groupOnly enabled markings of the highest priority group can fire in a marking. Usually only 0 (timed transitions) and 1 (immediate transitions) are used here, but one could specify further higher priority groups for even more urgent immediate transitions.
-
weight
protected double weight
The weight of the transition If multiple immediate transitions are enabled concurrently, the decision which one to fire is done on a probabilistic basis. Each transition has the chance of firing: weight / (sum of weights of currently enabled transitions)
-
distribution
protected org.apache.commons.math3.distribution.RealDistribution distribution
The distribution to sample from when a timer is requested.
-
distributionType
protected StochasticNet.DistributionType distributionType
TheStochasticNet.DistributionTypewhich determines the parametric or non-parametric shape of the distribution
-
distributionParameters
protected double[] distributionParameters
The parameters for the parameterized distribution, or the observations to generate a non-parametric distribution of.
-
trainingData
protected java.lang.String trainingData
Contains the data that was used to train the model (Basically, this is a table with a header to describe the data and each line represents one entry)
-
trainingDataCache
protected transient com.google.common.collect.SortedMultiset<ComparablePair<java.lang.Long,java.util.List<java.lang.Object>>> trainingDataCache
a sorted view on all the training data that was used to train this transition. it is created on request and stays in memory, but is not serialized to disk - (trainingDatais).
-
-
Constructor Detail
-
TimedTransition
public TimedTransition(java.lang.String label, org.processmining.models.graphbased.directed.AbstractDirectedGraph<org.processmining.models.graphbased.directed.petrinet.PetrinetNode,org.processmining.models.graphbased.directed.petrinet.PetrinetEdge<? extends org.processmining.models.graphbased.directed.petrinet.PetrinetNode,? extends org.processmining.models.graphbased.directed.petrinet.PetrinetNode>> net)By default generate a timed transition with exponential firing rate lambda=1- Parameters:
label-net-
-
TimedTransition
public TimedTransition(java.lang.String label, org.processmining.models.graphbased.directed.AbstractDirectedGraph<org.processmining.models.graphbased.directed.petrinet.PetrinetNode,org.processmining.models.graphbased.directed.petrinet.PetrinetEdge<? extends org.processmining.models.graphbased.directed.petrinet.PetrinetNode,? extends org.processmining.models.graphbased.directed.petrinet.PetrinetNode>> net, org.processmining.models.graphbased.directed.petrinet.elements.ExpandableSubNet parent, double weight, int priority, StochasticNet.DistributionType type, double... parameters)
-
-
Method Detail
-
initDistribution
public org.apache.commons.math3.distribution.RealDistribution initDistribution(double maxValue)
-
fitGaussianKernels
public org.apache.commons.math3.distribution.RealDistribution fitGaussianKernels()
-
getPriority
public int getPriority()
-
getWeight
public double getWeight()
-
getDistribution
public org.apache.commons.math3.distribution.RealDistribution getDistribution()
-
getDistributionType
public StochasticNet.DistributionType getDistributionType()
-
getDistributionParameters
public double[] getDistributionParameters()
-
setDistributionParameters
public void setDistributionParameters(java.util.List<java.lang.Double> transitionStats)
-
setDistributionParameters
public void setDistributionParameters(double... parameters)
-
setWeight
public void setWeight(double weight)
-
setImmediate
public void setImmediate(boolean immediate)
- Parameters:
immediate-
-
setDistribution
public void setDistribution(org.apache.commons.math3.distribution.RealDistribution dist)
-
setDistributionType
public void setDistributionType(StochasticNet.DistributionType distType)
-
setPriority
public void setPriority(int priority)
-
getTrainingData
public java.lang.String getTrainingData()
- Returns:
- String
-
setTrainingData
public void setTrainingData(java.lang.String trainingData)
-
getTrainingDataUpTo
public com.google.common.collect.SortedMultiset<ComparablePair<java.lang.Long,java.util.List<java.lang.Object>>> getTrainingDataUpTo(long currentTime)
-
-