Class ProbabilityResult

java.lang.Object
jline.solvers.mva.ProbabilityResult

public class ProbabilityResult extends Object
Result class for probability calculations in solvers.

Supports both scalar probabilities (single value) and probability distributions (vectors/matrices) for marginal and aggregated state probabilities.

For marginal probabilities (getProbMarg), the probability vector contains P(n jobs of class r) for n=0,1,...,N where N is the population.

For aggregated probabilities (getProbAggr), the probability is a scalar representing P(n1 jobs of class 1, n2 jobs of class 2, ...).

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final double
    The logarithm of the scalar probability value
    final double
    The scalar probability value (for getProbAggr-style results)
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProbabilityResult(double probability, double logProbability)
    Constructor for scalar probability result.
    ProbabilityResult(int nstations, int nclasses)
    Constructor for multi-station, multi-class marginal storage.
    ProbabilityResult(Matrix probabilityVector)
    Constructor for probability distribution result.
  • Method Summary

    Modifier and Type
    Method
    Description
    getMarginal(int station, int jobclass)
    Get the marginal probability distribution for a specific station and class.
    double
    getProbability(int stateIndex)
    Get probability at a specific state index.
    Get the probability distribution vector.
    boolean
    Check if this result contains a probability distribution (vs scalar).
    int
    Get the length of the probability distribution.
    void
    setMarginal(int station, int jobclass, Matrix probVector)
    Set the marginal probability distribution for a specific station and class.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • probability

      public final double probability
      The scalar probability value (for getProbAggr-style results)
    • logProbability

      public final double logProbability
      The logarithm of the scalar probability value
  • Constructor Details

    • ProbabilityResult

      public ProbabilityResult(double probability, double logProbability)
      Constructor for scalar probability result.
      Parameters:
      probability - the probability value
      logProbability - the logarithm of the probability value
    • ProbabilityResult

      public ProbabilityResult(Matrix probabilityVector)
      Constructor for probability distribution result.
      Parameters:
      probabilityVector - the probability distribution as a row vector
    • ProbabilityResult

      public ProbabilityResult(int nstations, int nclasses)
      Constructor for multi-station, multi-class marginal storage.
      Parameters:
      nstations - number of stations
      nclasses - number of job classes
  • Method Details

    • setMarginal

      public void setMarginal(int station, int jobclass, Matrix probVector)
      Set the marginal probability distribution for a specific station and class.
      Parameters:
      station - station index
      jobclass - job class index
      probVector - probability distribution vector
    • getMarginal

      public Matrix getMarginal(int station, int jobclass)
      Get the marginal probability distribution for a specific station and class.
      Parameters:
      station - station index
      jobclass - job class index
      Returns:
      probability distribution vector, or null if not set
    • getProbabilityVector

      public Matrix getProbabilityVector()
      Get the probability distribution vector.
      Returns:
      the probability vector, or null if this is a scalar result
    • hasDistribution

      public boolean hasDistribution()
      Check if this result contains a probability distribution (vs scalar).
      Returns:
      true if this result contains a probability vector
    • getProbability

      public double getProbability(int stateIndex)
      Get probability at a specific state index.
      Parameters:
      stateIndex - the state index (e.g., number of jobs)
      Returns:
      the probability at that state
    • length

      public int length()
      Get the length of the probability distribution.
      Returns:
      number of states in the distribution, or 1 for scalar results