Package jline.solvers.ctmc
Class SolverCTMC
java.lang.Object
jline.solvers.Solver
jline.solvers.NetworkSolver
jline.solvers.ctmc.SolverCTMC
- Direct Known Subclasses:
CTMC
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Field Summary
Fields inherited from class jline.solvers.NetworkSolver
avgHandles, model, sn, tranHandles -
Constructor Summary
ConstructorsConstructorDescriptionSolverCTMC(Network model, Object... args) SolverCTMC(Network model, SolverOptions options) -
Method Summary
Modifier and TypeMethodDescriptionvoidClear cached reward results to force recomputation.static SolverOptionsGet steady-state expected reward for all rewards.doublegetAvgReward(String rewardName) Get steady-state expected reward for a specific reward.Get the cumulative distribution function of response times using tagged job methodologyGet the cumulative distribution function of system response timesstatic FeatureSetgetGenerator(SolverOptions options) getInfGen(SolverOptions options) Get the MarkedCTMC representation of the modelgetMarkedCTMC(SolverOptions options) Get the MarkedCTMC representation of the model with specified optionsReturns marginal state probabilities for a specific node and state.getProb(StatefulNode node) getProb(StatefulNode node, Matrix state) getProbAggr(int node, Matrix state_a) Probability of a SPECIFIC per-class job distribution at a station.getProbAggr(Node node) getProbAggr(Node node, Matrix state_a) getProbAggr(StatefulNode node) getProbAggr(StatefulNode node, Matrix state_a) Returns joint state probabilities for the entire system.Returns aggregated joint state probabilities for the entire system.Get reward value function and state space for all rewards.Get reward value function and state space, with optional filtering by reward name.Get the list of defined reward names.Get reward computation results via value iteration.double[]Get the time vector for reward computation.getRewardValueFunction(String rewardName) Get the value function for a specific reward.getStateSpace(SolverOptions options) getStruct(SolverCTMC solverCTMC) getTranProb(StatefulNode node) getTranProbAggr(StatefulNode node) Get transient expected reward for all rewards.getTranReward(String rewardName) Get transient expected reward E[r(X(t))] over time.static voidprintEventFilt(SolverCTMC.generatorResult infGen, SolverCTMC.StateSpace stateSpace) static voidprintEventFilt(MatrixCell eventFilt, Matrix SS) static voidprintInfGen(SolverCTMC.generatorResult infGen, SolverCTMC.StateSpace stateSpace) static voidprintInfGen(Matrix Q, Matrix SS) voidExecutes the solver algorithm to analyze the model.Run the reward analyzer and cache results.sample(StatefulNode node, int numEvents) sampleAggr(StatefulNode node, int numEvents) sampleSys(int numEvents) Samples joint system state trajectories.sampleSysAggr(int numEvents) Samples aggregated joint system state trajectories.booleanChecks if this solver supports the given network model.Methods inherited from class jline.solvers.NetworkSolver
aCT, aCT, aCT, aCT, aCT, aCT, aNCT, aNCT, aNCT, aNCT, aNCT, aNCT, aNT, aNT, aNT, aNT, aNT, aNT, aST, aST, aST, aT, aT, aT, aT, aT, aT, avg, avg, avg, avgArvR, avgArvRChain, avgArvRHandles, avgChain, avgChainT, avgChainT, avgChainT, avgChainT, avgChainT, avgChainT, avgChainTable, avgChainTable, avgChainTable, avgChainTable, avgChainTable, avgChainTable, avgHandles, avgNode, avgNodeArvRChain, avgNodeChain, avgNodeChainT, avgNodeChainT, avgNodeChainT, avgNodeChainT, avgNodeChainT, avgNodeChainT, avgNodeChainTable, avgNodeChainTable, avgNodeChainTable, avgNodeChainTable, avgNodeChainTable, avgNodeChainTable, avgNodeQLenChain, avgNodeResidTChain, avgNodeRespTChain, avgNodeT, avgNodeT, avgNodeT, avgNodeT, avgNodeT, avgNodeT, avgNodeTable, avgNodeTable, avgNodeTable, avgNodeTable, avgNodeTable, avgNodeTable, avgNodeTputChain, avgNodeUtilChain, avgQLen, avgQLenChain, avgQLenHandles, avgResidT, avgResidTChain, avgResidTHandles, avgRespT, avgRespTChain, avgRespTHandles, avgSys, avgSysRespT, avgSysT, avgSysT, avgSysT, avgSysTable, avgSysTable, avgSysTable, avgSysTput, avgT, avgT, avgT, avgT, avgT, avgT, avgTable, avgTable, avgTable, avgTable, avgTable, avgTable, avgTput, avgTputChain, avgTputHandles, avgUtil, avgUtilChain, avgUtilHandles, avgWaitT, cdfPassT, cdfPassT, cdfRespT, cdfRespT, chainAvgT, chainAvgT, chainAvgT, chainAvgT, chainAvgT, chainAvgT, getAllSolvers, getAvg, getAvg, getAvg, getAvgArvR, getAvgArvRChain, getAvgArvRHandles, getAvgChain, getAvgChainTable, getAvgChainTable, getAvgChainTable, getAvgChainTable, getAvgChainTable, getAvgChainTable, getAvgHandles, getAvgNode, getAvgNodeArvRChain, getAvgNodeChain, getAvgNodeChainTable, getAvgNodeChainTable, getAvgNodeChainTable, getAvgNodeChainTable, getAvgNodeChainTable, getAvgNodeChainTable, getAvgNodeQLenChain, getAvgNodeResidTChain, getAvgNodeRespTChain, getAvgNodeTable, getAvgNodeTable, getAvgNodeTable, getAvgNodeTable, getAvgNodeTable, getAvgNodeTable, getAvgNodeTputChain, getAvgNodeUtilChain, getAvgQLen, getAvgQLenChain, getAvgQLenHandles, getAvgResidT, getAvgResidTChain, getAvgResidTHandles, getAvgRespT, getAvgRespTChain, getAvgRespTHandles, getAvgSys, getAvgSys, getAvgSys, getAvgSysRespT, getAvgSysTable, getAvgSysTable, getAvgSysTable, getAvgSysTput, getAvgT, getAvgT, getAvgT, getAvgT, getAvgT, getAvgT, getAvgTable, getAvgTable, getAvgTable, getAvgTable, getAvgTable, getAvgTable, getAvgTput, getAvgTputChain, getAvgTputHandles, getAvgUtil, getAvgUtilChain, getAvgUtilHandles, getAvgWaitT, getCdfPassT, getCdfPassT, getCdfRespT, getCdfRespT, getChainAvgT, getChainAvgT, getChainAvgT, getChainAvgT, getChainAvgT, getChainAvgT, getDeadlineTable, getModel, getNodeAvgT, getNodeAvgT, getNodeAvgT, getNodeAvgT, getNodeAvgT, getNodeAvgT, getNodeChainAvgT, getNodeChainAvgT, getNodeChainAvgT, getNodeChainAvgT, getNodeChainAvgT, getNodeChainAvgT, getProb, getProbAggr, getProbMarg, getProbMarg, getProbNormConstAggr, getStageT, getStageT, getStageTable, getStageTable, getSysAvgT, getSysAvgT, getSysAvgT, getTranAvg, getTranCdfPassT, getTranCdfPassT, getTranCdfRespT, getTranCdfRespT, getTranHandles, hasAvgResults, hasDistribResults, hasTranResults, initHandles, model, nodeAvgT, nodeAvgT, nodeAvgT, nodeAvgT, nodeAvgT, nodeAvgT, nodeChainAvgT, nodeChainAvgT, nodeChainAvgT, nodeChainAvgT, nodeChainAvgT, nodeChainAvgT, print, prob, prob, probAggr, probAggr, probMarg, probMarg, probNormConstAggr, probSys, probSysAggr, runAnalyzerChecks, sample, sampleAggr, setAvgHandles, setAvgResults, setDistribResults, setLang, setModel, setTranAvgResults, setTranHandles, setTranProb, stageT, stageTable, sysAvgT, sysAvgT, sysAvgT, tranAvg, tranCdfPassT, tranCdfPassT, tranCdfRespT, tranCdfRespT, tranHandlesMethods inherited from class jline.solvers.Solver
getName, getOptions, getResults, hasResults, isJavaAvailable, isValidOption, listValidOptions, parseOptions, parseOptions, reset, resetRandomGeneratorSeed, setChecks, setOptions
-
Constructor Details
-
SolverCTMC
-
SolverCTMC
-
-
Method Details
-
defaultOptions
-
listValidMethods
-
getFeatureSet
-
printInfGen
-
printInfGen
-
printEventFilt
public static void printEventFilt(SolverCTMC.generatorResult infGen, SolverCTMC.StateSpace stateSpace) -
printEventFilt
-
getCdfRespT
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
Get the cumulative distribution function of system response times- Returns:
- Matrix containing system-wide CDF values
-
getGenerator
-
getGenerator
-
getMarkedCTMC
Get the MarkedCTMC representation of the model- Returns:
- MarkedCTMC with generator and event filters
-
getMarkedCTMC
Get the MarkedCTMC representation of the model with specified options- Parameters:
options- solver options- Returns:
- MarkedCTMC with generator and event filters
-
getInfGen
-
getInfGen
-
getProb
Description copied from class:NetworkSolverReturns marginal state probabilities for a specific node and state. This is an abstract method that must be implemented by concrete solver subclasses.- Overrides:
getProbin classNetworkSolver- Parameters:
node- the node index for which to compute probabilitiesstate- the state vector to query (optional, null for all states)- Returns:
- result containing marginal state probabilities
-
getProb
-
getProb
-
getProbAggr
Description copied from class:NetworkSolverProbability 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:
getProbAggrin classNetworkSolver- Parameters:
node- the node index for which to compute probabilitiesstate_a- per-class job counts, e.g., [2,1] = 2 class-1, 1 class-2- Returns:
- scalar probability in [0,1]
-
getProbAggr
-
getProbAggr
-
getProbAggr
-
getProbAggr
-
getProbSys
Description copied from class:NetworkSolverReturns joint state probabilities for the entire system. This is an abstract method that must be implemented by concrete solver subclasses.- Overrides:
getProbSysin classNetworkSolver- Returns:
- result containing joint state probabilities
-
getProbSysAggr
Description copied from class:NetworkSolverReturns aggregated joint state probabilities for the entire system. This is an abstract method that must be implemented by concrete solver subclasses.- Overrides:
getProbSysAggrin classNetworkSolver- Returns:
- result containing aggregated joint state probabilities
-
getStateSpace
-
getStateSpace
-
getStateSpaceAggr
-
getStruct
-
getTranProb
-
getTranProbAggr
-
getTranProbSys
-
getTranProbSysAggr
-
runAnalyzer
Description copied from class:SolverExecutes the solver algorithm to analyze the model. This abstract method must be implemented by concrete solver classes.- Specified by:
runAnalyzerin classSolver- Throws:
IllegalAccessException- if access to required resources is deniedParserConfigurationException- if XML parsing configuration failsIOException- if I/O operations fail
-
sample
-
sampleSys
Description copied from class:NetworkSolverSamples joint system state trajectories. This is an abstract method that must be implemented by concrete solver subclasses.- Overrides:
sampleSysin classNetworkSolver- Parameters:
numEvents- the number of events to sample- Returns:
- result containing sampled joint system state trajectories
-
supports
Description copied from class:SolverChecks if this solver supports the given network model. Default implementation returns true; subclasses should override to provide specific feature validation. -
sampleAggr
-
sampleSysAggr
Description copied from class:NetworkSolverSamples aggregated joint system state trajectories. This is an abstract method that must be implemented by concrete solver subclasses.- Overrides:
sampleSysAggrin classNetworkSolver- Parameters:
numEvents- the number of events to sample- Returns:
- result containing sampled aggregated joint system state trajectories
-
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
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
Get steady-state expected reward for all rewards.- Returns:
- Map from reward name to expected reward value
-
getAvgReward
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
Get the list of defined reward names.- Returns:
- List of reward names
-
clearRewardResult
public void clearRewardResult()Clear cached reward results to force recomputation. -
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
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
Get reward value function and state space for all rewards.- Returns:
- RewardResult containing all rewards
-
getTranReward
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
Get transient expected reward for all rewards.- Returns:
- Map from reward name to transient expected reward time series
-