Class RecursiveSolver

java.lang.Object
solvers.queueingnet.QNSolver
solvers.queueingnet.RecursiveSolver
All Implemented Interfaces:
QNSolverInterface
Direct Known Subclasses:
ConvolutionSolver, RECALNonRecursiveSolver, RECALSolver

public class RecursiveSolver extends QNSolver
This class implements the RecursiveSolver object, which contains common methods for the Convolution and RECAL algorithms.
Author:
Michail Makaronidis, 2010
  • Field Details

  • Constructor Details

    • RecursiveSolver

      public RecursiveSolver(QNModel qnm) throws InternalErrorException
      Creates and initialises a RecursiveSolver object.
      Parameters:
      qnm - The QNModel object that we are working on
      Throws:
      InternalErrorException - Thrown when the solver cannot be initialised
  • Method Details

    • initialConditionFor

      protected BigRational initialConditionFor(PopulationVector n)
      Returns the initial condition corresponding to a particular PopulationVector object.
      Parameters:
      n - The PopulationVector object
      Returns:
      The corresponding initial condition
    • storeG

      protected void storeG(MultiplicitiesVector m, PopulationVector p, BigRational Gval)
      Stores a computed normalising constant value for future re-use.
      Parameters:
      m - The MultiplicitiesVector
      p - The PopulationVector
      Gval - The corresponding normalising constant that has been computed
    • storeG

      Stores at a particular Map<PopulationVector, Map<MultiplicitiesVector, BigRational>> data structure a computed normalising constant value for future re-use.
      Parameters:
      m - The MultiplicitiesVector
      p - The PopulationVector
      Gval - The corresponding normalising constant that has been computed
      map - The data structure at which the constant will be stored
    • recallG

      Searches for a normalising constant in the memory. If it's not found, it returns null.
      Parameters:
      m - The MultiplicitiesVector
      p - The PopulationVector
      Returns:
      The normalising constant as a BigRational object. Null if it has not been precomputed in the past.
    • findG

      Searches for a normalising constant in the memory. If it's not found, it computes and returns it.
      Parameters:
      m - The MultiplicitiesVector
      p - The PopulationVector
      Returns:
      The normalising constant as a BigRational object
      Throws:
      InternalErrorException - An exception is thrown if any internal error is encountered during computations.
    • compute

      Computes any normalising constant using a simple recursion and taking advantage of any already computed and stored value.
      Parameters:
      m - The MultiplicitiesVector
      p - The PopulationVector
      Returns:
      The normalising constant as a BigRational object
      Throws:
      InternalErrorException - An exception is thrown if any internal error is encountered during computations.
    • computePerformanceMeasures

      public void computePerformanceMeasures() throws InternalErrorException
      Description copied from class: QNSolver
      Computes and stores the performance measures (mean throughputs and mean queue lengths for the current model.
      Specified by:
      computePerformanceMeasures in interface QNSolverInterface
      Overrides:
      computePerformanceMeasures in class QNSolver
      Throws:
      InternalErrorException - Thrown when any computation fails