Class SolverCTMC

Direct Known Subclasses:
CTMC

public class SolverCTMC extends NetworkSolver
Solver for Continuous-Time Markov Chain (CTMC) analysis of queueing networks.

SolverCTMC implements exact numerical analysis of queueing networks by constructing and solving the underlying continuous-time Markov chain. This approach provides exact results for steady-state and transient behavior of networks that may not satisfy product-form assumptions.

Key CTMC solver capabilities:

  • Exact CTMC state space construction and solution
  • Steady-state probability computation
  • Transient analysis with time-dependent solutions
  • Joint and marginal state probability distributions
  • Cache network modeling with exact hit/miss probabilities
  • General service and arrival process support

The solver automatically constructs the infinitesimal generator matrix Q and solves the balance equations πQ = 0 for steady-state analysis, or the differential equation dπ/dt = πQ for transient analysis.

Since:
1.0
See Also:
  • Constructor Details

  • Method Details

    • defaultOptions

      public static SolverOptions defaultOptions()
    • listValidMethods

      public List<String> listValidMethods()
    • getFeatureSet

      public static FeatureSet getFeatureSet()
    • printInfGen

      public static void printInfGen(SolverCTMC.generatorResult infGen, SolverCTMC.StateSpace stateSpace)
    • printInfGen

      public static void printInfGen(Matrix Q, Matrix SS)
    • printEventFilt

      public static void printEventFilt(SolverCTMC.generatorResult infGen, SolverCTMC.StateSpace stateSpace)
    • printEventFilt

      public static void printEventFilt(MatrixCell eventFilt, Matrix SS)
    • getCdfRespT

      public Matrix getCdfRespT(Matrix R)
      Get the cumulative distribution function of response times using tagged job methodology
      Parameters:
      R - Response time matrix or percentile values
      Returns:
      Matrix containing CDF values
    • getCdfSysRespT

      public Matrix getCdfSysRespT()
      Get the cumulative distribution function of system response times
      Returns:
      Matrix containing system-wide CDF values
    • getGenerator

      public SolverCTMC.generatorResult getGenerator()
    • generator

      public SolverCTMC.generatorResult generator()
      Alias of getGenerator().
    • getGenerator

      public SolverCTMC.generatorResult getGenerator(SolverOptions options)
    • getMarkedCTMC

      public MarkedMarkovProcess getMarkedCTMC()
      Get the MarkedCTMC representation of the model
      Returns:
      MarkedCTMC with generator and event filters
    • getMarkedCTMC

      public MarkedMarkovProcess getMarkedCTMC(SolverOptions options)
      Get the MarkedCTMC representation of the model with specified options
      Parameters:
      options - solver options
      Returns:
      MarkedCTMC with generator and event filters
    • getInfGen

      public SolverCTMC.generatorResult getInfGen()
    • getInfGen

      public SolverCTMC.generatorResult getInfGen(SolverOptions options)
    • getSymbolicGenerator

      public SolverCTMC.symbolicGeneratorResult getSymbolicGenerator()
      Symbolic infinitesimal generator with each event filtration normalized by its minimum positive rate and scaled by a symbolic variable x1, ..., xE.

      Java has no symbolic algebra engine, but the symbolic generator is linear in the event symbols, so it is represented exactly by one numeric coefficient matrix per event. The result can be evaluated at any symbol assignment via SolverCTMC.symbolicGeneratorResult.evalInfGen(double[]) and inspected entry-wise via SolverCTMC.symbolicGeneratorResult.getSymbolicEntry(int, int). The MATLAB and Python wrappers rebuild native symbolic objects from the coefficient matrices.

      Returns:
      symbolic generator decomposition
    • getSymbolicGenerator

      public SolverCTMC.symbolicGeneratorResult getSymbolicGenerator(boolean invertSymbol)
      Symbolic infinitesimal generator.
      Parameters:
      invertSymbol - if true, each event filtration is divided by its symbol instead of multiplied
      Returns:
      symbolic generator decomposition
    • getProb

      public Ret.ProbabilityResult getProb(int node, Matrix state)
      Description copied from class: NetworkSolver
      Returns marginal state probabilities for a specific node and state. This is an abstract method that must be implemented by concrete solver subclasses.
      Overrides:
      getProb in class NetworkSolver
      Parameters:
      node - the node index for which to compute probabilities
      state - the state vector to query (optional, null for all states)
      Returns:
      result containing marginal state probabilities
    • getProb

      public Ret.ProbabilityResult getProb(StatefulNode node, Matrix state)
    • getProb

      public Ret.ProbabilityResult getProb(StatefulNode node)
    • getProbAggr

      public Ret.ProbabilityResult getProbAggr(int node, Matrix state_a)
      Description copied from class: NetworkSolver
      Probability of a SPECIFIC per-class job distribution at a station. Returns P(n1 jobs of class 1, n2 jobs of class 2, ...) for given state.

      Compare with NetworkSolver.getProbMarg(int, int, jline.util.matrix.Matrix): returns queue-length distribution for a single class, i.e., P(n jobs of class r) for n=0,1,...,N(r).

      Overrides:
      getProbAggr in class NetworkSolver
      Parameters:
      node - the node index for which to compute probabilities
      state_a - per-class job counts, e.g., [2,1] = 2 class-1, 1 class-2
      Returns:
      scalar probability in [0,1]
    • getProbAggr

      public Ret.ProbabilityResult getProbAggr(StatefulNode node, Matrix state_a)
    • getProbAggr

      public Ret.ProbabilityResult getProbAggr(StatefulNode node)
    • getProbAggr

      public Ret.ProbabilityResult getProbAggr(Node node, Matrix state_a)
    • getProbAggr

      public Ret.ProbabilityResult getProbAggr(Node node)
    • getProbSys

      public Ret.ProbabilityResult getProbSys()
      Description copied from class: NetworkSolver
      Returns joint state probabilities for the entire system. This is an abstract method that must be implemented by concrete solver subclasses.
      Overrides:
      getProbSys in class NetworkSolver
      Returns:
      result containing joint state probabilities
    • getProbSysAggr

      public Ret.ProbabilityResult getProbSysAggr()
      Description copied from class: NetworkSolver
      Returns aggregated joint state probabilities for the entire system. This is an abstract method that must be implemented by concrete solver subclasses.
      Overrides:
      getProbSysAggr in class NetworkSolver
      Returns:
      result containing aggregated joint state probabilities
    • getStateSpace

      public SolverCTMC.StateSpace getStateSpace()
    • stateSpace

      public SolverCTMC.StateSpace stateSpace()
      Alias of getStateSpace().
    • getStateSpace

      public SolverCTMC.StateSpace getStateSpace(SolverOptions options)
    • getStateSpaceAggr

      public Matrix getStateSpaceAggr()
    • getStruct

      public NetworkStruct getStruct(SolverCTMC solverCTMC)
    • getTranProb

      public Ret.ProbabilityResult getTranProb(StatefulNode node)
    • getTranProbAggr

      public Ret.ProbabilityResult getTranProbAggr(StatefulNode node)
    • getTranProbSys

      public Ret.ProbabilityResult getTranProbSys()
    • getTranProbSysAggr

      public Ret.ProbabilityResult getTranProbSysAggr()
    • runAnalyzer

      Description copied from class: Solver
      Executes the solver algorithm to analyze the model. This abstract method must be implemented by concrete solver classes.
      Specified by:
      runAnalyzer in class Solver
      Throws:
      IllegalAccessException - if access to required resources is denied
      ParserConfigurationException - if XML parsing configuration fails
      IOException - if I/O operations fail
    • sample

      public SolverCTMC.SampleResult sample(StatefulNode node, int numEvents)
    • sampleSys

      public Ret.SampleResult sampleSys(int numEvents)
      Description copied from class: NetworkSolver
      Samples joint system state trajectories. This is an abstract method that must be implemented by concrete solver subclasses.
      Overrides:
      sampleSys in class NetworkSolver
      Parameters:
      numEvents - the number of events to sample
      Returns:
      result containing sampled joint system state trajectories
    • supports

      public boolean supports(Network model)
      Description copied from class: Solver
      Checks if this solver supports the given network model. Default implementation returns true; subclasses should override to provide specific feature validation.
      Overrides:
      supports in class Solver
      Parameters:
      model - the network model to check
      Returns:
      true if the model is supported, false otherwise
    • sampleAggr

      public SolverCTMC.SampleResult sampleAggr(StatefulNode node, int numEvents)
    • sampleSysAggr

      public Ret.SampleResult sampleSysAggr(int numEvents)
      Description copied from class: NetworkSolver
      Samples aggregated joint system state trajectories. This is an abstract method that must be implemented by concrete solver subclasses.
      Overrides:
      sampleSysAggr in class NetworkSolver
      Parameters:
      numEvents - the number of events to sample
      Returns:
      result containing sampled aggregated joint system state trajectories
    • getRewardResult

      public RewardResult getRewardResult()
      Get reward computation results via value iteration. Computes cumulative rewards for all defined reward functions using value iteration on the uniformized CTMC.
      Returns:
      RewardResult containing value functions and steady-state rewards
      Throws:
      IllegalStateException - if no rewards are defined on the model
    • getRewardValueFunction

      public Matrix getRewardValueFunction(String rewardName)
      Get the value function for a specific reward.
      Parameters:
      rewardName - The name of the reward
      Returns:
      Matrix of size [Tmax+1 x nStates] containing V^k(s) values
      Throws:
      IllegalArgumentException - if reward name not found
    • getRewardTimeVector

      public double[] getRewardTimeVector()
      Get the time vector for reward computation.
      Returns:
      Time vector scaled by uniformization rate
    • getAvgReward

      public Map<String,Double> getAvgReward()
      Get steady-state expected reward for all rewards.
      Returns:
      Map from reward name to expected reward value
    • getAvgReward

      public double getAvgReward(String rewardName)
      Get steady-state expected reward for a specific reward.
      Parameters:
      rewardName - The name of the reward
      Returns:
      Expected reward value in steady state
      Throws:
      IllegalArgumentException - if reward name not found
    • getRewardNames

      public List<String> getRewardNames()
      Get the list of defined reward names.
      Returns:
      List of reward names
    • clearRewardResult

      public void clearRewardResult()
      Clear cached reward results to force recomputation.
    • runRewardAnalyzer

      public RewardResult runRewardAnalyzer()
      Run the reward analyzer and cache results. Convenience wrapper calling solver_ctmc_reward and storing results.
      Returns:
      RewardResult containing value functions, time vector, names, and steady-state rewards
    • getReward

      public RewardResult getReward(String rewardName)
      Get reward value function and state space, with optional filtering by reward name. Alias matching MATLAB getReward() signature.
      Parameters:
      rewardName - Optional reward name to filter. If null, returns all rewards.
      Returns:
      RewardResult containing value functions, time vector, names, state space
    • getReward

      public RewardResult getReward()
      Get reward value function and state space for all rewards.
      Returns:
      RewardResult containing all rewards
    • getTranReward

      public Map<String,double[]> getTranReward(String rewardName)
      Get transient expected reward E[r(X(t))] over time. Computes transient expected rewards using: E[r(X(t))] = sum_s pi_t(s) * r(s) where pi_t is the transient probability distribution at time t. Requires a finite timespan set via SolverCTMC(model, options.timespan([0,T])).
      Parameters:
      rewardName - Optional reward name to filter. If null, returns all rewards.
      Returns:
      Map from reward name to double[] of expected reward values at each time point. Use getRewardTimeVector() or the result's time field to get the corresponding time points.
    • getTranReward

      public Map<String,double[]> getTranReward()
      Get transient expected reward for all rewards.
      Returns:
      Map from reward name to transient expected reward time series