Class StochasticStateFeature

java.lang.Object
org.oristool.models.stpn.trees.StochasticStateFeature
All Implemented Interfaces:
StateFeature, Feature

public class StochasticStateFeature extends Object implements StateFeature
A state feature encoding the support and PDF of enabled timers.
  • Constructor Details

    • StochasticStateFeature

      public StochasticStateFeature(BigDecimal epsilon, int numSamples)
      Builds an empty stochastic state feature.

      With epsilon == null, no approximated comparison is performed (e.g. in transient analysis).

      Parameters:
      epsilon - allowed error in comparisons between states
      numSamples - samples used to compare states
    • StochasticStateFeature

      public StochasticStateFeature(StochasticStateFeature other)
      Builds the copy of a stochastic state feature.
      Parameters:
      other - another stochastic state feature
  • Method Details

    • getAgeVariables

      public Set<Variable> getAgeVariables()
      Returns the set of age variables.
      Returns:
      age variables
    • getFiringVariables

      public Set<Variable> getFiringVariables()
      Returns the set of general, non-age variables.
      Returns:
      set of general, non-age variables
    • addAgeVariable

      public void addAgeVariable(Variable v)
      Adds an age variable.
      Parameters:
      v - input variable
    • addAgeVariable

      public void addAgeVariable(Variable v, BigDecimal value)
      Adds a deterministic age variable.
      Parameters:
      v - variable
      value - value of the variable
    • addVariableReduced

      public void addVariableReduced(Variable v, PartitionedFunction f, BigDecimal amount)
      Adds a variable with the input PDF, reduced of given amount.
      Parameters:
      v - variable
      f - PDF
      amount - reduction
    • addVariable

      public void addVariable(Variable v, PartitionedFunction f)
      Adds a variable with the given PDF.
      Parameters:
      v - variable
      f - PDF
    • addExpVariable

      public void addExpVariable(Variable v, BigDecimal rate)
      Adds an exponentially-distributed variable.
      Parameters:
      v - variable
      rate - rate
    • removeExpVariable

      public void removeExpVariable(Variable v)
    • getEXPVariables

      public Set<Variable> getEXPVariables()
    • getEXPRate

      public BigDecimal getEXPRate(Variable v)
    • setEXPRate

      public void setEXPRate(Variable v, BigDecimal rate)
    • getEXPRates

      public Set<Map.Entry<Variable,BigDecimal>> getEXPRates()
    • getTotalExpRate

      public BigDecimal getTotalExpRate()
      Returns the sum of rates of all exponential variables.
      Returns:
      total exponential rate
    • getTotalExpRate

      public BigDecimal getTotalExpRate(Set<Variable> expVariables)
      Returns the sum of rates of a subset of exponential variables.
      Parameters:
      expVariables - input variables
      Returns:
      total exponential rate of the input variables
    • addTruncatedExp

      public void addTruncatedExp(Variable v, BigDecimal rate, OmegaBigDecimal lft)
      Adds a truncated EXP [0, lft] to the state density.
      Parameters:
      v - variable of the EXP to be added
      rate - rate of the EXP to be added
      lft - truncation threshold
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isVanishing

      public boolean isVanishing()
    • setVanishing

      public void setVanishing(boolean isVanishing)
    • isAbsorbing

      public boolean isAbsorbing()
    • setAbsorbing

      public void setAbsorbing(boolean isAbsorbing)
    • getStateDensity

      public StateDensityFunction getStateDensity()
    • setStateDensity

      public void setStateDensity(StateDensityFunction stateDensity)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • computeMeanValue

      public BigDecimal computeMeanValue(Variable v)
      Computes the mean value of a variable.
      Parameters:
      v - input variable
      Returns:
      mean value
    • conditionToMinimum

      public BigDecimal conditionToMinimum(Variable v)
      Conditions this PDF to the event where the input variable is minimum.
      Parameters:
      v - minimum variable
      Returns:
      probability that the input variable is the minimum