Class Distribution

java.lang.Object
jline.lang.processes.Distribution
All Implemented Interfaces:
Serializable, Copyable
Direct Known Subclasses:
ContinuousDistribution, Det, Disabled, DiscreteDistribution, EmpiricalCDF, Immediate, Prior, Replayer

public abstract class Distribution extends Object implements Copyable
An abstract class of a general distribution
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
    protected double
     
    protected String
     
    protected int
     
    protected List<NamedParam>
     
    protected Pair<Double,Double>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Distribution(String name, int numParam, Pair<Double,Double> support)
    Creates a new distribution with the specified characteristics.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract double
    evalCDF(double t)
    Evaluates the cumulative distribution function (CDF) at the given point.
    abstract double
    evalLST(double s)
    Evaluate the Laplace-Stieltjes Transform at s
    double
    evalProbInterval(double t0, double t1)
    Evaluates the probability of the distribution falling within the given interval.
    abstract double
    Gets the mean (expected value) of this distribution.
    Gets the name of this distribution type.
    int
    getNumParams(int id)
    Gets the number of parameters for this distribution.
    getParam(int id)
    Gets a parameter by its ID.
    double
    Gets the rate of this distribution (inverse of mean).
    abstract double
    Gets the squared coefficient of variation (SCV) of this distribution.
    abstract double
    Gets the skewness of this distribution.
    Gets the support range of this distribution.
    double
    Gets the variance of this distribution.
    boolean
    Checks if this is a continuous distribution.
    boolean
    Checks if this is a disabled distribution.
    boolean
    Checks if this is a discrete distribution.
    boolean
    Checks if this distribution has immediate (zero) service time.
    boolean
    Check if this distribution is Markovian (has a matrix process representation)
    double
    Kotlin-style property alias for getMean()
    Kotlin-style property alias for getName()
    int
    numParams(int id)
    Kotlin-style property alias for getNumParams(int id)
    param(int id)
    Kotlin-style property alias for getParam(int id)
    double
    Kotlin-style property alias for getRate()
    double[]
    sample(int n)
    Generates random samples from this distribution using default random generator.
    abstract double[]
    sample(int n, Random random)
    Generates random samples from this distribution using the specified random generator.
    double
    scv()
    Kotlin-style property alias for getSCV()
    void
    setNumParams(int num)
    Sets the number of parameters for this distribution.
    void
    setParam(int id, String name, Object value)
    Sets a parameter value for this distribution.
    double
    Kotlin-style property alias for getSkewness()
    Kotlin-style property alias for getSupport()
    double
    var()
    Kotlin-style property alias for getVar()

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface jline.lang.Copyable

    copy
  • Field Details

    • mean

      protected double mean
    • immediate

      protected boolean immediate
    • name

      protected String name
    • numParam

      protected int numParam
    • support

      protected Pair<Double,Double> support
    • params

      protected List<NamedParam> params
  • Constructor Details

    • Distribution

      public Distribution(String name, int numParam, Pair<Double,Double> support)
      Creates a new distribution with the specified characteristics.
      Parameters:
      name - the name of this distribution type
      numParam - the number of parameters required
      support - the support range [min, max] for this distribution
  • Method Details

    • evalCDF

      public abstract double evalCDF(double t)
      Evaluates the cumulative distribution function (CDF) at the given point.
      Parameters:
      t - the point at which to evaluate the CDF
      Returns:
      the CDF value at point t
    • evalProbInterval

      public double evalProbInterval(double t0, double t1)
      Evaluates the probability of the distribution falling within the given interval. Computes P(t0 invalid input: '<'= X invalid input: '<'= t1) = F(t1) - F(t0).
      Parameters:
      t0 - the lower bound of the interval
      t1 - the upper bound of the interval
      Returns:
      the probability of falling within [t0, t1]
      Throws:
      RuntimeException - if t1 invalid input: '<' t0
    • getMean

      public abstract double getMean()
      Gets the mean (expected value) of this distribution.
      Returns:
      the mean value
    • getName

      public String getName()
      Gets the name of this distribution type.
      Returns:
      the distribution name
    • getNumParams

      public int getNumParams(int id)
      Gets the number of parameters for this distribution.
      Parameters:
      id - parameter identifier (currently unused)
      Returns:
      the number of parameters
    • getParam

      public NamedParam getParam(int id)
      Gets a parameter by its ID.
      Parameters:
      id - the parameter ID (1-based index)
      Returns:
      the named parameter at the specified position
    • getRate

      public double getRate()
      Gets the rate of this distribution (inverse of mean).
      Returns:
      the rate value (1/mean)
    • getSCV

      public abstract double getSCV()
      Gets the squared coefficient of variation (SCV) of this distribution. SCV = Var(X) / E[X]^2.
      Returns:
      the squared coefficient of variation
    • getSkewness

      public abstract double getSkewness()
      Gets the skewness of this distribution. Skewness measures the asymmetry of the probability distribution.
      Returns:
      the skewness value
    • getSupport

      public Pair<Double,Double> getSupport()
      Gets the support range of this distribution.
      Returns:
      a pair containing [min, max] values where the distribution is defined
    • getVar

      public double getVar()
      Gets the variance of this distribution. Computed as SCV * mean^2.
      Returns:
      the variance
    • isContinuous

      public boolean isContinuous()
      Checks if this is a continuous distribution.
      Returns:
      true if this is a continuous distribution, false otherwise
    • isDisabled

      public boolean isDisabled()
      Checks if this is a disabled distribution.
      Returns:
      true if this is a disabled distribution, false otherwise
    • isDiscrete

      public boolean isDiscrete()
      Checks if this is a discrete distribution.
      Returns:
      true if this is a discrete distribution, false otherwise
    • isImmediate

      public boolean isImmediate()
      Checks if this distribution has immediate (zero) service time.
      Returns:
      true if the distribution is immediate or has mean invalid input: '<' Zero threshold
    • sample

      public double[] sample(int n)
      Generates random samples from this distribution using default random generator.
      Parameters:
      n - the number of samples to generate
      Returns:
      array of random samples
    • sample

      public abstract double[] sample(int n, Random random)
      Generates random samples from this distribution using the specified random generator.
      Parameters:
      n - the number of samples to generate
      random - the random number generator to use
      Returns:
      array of random samples
    • setNumParams

      public void setNumParams(int num)
      Sets the number of parameters for this distribution.
      Parameters:
      num - the number of parameters
    • setParam

      public void setParam(int id, String name, Object value)
      Sets a parameter value for this distribution.
      Parameters:
      id - the parameter ID (1-based index)
      name - the parameter name
      value - the parameter value
    • evalLST

      public abstract double evalLST(double s)
      Evaluate the Laplace-Stieltjes Transform at s
      Parameters:
      s - the Laplace domain variable
      Returns:
      the LST value at s
    • isMarkovian

      public boolean isMarkovian()
      Check if this distribution is Markovian (has a matrix process representation)
      Returns:
      true if this is a Markovian distribution, false otherwise
    • name

      public String name()
      Kotlin-style property alias for getName()
    • mean

      public double mean()
      Kotlin-style property alias for getMean()
    • rate

      public double rate()
      Kotlin-style property alias for getRate()
    • scv

      public double scv()
      Kotlin-style property alias for getSCV()
    • skewness

      public double skewness()
      Kotlin-style property alias for getSkewness()
    • var

      public double var()
      Kotlin-style property alias for getVar()
    • support

      public Pair<Double,Double> support()
      Kotlin-style property alias for getSupport()
    • numParams

      public int numParams(int id)
      Kotlin-style property alias for getNumParams(int id)
    • param

      public NamedParam param(int id)
      Kotlin-style property alias for getParam(int id)