Class 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.Transition
    A timed transition to be used in Stochastic Petri Nets with arbitrary distributions

    Contains 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.RealDistribution distribution
      The distribution to sample from when a timer is requested.
      protected double[] distributionParameters
      The parameters for the parameterized distribution, or the observations to generate a non-parametric distribution of.
      protected StochasticNet.DistributionType distributionType
      The StochasticNet.DistributionType which determines the parametric or non-parametric shape of the distribution
      protected int priority
      The priority group
      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)
      protected 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.
      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.
      • Fields inherited from class org.processmining.models.graphbased.directed.petrinet.PetrinetNode

        stdHeight, stdWidth
    • 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=1
      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 Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.commons.math3.distribution.RealDistribution fitGaussianKernels()  
      org.apache.commons.math3.distribution.RealDistribution getDistribution()  
      double[] getDistributionParameters()  
      StochasticNet.DistributionType getDistributionType()  
      int getPriority()  
      java.lang.String getTrainingData()
      Training Data in the form of RELATIVE_DURATION ";" SYSTEM_LOAD ";" TIMESTAMP
      com.google.common.collect.SortedMultiset<ComparablePair<java.lang.Long,​java.util.List<java.lang.Object>>> getTrainingDataUpTo​(long currentTime)  
      double getWeight()  
      org.apache.commons.math3.distribution.RealDistribution initDistribution​(double maxValue)  
      void setDistribution​(org.apache.commons.math3.distribution.RealDistribution dist)  
      void setDistributionParameters​(double... parameters)  
      void setDistributionParameters​(java.util.List<java.lang.Double> transitionStats)  
      void setDistributionType​(StochasticNet.DistributionType distType)  
      void setImmediate​(boolean immediate)  
      void setPriority​(int priority)  
      void setTrainingData​(java.lang.String trainingData)  
      void setWeight​(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
      • Methods inherited from interface org.processmining.models.graphbased.directed.DirectedGraphElement

        equals, getLabel, hashCode
      • Methods inherited from interface org.processmining.models.graphbased.directed.DirectedGraphNode

        getId
    • Field Detail

      • priority

        protected int priority
        The priority group

        Only 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.
      • 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 - (trainingData is).
    • 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()
      • 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)
      • setPriority

        public void setPriority​(int priority)
      • getTrainingData

        public java.lang.String getTrainingData()
        Training Data in the form of RELATIVE_DURATION ";" SYSTEM_LOAD ";" TIMESTAMP
        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)