LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::ctmc Namespace Reference

Classes

struct  CdfCurve
 A CDF as the reference returns it: the value at each point of the time grid. More...
struct  CtmcAnySolution
 A CTMC solve routed to whichever path the model's region rules require. More...
struct  CtmcAvg
 The mean performance metrics a stationary vector maps to. More...
struct  CtmcCftpOptions
 The knobs of one perfect-sampling run. More...
struct  CtmcCftpSolution
 What one cftp solve produces beside the means. More...
struct  CtmcChainSolution
struct  CtmcChainTransientSolution
struct  CtmcFirstPassage
 The answer of @@SolverCTMC/getCdfFirstPassT.m: the [F(t), t] curve with its grid, density and resolved state sets. More...
struct  CtmcFirstPassageMoments
 The answer of @@SolverCTMC/getFirstPassTMoments.m. More...
struct  CtmcGenerator
 [infGen, eventFilt, ev] of @@SolverCTMC/getGenerator.m. More...
struct  CtmcMddSolution
 What one mdd solve produces beside the means, i.e. More...
struct  CtmcOptions
 The SolverCTMC knobs this port honours. More...
struct  CtmcResult
 The generator, the state space it is indexed by, and the event rates. More...
struct  CtmcReward
 What the reward analyzer produces, per declared reward. More...
struct  CtmcSamplePath
 One sampled trajectory of the chain. More...
struct  CtmcSens
 What one sensitivity computation returns. More...
struct  CtmcSensParam
 The scalar parameter a sensitivity is taken with respect to. More...
struct  CtmcSensRank
 One row of the ranking table. More...
struct  CtmcSolution
 Everything one CTMC solve produces. More...
struct  CtmcStateSpace
 [stateSpace, localStateSpace] of @@SolverCTMC/getStateSpace.m. More...
struct  CtmcStationaryResult
struct  CtmcSymbolicGenerator
 The outputs of @@SolverCTMC/getSymbolicGenerator. More...
struct  CtmcSymbolicOptions
 Backend selection, mirroring options.config.symbolic and its timeout. More...
struct  CtmcSymbolicSolution
 What @@SolverCTMC/getSymbolicSolution.m returns, plus the engine that answered. More...
struct  CtmcTranProb
 The time-dependent answer of one getTranProb* query. More...
struct  CtmcTransient
 What one transient CTMC solve produces. More...
struct  EventOutcome
 What one event produces at one node: the successor rows, their rates and their probabilities, all three the same length. More...
struct  GlobalConstants
 The MATLAB GlobalConstants, as reported by lineStart at its defaults. More...
struct  NetState
 One network state: the per-stateful-node local rows it is composed of. More...
class  NetworkStruct
 A network plus its refreshed NetworkStruct. More...
struct  Sync
 One synchronization: an ACTIVE event and the PASSIVE event it drives. More...
struct  WaitqResult
 The chain the WAITQ walk produces, alongside the FIFOs its states carry. More...
struct  WaitqSolution
 A solved WAITQ model: the usual CTMC solution, plus what the FIFOs hold. More...
struct  WaitqState
 One augmented state: the network state, plus the token FIFO of every region. More...

Typedefs

template<class T>
using MarkovChainModel = lang::processes::MarkovChainModel<T>
 A user-supplied chain: a MarkovProcess when discrete is false, else a MarkovChain.

Enumerations

enum class  EventType
 The events a state can undergo, with the values of MATLAB EventType. More...
enum class  NodeType
 Node kinds, with the values of MATLAB NodeType. More...
enum class  SchedStrategy
 Scheduling disciplines, with the values of MATLAB SchedStrategy. More...
enum class  DropStrategy
 Blocking and loss rules, with the values of MATLAB DropStrategy. More...

Functions

template<class T>
CtmcStationaryResult< T > ctmc_stationary (const Matrix< T > &Q, std::size_t init_index=static_cast< std::size_t >(-1))
template<class T>
void make_infgen (Matrix< T > &Q)
 Port of ctmc_makeinfgen: turn an off-diagonal rate matrix into a generator.
template<class T>
Matrix< T > ctmc_state_space_aggr (const NetworkStruct< T > &sn, const std::vector< NetState< T > > &space)
 Port of StateSpaceAggr: the per-(station, class) job counts of every state, as an (nstates x nstations*nclasses) matrix in column block order (ist-1)*K + k.
template<class T>
Matrix< T > ctmc_gd_factor (const NetworkStruct< T > &sn, const std::vector< NetState< T > > &space)
 Tabulates the globally state-dependent rate scaling phi(n) declared through set_global_dependence, ONE evaluation per state.
template<class T>
std::vector< std::size_t > ctmc_find_vanishing_states (const NetworkStruct< T > &sn, const std::vector< NetState< T > > &space, const std::vector< qn::GlobalSync< T > > &gsync, bool isfjaug)
 Port of ctmc_find_vanishing_states (solver_ctmc.m:928): the indices of the VANISHING (zero-sojourn) global states.
template<class T>
CtmcResult< T > solver_ctmc (const NetworkStruct< T > &sn, const std::vector< NetState< T > > &space, const std::vector< Sync< T > > &sync, const std::vector< qn::GlobalSync< T > > &gsync=std::vector< qn::GlobalSync< T > >(), bool want_filtration=false, const std::vector< qn::FjSync< T > > &fjsync=std::vector< qn::FjSync< T > >())
 Port of the generator assembly of solver_ctmc.m.
template<class T>
void ctmc_eliminate_vanishing (CtmcResult< T > &res)
 Port of the "now remove immediate transitions" block of solver_ctmc.m (:812-870): eliminate the vanishing states by stochastic complementation.
template<class T>
std::vector< NetState< T > > reachable_space_generator (const NetworkStruct< T > &sn, const NetState< T > &init, const std::vector< Sync< T > > &sync, const std::vector< qn::GlobalSync< T > > &gsync=std::vector< qn::GlobalSync< T > >(), std::size_t maxst=3000000, const std::vector< qn::FjSync< T > > &fjsync=std::vector< qn::FjSync< T > >(), const std::vector< std::size_t > &cutoff=std::vector< std::size_t >(), const std::vector< std::vector< std::size_t > > &cutoff_mat=std::vector< std::vector< std::size_t > >())
 Port of State.reachableSpaceGenerator: the states reachable from init.
template<class T>
std::vector< bool > ctmc_signal_lossy (const NetworkStruct< T > &sn, const CtmcResult< T > &r, const std::vector< T > &p, std::size_t isf)
 Port of ctmc_signal_lossy: classes a G-network signal can annihilate here.
template<class T>
std::vector< T > ctmc_signal_busy (const NetworkStruct< T > &sn, std::size_t ist, const CtmcResult< T > &r, const std::vector< T > &p, std::size_t isf)
 Port of ctmc_signal_busy: the exact per-class busy-server fraction, read off the enumerated state space.
template<class T>
bool ctmc_all_phasetype (const NetworkStruct< T > &sn)
 MATLAB's all(sn.isph(:)), read off the matrices instead of off a flag.
template<class T>
CtmcAvg< T > solver_ctmc_avg_from_pi (const NetworkStruct< T > &sn, const CtmcResult< T > &r, const std::vector< T > &pivec)
 Port of solver_ctmc_avg_from_pi: map a state distribution to mean metrics.
std::vector< std::string > list_valid_methods ()
 Port of SolverCTMC.listValidMethods.
bool is_stateless_method (const std::string &method)
 True for a method whose analyzer is not the explicit-generator one.
void check_method (const std::string &method)
 Port of runAnalyzerChecks' method gate.
std::string method_fallback_warning (const std::string &method)
 The reference's fallback warning, or empty when the method needs none.
template<class T>
void ctmc_check_support (const NetworkStruct< T > &sn)
 Refuse the constructs this port generates a chain for but does not MODEL.
template<class T>
CtmcSolution< T > solve_struct (const NetworkStruct< T > &sn_in, const CtmcOptions &opt, const std::vector< qn::FjSync< T > > &fjsync)
 Build the chain of ONE struct, solve it, reduce it.
template<class T>
CtmcSolution< T > solver_ctmc_analyzer (const NetworkStruct< T > &sn_in, const CtmcOptions &opt)
 Port of solver_ctmc_analyzer.m plus the fork-join wrapper of @@SolverCTMC/runAnalyzer.m.
template<class T>
mva::AvgResult< T > solver_ctmc_avg_table (const NetworkStruct< T > &sn, const CtmcSolution< T > &d, const std::string &method)
 Port of @@SolverCTMC/runAnalyzer.m's result assembly: solve, then apply the metric filter @@NetworkSolver/getAvg puts between the analyzer and the caller, so the table is the same shape SolverMVA and SolverNC print.
template<class T>
mva::AvgResult< T > solver_ctmc_run_analyzer (const NetworkStruct< T > &sn, const CtmcOptions &opt)
 Solve and format in one call, for a caller with no use for the chain.
template<class T>
mva::AvgResult< T > solver_ctmc_chain_aggregation (const NetworkStruct< T > &sn, const CtmcOptions &opt)
 Solve the CHAIN-AGGREGATED model and map its metrics back to the classes.
template<class T>
mva::AvgResult< T > solver_ctmc_load_concealment (const NetworkStruct< T > &sn, const CtmcOptions &opt)
 Solve by LOAD CONCEALMENT, the iterated transformation.
template<class T>
mva::AvgResult< T > solver_ctmc_fes_aggregation (const NetworkStruct< T > &sn, const CtmcOptions &opt)
 Solve with a station subset replaced by a FLOW-EQUIVALENT SERVER, then recover the collapsed stations' own metrics by conditioning.
template<class T>
std::vector< std::vector< CdfCurve< T > > > solver_ctmc_cdf_respt (const NetworkStruct< T > &sn, const CtmcOptions &opt)
 Port of @@SolverCTMC/getCdfRespT.m: the per-(station, class) response-time CDF, indexed [ist-1][r-1].
template<class T>
std::vector< CdfCurve< T > > solver_ctmc_cdf_sys_respt (const NetworkStruct< T > &sn, const CtmcOptions &opt)
 Port of @@SolverCTMC/getCdfSysRespT.m: the per-chain SYSTEM response-time CDF, indexed by chain.
template<class T>
std::string solver_ctmc_cftp_supports (const NetworkStruct< T > &sn)
 The cftp model-class gate as a public predicate.
template<class T>
CtmcCftpSolution< T > solver_ctmc_cftp (const NetworkStruct< T > &sn, const CtmcOptions &opt, const CtmcCftpOptions &cftpopt)
 Solve with the cftp / cftp.approx method.
template<class T>
mva::AvgResult< T > solver_ctmc_cftp_run_analyzer (const NetworkStruct< T > &sn, const CtmcOptions &opt, const CtmcCftpOptions &cftpopt)
 Solve with cftp and format, for a caller with no use for the sampled states.
template<class T>
CtmcChainSolution< T > solver_ctmc_chain (const MarkovChainModel< T > &chain)
 Steady-state analysis of a user-supplied Markov chain.
template<class T>
CtmcChainTransientSolution< T > solver_ctmc_chain_transient (const MarkovChainModel< T > &chain, const std::vector< T > &pi0in, const T &t0in, const T &t1)
 Transient distribution of a user-supplied Markov chain over [t0,t1].
template<class T>
void ctmc_check_region_rules (const NetworkStruct< T > &sn)
 Refuse the region rules this port does not implement.
template<class T>
bool ctmc_region_admissible (const NetworkStruct< T > &sn, const std::vector< T > &nir)
 True when nir – the per-(station, class) counts of one state, in (ist-1)*K + k order – satisfies every region.
template<class T>
std::vector< NetState< T > > ctmc_filter_regions (const NetworkStruct< T > &sn, const std::vector< NetState< T > > &space)
 The states of space a DROP region admits, in their original order.
template<class T>
std::vector< bool > ctmc_in_drop_region (const NetworkStruct< T > &sn)
 True where a class sits at a station inside a DROP region, per station.
template<class T>
Matrix< T > ctmc_get_start_rate (const NetworkStruct< T > &sn, const CtmcOptions &opt)
 SolverCTMC.getStartRate and getPreemptRate: the DERIVED rates the START/PREEMPT filtration reduces to.
template<class T>
Matrix< T > ctmc_get_start_rate (const NetworkStruct< T > &, const CtmcSolution< T > &d)
 As above, for a caller whose solution already carries the filtration.
template<class T>
Matrix< T > ctmc_get_preempt_rate (const NetworkStruct< T > &sn, const CtmcOptions &opt)
 SolverCTMC.getPreemptRate; see ctmc_get_start_rate.
template<class T>
Matrix< T > ctmc_get_preempt_rate (const NetworkStruct< T > &, const CtmcSolution< T > &d)
 As above, for a caller whose solution already carries the filtration.
template<class T>
CtmcGenerator< T > ctmc_get_generator (const NetworkStruct< T > &sn, const CtmcSolution< T > &d)
 Port of @@SolverCTMC/getGenerator.m: the generator, its event filtration and the synchronization list the filtration is indexed by.
template<class T>
CtmcGenerator< T > ctmc_get_generator (const NetworkStruct< T > &sn, const CtmcOptions &opt)
 As above, solving the chain first.
template<class T>
CtmcGenerator< T > ctmc_get_infgen (const NetworkStruct< T > &sn, const CtmcSolution< T > &d)
 @@SolverCTMC/getInfGen.m, a pure alias of getGenerator in the reference.
template<class T>
CtmcGenerator< T > ctmc_get_infgen (const NetworkStruct< T > &sn, const CtmcOptions &opt)
 @@SolverCTMC/getInfGen.m, solving the chain first.
template<class T>
CtmcStateSpace< T > ctmc_get_state_space (const NetworkStruct< T > &, const CtmcSolution< T > &d)
 Port of @@SolverCTMC/getStateSpace.m.
template<class T>
CtmcStateSpace< T > ctmc_get_state_space (const NetworkStruct< T > &sn, const CtmcOptions &opt)
 As above, solving the chain first.
template<class T>
CtmcFirstPassage ctmc_cdf_firstpasst (const NetworkStruct< T > &, const CtmcSolution< T > &d, const Matrix< double > &A, const Matrix< double > &B, const std::string &method="expm")
 Port of @@SolverCTMC/getCdfFirstPassT.m: the distribution of the FIRST PASSAGE TIME from state set A into state set B, on the CTMC underlying the model.
template<class T>
CtmcFirstPassage ctmc_cdf_firstpasst (const NetworkStruct< T > &sn, const CtmcOptions &opt, const Matrix< double > &A, const Matrix< double > &B, const std::string &method="expm")
 As above, solving the chain first.
template<class T>
CtmcFirstPassageMoments< T > ctmc_firstpasst_moments (const NetworkStruct< T > &, const CtmcSolution< T > &d, const Matrix< double > &A, const Matrix< double > &B, std::size_t nmax=3)
 Port of @@SolverCTMC/getFirstPassTMoments.m: moments of order 1..nmax of the first passage time from state set A into state set B.
template<class T>
CtmcFirstPassageMoments< T > ctmc_firstpasst_moments (const NetworkStruct< T > &sn, const CtmcOptions &opt, const Matrix< double > &A, const Matrix< double > &B, std::size_t nmax=3)
 As above, solving the chain first.
template<class T>
Matrix< T > ctmc_get_state_space_aggr (const NetworkStruct< T > &sn, const CtmcOptions &opt)
 Port of @@SolverCTMC/getStateSpaceAggr.m: the per-(station, class) job counts of every state, in column block order (ist-1)*K + k.
template<class T>
Matrix< T > ctmc_get_state_space_aggr (const NetworkStruct< T > &sn, const CtmcSolution< T > &d)
 As above, for a caller who has already solved the chain.
template<class T>
CtmcTranProb< T > ctmc_get_tran_prob (const NetworkStruct< T > &sn, const CtmcTransient< T > &tr, std::size_t ind)
 Port of @@SolverCTMC/getTranProb.m: pi(t) over the whole chain, labelled by one node's local state.
template<class T>
CtmcTranProb< T > ctmc_get_tran_prob (const NetworkStruct< T > &sn, const CtmcOptions &opt, std::size_t ind, const T &t0, const T &t1)
 As above, integrating the forward equation first.
template<class T>
CtmcTranProb< T > ctmc_get_tran_prob_aggr (const NetworkStruct< T > &sn, const CtmcTransient< T > &tr, std::size_t ind)
 Port of @@SolverCTMC/getTranProbAggr.m: pi(t), labelled by one node's per-class job counts.
template<class T>
CtmcTranProb< T > ctmc_get_tran_prob_aggr (const NetworkStruct< T > &sn, const CtmcOptions &opt, std::size_t ind, const T &t0, const T &t1)
 As above, integrating the forward equation first.
template<class T>
CtmcTranProb< T > ctmc_get_tran_prob_sys (const NetworkStruct< T > &sn, const CtmcTransient< T > &tr)
 Port of @@SolverCTMC/getTranProbSys.m: pi(t), labelled by the whole network state with its phases.
template<class T>
CtmcTranProb< T > ctmc_get_tran_prob_sys (const NetworkStruct< T > &sn, const CtmcOptions &opt, const T &t0, const T &t1)
 As above, integrating the forward equation first.
template<class T>
CtmcTranProb< T > ctmc_get_tran_prob_sys_aggr (const NetworkStruct< T > &sn, const CtmcTransient< T > &tr)
 Port of @@SolverCTMC/getTranProbSysAggr.m: pi(t), labelled by the network's per-(station, class) job counts.
template<class T>
CtmcTranProb< T > ctmc_get_tran_prob_sys_aggr (const NetworkStruct< T > &sn, const CtmcOptions &opt, const T &t0, const T &t1)
 As above, integrating the forward equation first.
template<class T>
sim::AsymVarResult< T > ctmc_get_asymptotic_variance (const NetworkStruct< T > &sn, const CtmcOptions &opt, const std::function< T(const NetState< T > &)> &reward)
 Port of @@SolverCTMC/getAsymptoticVariance.m: the asymptotic variance of the time-average of a reward along a sample path of this model's CTMC.
template<class T>
std::string solver_ctmc_mdd_supports (const NetworkStruct< T > &sn)
 Can the mdd decision-diagram method be asked for this model?
template<class T>
CtmcMddSolution< T > solver_ctmc_mdd_analyzer (const NetworkStruct< T > &sn, const CtmcOptions &opt, const mdd::MddMcdOptions &mcdopt=mdd::MddMcdOptions())
 Solve with the mdd method.
template<class T>
mva::AvgResult< T > solver_ctmc_mdd_run_analyzer (const NetworkStruct< T > &sn, const CtmcOptions &opt, const mdd::MddMcdOptions &mcdopt=mdd::MddMcdOptions())
 Solve with mdd and format, so a caller with no use for the diagram has one call.
template<class T>
void assert_phase_type_states (const NetworkStruct< T > &sn, const std::string &what)
 Port of @@SolverCTMC/assertPhaseTypeStates: refuse a query whose answer would be a per-state probability under a matrix-exponential process.
template<class T>
solver_ctmc_joint (const NetworkStruct< T > &sn, const CtmcSolution< T > &d, const NetState< T > &state)
 Port of solver_ctmc_joint: P(the network is in exactly state).
template<class T>
solver_ctmc_jointaggr (const NetworkStruct< T > &sn, const CtmcSolution< T > &d, const NetState< T > &state)
 Port of solver_ctmc_jointaggr: P(the network holds exactly these per-class counts), summed over every phase and buffer arrangement that realizes them.
template<class T>
std::vector< T > solver_ctmc_marg (const NetworkStruct< T > &sn, const CtmcSolution< T > &d, const NetState< T > &state)
 Port of solver_ctmc_marg: per STATION, P(that station is in exactly its local slice of state), marginalized over every other node.
template<class T>
std::vector< T > solver_ctmc_margaggr (const NetworkStruct< T > &sn, const CtmcSolution< T > &d, const NetState< T > &state)
 Port of solver_ctmc_margaggr: per STATION, P(that station holds exactly these per-class counts).
template<class T>
std::vector< T > solver_ctmc_ratecomplement (const Matrix< T > &D, const std::vector< std::size_t > &nonimm, const std::vector< std::size_t > &imm, const Matrix< T > &Q12, const Matrix< T > &Q22)
 Port of solver_ctmc_ratecomplement: the long-run rate of an action as seen from each TANGIBLE state, given the action's rate filter D.
template<class T>
CtmcReward< T > solver_ctmc_reward (const NetworkStruct< T > &sn, const CtmcOptions &opt, std::size_t tmax=1000)
 Port of solver_ctmc_reward.m.
template<class T>
std::vector< std::vector< T > > solver_ctmc_tran_reward (const NetworkStruct< T > &sn, const CtmcOptions &opt, const T &t0, const T &t1, std::vector< T > *tout=nullptr, std::vector< std::string > *names=nullptr)
 Port of @@SolverCTMC/getTranReward: E[r(X(t))] = sum_s pi_t(s) r(s).
template<class T>
std::vector< T > solver_ctmc_avg_reward (const NetworkStruct< T > &sn, const CtmcOptions &opt, std::vector< std::string > *names=nullptr)
 Port of @@SolverCTMC/getAvgReward: the steady-state expected rewards.
template<class T>
CtmcSamplePath< T > solver_ctmc_sample_sys (const NetworkStruct< T > &sn, const CtmcOptions &opt_in, std::size_t nevents, unsigned long seed=23000)
 Port of @@SolverCTMC/sampleSys: a marked walk on the whole network state.
template<class T>
Matrix< T > solver_ctmc_sample_sys_aggr (const NetworkStruct< T > &sn, const CtmcSamplePath< T > &path)
 Port of @@SolverCTMC/sampleSysAggr: the same walk, reported as per-(station, class) job counts rather than as detailed states.
template<class T>
Matrix< T > solver_ctmc_sample (const NetworkStruct< T > &sn, const CtmcSamplePath< T > &path, std::size_t ind)
 Port of @@SolverCTMC/sample: the walk restricted to ONE stateful node's local block.
template<class T>
Matrix< T > solver_ctmc_sample_aggr (const NetworkStruct< T > &sn, const CtmcSamplePath< T > &path, std::size_t ind)
 Port of @@SolverCTMC/sampleAggr: one node's per-class counts over time.
template<class T>
CtmcSens< T > solver_ctmc_sensitivity (const NetworkStruct< T > &sn, const CtmcOptions &opt, const CtmcSensParam< T > &param, const std::vector< T > &reward=std::vector< T >(), const std::string &method="fd", const CtmcSymbolicOptions &symopt=CtmcSymbolicOptions())
 Port of @@SolverCTMC/getSensitivity.
template<class T>
std::vector< CtmcSensRank< T > > solver_ctmc_sensitivity_ranking (const NetworkStruct< T > &sn, const CtmcOptions &opt, const std::vector< CtmcSensParam< T > > &params, const std::vector< T > &reward)
 Port of @@SolverCTMC/getSensitivityRanking: rank parameters by influence.
template<class T>
CtmcSymbolicGenerator< T > ctmc_symbolic_generator (const NetworkStruct< T > &sn, const CtmcOptions &opt, bool invert_symbol=false)
 Port of @@SolverCTMC/getSymbolicGenerator.m.
template<class T>
Matrix< T > ctmc_symbolic_eval_infgen (const CtmcSymbolicGenerator< T > &g, const std::vector< T > &x)
 Evaluates the symbolic generator at a symbol assignment, the twin of the JAR's evalInfGen.
template<class T>
CtmcSymbolicSolution< T > ctmc_symbolic_solution (const NetworkStruct< T > &sn, const CtmcOptions &opt, const CtmcSymbolicOptions &symopt=CtmcSymbolicOptions())
 Port of @@SolverCTMC/getSymbolicSolution.m: pi Q = 0 with sum(pi) = 1 over the field of rational functions in x1..xE.
template<class T>
CtmcTransient< T > solver_ctmc_transient_analyzer (const NetworkStruct< T > &sn, const CtmcOptions &opt, const T &t0, const T &t1, const std::vector< T > &grid=std::vector< T >())
 Port of solver_ctmc_transient_analyzer.m.
template<class T>
bool ctmc_has_waitq_region (const NetworkStruct< T > &sn)
 True when the model declares a region that applies anything other than DROP.
template<class T>
void ctmc_check_waitq_support (const NetworkStruct< T > &sn)
 The combinations the reference gates, plus the two this port cannot represent.
template<class T>
WaitqResult< T > solver_ctmc_waitq (const NetworkStruct< T > &sn, const CtmcOptions &opt)
 Port of the reachability walk of solver_ctmc_fcr_waitq.m.
template<class T>
std::vector< T > ctmc_waitq_parked (const NetworkStruct< T > &sn, const WaitqResult< T > &r, const std::vector< T > &pi)
 The mean number of parked jobs per class, over a stationary law.
template<class T>
WaitqSolution< T > solver_ctmc_waitq_analyzer (const NetworkStruct< T > &sn, const CtmcOptions &opt)
 Build the WAITQ chain, solve it, and map it onto the same means every other CTMC path reports.
template<class T>
CtmcAnySolution< T > solver_ctmc_analyzer_any (const NetworkStruct< T > &sn, const CtmcOptions &opt)
 The entry point a caller who does not know which path a model needs should use: pick the WAITQ walk when a region asks for anything other than DROP, and the lattice analyzer otherwise.
template<class T>
mva::AvgResult< T > solver_ctmc_run_analyzer_any (const NetworkStruct< T > &sn, const CtmcOptions &opt)
 Solve on whichever path applies and format, mirroring solver_ctmc_run_analyzer.

Variables

static const double kArcTol = 1e-12
 Magnitude above which an off-diagonal generator entry counts as an arc.
constexpr std::size_t CTMC_DEFAULT_CUTOFF = 10
 SolverOptions.m:107: the per-class state-space cutoff SolverCTMC defaults an open or mixed model to.

Typedef Documentation

◆ MarkovChainModel

A user-supplied chain: a MarkovProcess when discrete is false, else a MarkovChain.

Definition at line 57 of file solver_ctmc_chain.h.

Enumeration Type Documentation

◆ DropStrategy

enum class line::lang::DropStrategy
strong

Blocking and loss rules, with the values of MATLAB DropStrategy.

WAITQ is -1 and is also the marker refreshCapacity writes where the rule is never consulted (an unbounded station, or a closed class), so it means two different things depending on the station's capacity; see the comment in refresh_capacity().

Definition at line 424 of file lang_types.h.

◆ EventType

enum class line::lang::EventType
strong

The events a state can undergo, with the values of MATLAB EventType.

An event is ACTIVE at the node that schedules it and PASSIVE at the node that receives it: a DEP at one station is the ARV at the next, and only the active half carries a rate. The passive half is marked with a rate of -1, which the generator assembly replaces with the active rate – a convention that only reads as a sentinel because a rate can never be negative.

Definition at line 111 of file lang_types.h.

◆ NodeType

enum class line::lang::NodeType
strong

Node kinds, with the values of MATLAB NodeType.

Definition at line 324 of file lang_types.h.

◆ SchedStrategy

enum class line::lang::SchedStrategy
strong

Scheduling disciplines, with the values of MATLAB SchedStrategy.

Definition at line 181 of file lang_types.h.

Function Documentation

◆ assert_phase_type_states()

template<class T>
void line::ctmc::assert_phase_type_states ( const NetworkStruct< T > & sn,
const std::string & what )

Port of @@SolverCTMC/assertPhaseTypeStates: refuse a query whose answer would be a per-state probability under a matrix-exponential process.

A matrix-exponential embeds in the generator with POSITIVE off-diagonal entries in D0 (equivalently a signed entry vector), so the stationary vector is a SIGNED measure: only its aggregates over each phase block are probabilities. Mean measures stay exact, being linear in that vector, but a per-state or transient answer is not a probability at all, and uniformization – a Poisson mixture of powers of I + Q/lambda – diverges on a signed generator. Such queries are refused rather than answered with a number that looks like a probability.

THE TEST IS ON THE MATRICES, not on a flag. MATLAB carries sn.isph, which this NetworkStruct has no counterpart for; the property it records is exactly "D0 has no positive off-diagonal and D1 is non-negative", so that is what is checked here rather than a field being invented to hold the answer.

Definition at line 63 of file solver_ctmc_prob.h.

References assert_phase_type_states(), ctmc_all_phasetype(), and line::UnsupportedError::UnsupportedError().

Referenced by assert_phase_type_states(), ctmc_get_tran_prob(), ctmc_get_tran_prob(), ctmc_get_tran_prob_aggr(), ctmc_get_tran_prob_aggr(), ctmc_get_tran_prob_sys(), ctmc_get_tran_prob_sys(), ctmc_get_tran_prob_sys_aggr(), ctmc_get_tran_prob_sys_aggr(), solver_ctmc_joint(), solver_ctmc_jointaggr(), solver_ctmc_marg(), solver_ctmc_margaggr(), and solver_ctmc_sample_sys().

◆ check_method()

void line::ctmc::check_method ( const std::string & method)
inline

Port of runAnalyzerChecks' method gate.

gpu IS ACCEPTED AND FALLS BACK, because that is what the reference does. ctmc_solve.m:224-238 wraps the gpuArray solve in a try/catch and, when the GPU is absent or the solve throws, warns "GPU either not available or execution failed. Switching to default method." and runs the same Qnnz' \ bnnz the default takes. A host with no Parallel Computing Toolbox therefore gets the EXACT answer from SolverCTMC(model,'gpu'), and refusing it here made a model MATLAB answers unanswerable under lang='cpp'. The fallback is reported through CtmcSolution::warning rather than silently, so a caller still learns the named backend did not run.

mdd and cftp ARE refused here, because reaching THIS analyzer with one of those names means the caller routed a generator-free method into the generator path: the answer would be the enumerated one under a reported method that never ran. Their own entry points do not call this gate.

Definition at line 264 of file solver_ctmc_analyzer.h.

References check_method(), is_stateless_method(), list_valid_methods(), and line::UnsupportedError::UnsupportedError().

Referenced by check_method(), solver_ctmc_analyzer(), solver_ctmc_transient_analyzer(), and solver_ctmc_waitq_analyzer().

◆ ctmc_all_phasetype()

template<class T>
bool line::ctmc::ctmc_all_phasetype ( const NetworkStruct< T > & sn)

MATLAB's all(sn.isph(:)), read off the matrices instead of off a flag.

False as soon as one station-class process is a matrix exponential: its D0 carries negative off-diagonal entries, or its D1 negative entries, neither of which a phase-type has. A Source keeps its arrival process in sn.service, so this one scan covers arrivals and services alike.

Definition at line 1339 of file solver_ctmc.h.

References ctmc_all_phasetype(), line::lang::Distrib< T >::D0, line::lang::Distrib< T >::D1, and line::lang::Distrib< T >::disabled.

Referenced by assert_phase_type_states(), ctmc_all_phasetype(), and solver_ctmc_avg_from_pi().

◆ ctmc_cdf_firstpasst() [1/2]

template<class T>
CtmcFirstPassage line::ctmc::ctmc_cdf_firstpasst ( const NetworkStruct< T > & ,
const CtmcSolution< T > & d,
const Matrix< double > & A,
const Matrix< double > & B,
const std::string & method = "expm" )

Port of @@SolverCTMC/getCdfFirstPassT.m: the distribution of the FIRST PASSAGE TIME from state set A into state set B, on the CTMC underlying the model.

An empty A starts from the conditional stationary law on the complement of B.

THIS IS NOT getCdfRespT. That getter times a tagged job between an arrival at a station and its departure, through the event filtration; this one times the chain between two sets of states the caller names, and answers questions the filtration cannot express – the writer cycle time of a readers-writers model, the time to fill a buffer, the time to leave a degraded region.

Reference: P. G. Harrison and W. J. Knottenbelt, "Passage Time Distributions in Large Markov Chains", 2002.

Definition at line 422 of file solver_ctmc_getters.h.

References line::ctmc::CtmcSolution< T >::chain, ctmc_cdf_firstpasst(), line::mc::ctmc_passage_time(), line::ctmc::CtmcFirstPassage::F, line::mc::PassageCurve< T >::F, line::ctmc::CtmcFirstPassage::f, line::mc::PassageCurve< T >::f, line::ctmc::GlobalConstants::FineTol, line::InputError::InputError(), line::Matrix< T >::rows(), line::ctmc::CtmcFirstPassage::source, line::ctmc::CtmcFirstPassage::t, and line::ctmc::CtmcFirstPassage::target.

Referenced by ctmc_cdf_firstpasst(), and ctmc_cdf_firstpasst().

◆ ctmc_cdf_firstpasst() [2/2]

template<class T>
CtmcFirstPassage line::ctmc::ctmc_cdf_firstpasst ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
const Matrix< double > & A,
const Matrix< double > & B,
const std::string & method = "expm" )

As above, solving the chain first.

Definition at line 469 of file solver_ctmc_getters.h.

References ctmc_cdf_firstpasst(), and solver_ctmc_analyzer().

◆ ctmc_check_region_rules()

template<class T>
void line::ctmc::ctmc_check_region_rules ( const NetworkStruct< T > & sn)

Refuse the region rules this port does not implement.

WAITQ needs the per-region token FIFO described above; BAS, BBS and RSRD are blocking rules whose held-job marker this generator does not carry either. Each is named so a caller learns which rule stopped it rather than seeing a region silently behave as DROP.

Definition at line 57 of file solver_ctmc_fcr.h.

References ctmc_check_region_rules(), and line::UnsupportedError::UnsupportedError().

Referenced by ctmc_check_region_rules(), and ctmc_filter_regions().

◆ ctmc_check_support()

template<class T>
void line::ctmc::ctmc_check_support ( const NetworkStruct< T > & sn)

Refuse the constructs this port generates a chain for but does not MODEL.

WHY A GATE AND NOT A TODO. A construct this port generates a chain for but does not MODEL comes back as a complete, plausible AvgTable computed from a chain that is not the model's, and a caller has no way to tell. Where the reference declares the construct supported, silence here would show two different answers with no indication which is wrong.

As of this change the list is empty of structural gaps: fork-join goes through fj_tag, class and joint dependence through cd_factor, and BAS through the blocked marker. What remains are the DECLARATION defects below – a dependence handle with no peak – plus the refusals stated by name elsewhere (getSymbolicGenerator, a matrix-exponential getProb, getCdfRespT on an open model, and every region rule but DROP and WAITQ).

Definition at line 299 of file solver_ctmc_analyzer.h.

References ctmc_check_support(), line::InputError::InputError(), and line::UnsupportedError::UnsupportedError().

Referenced by ctmc_check_support(), solver_ctmc_analyzer(), and solver_ctmc_analyzer_any().

◆ ctmc_check_waitq_support()

template<class T>
void line::ctmc::ctmc_check_waitq_support ( const NetworkStruct< T > & sn)

The combinations the reference gates, plus the two this port cannot represent.

The first three are the reference's own: each needs a semantics for what a parked token means that the reference declines to define. The last two are this port's, and both are about state that does not exist here rather than about semantics.

Definition at line 741 of file solver_ctmc_waitq.h.

References ctmc_check_waitq_support(), line::lang::DISABLED, line::qn::NodeDef::name, line::lang::PROB, line::lang::RAND, line::qn::NodeDef::routing, and line::UnsupportedError::UnsupportedError().

Referenced by ctmc_check_waitq_support(), and solver_ctmc_waitq().

◆ ctmc_eliminate_vanishing()

template<class T>
void line::ctmc::ctmc_eliminate_vanishing ( CtmcResult< T > & res)

Port of the "now remove immediate transitions" block of solver_ctmc.m (:812-870): eliminate the vanishing states by stochastic complementation.

WHAT IT CHANGES AND WHAT IT MUST NOT. The chain shrinks to its TANGIBLE states and every metric read from it is unchanged to the digits printed, because the vanishing states carry ~1e-8 of the mass – which is exactly why the omission was invisible until a caller asked for the chain itself. -a states and -a gen are the callers that see it: on fj_tiny_closed this takes the six enumerated states to the four the other three codebases return.

THE RATE COMPLEMENT IS NOT OPTIONAL. An action that fires ONLY from vanishing states – a fork firing, a join rendezvous, an immediate SPN mode – has no tangible row to be read off, so restricting arv_rates / dep_rates to the tangible states alone would silently zero its flow. The rate observed from a tangible state is its own plus the expected number of firings along the vanishing excursion entered from it,

r = total(nonimm) + Q12 (-Q22)^-1 imm_part(imm),

which is solver_ctmc_ratecomplement applied to the immediate part and added to the plain restriction of the total. The two agree term by term with the reference's per-filtration form, since the totals are already the row sums.

A no-op when the model declared no immediate source, which is the common case.

Definition at line 930 of file solver_ctmc.h.

References line::ctmc::CtmcResult< T >::arv_rates, line::ctmc::CtmcResult< T >::arv_rates_imm, ctmc_eliminate_vanishing(), line::mc::ctmc_stochcomp(), line::ctmc::CtmcResult< T >::dep_rates, line::ctmc::CtmcResult< T >::dep_rates_imm, line::Matrix< T >::Matrix(), line::NumericError::NumericError(), line::ctmc::CtmcResult< T >::Q, line::mc::StochCompResult< T >::Q12, line::mc::StochCompResult< T >::Q22, line::ctmc::CtmcResult< T >::Qimm, line::mc::StochCompResult< T >::S, line::ctmc::CtmcResult< T >::space, and line::ctmc::CtmcResult< T >::vanishing.

Referenced by ctmc_eliminate_vanishing(), and solve_struct().

◆ ctmc_filter_regions()

template<class T>
std::vector< NetState< T > > line::ctmc::ctmc_filter_regions ( const NetworkStruct< T > & sn,
const std::vector< NetState< T > > & space )

The states of space a DROP region admits, in their original order.

Order is preserved so the caller can restrict the arrival and departure rate arrays with the same index set; reordering here would silently misalign them.

Definition at line 138 of file solver_ctmc_fcr.h.

References line::Matrix< T >::cols(), ctmc_check_region_rules(), ctmc_filter_regions(), ctmc_region_admissible(), ctmc_state_space_aggr(), and line::UnsupportedError::UnsupportedError().

Referenced by ctmc_filter_regions(), solve_struct(), and line::ssa::solver_ssa_reachability().

◆ ctmc_find_vanishing_states()

template<class T>
std::vector< std::size_t > line::ctmc::ctmc_find_vanishing_states ( const NetworkStruct< T > & sn,
const std::vector< NetState< T > > & space,
const std::vector< qn::GlobalSync< T > > & gsync,
bool isfjaug )

Port of ctmc_find_vanishing_states (solver_ctmc.m:928): the indices of the VANISHING (zero-sojourn) global states.

A state is vanishing when the model leaves it at the GlobalConstants Immediate scale rather than at a modelled rate, so its sojourn is an artefact of realising "instantaneous" as a very fast exponential. Four sources, which are the whole list:

  • a Router or Fork holding a job. Neither performs service: the job is in transit and leaves on the next event.
  • a Join whose sibling set is COMPLETE for some original class, so the rendezvous can fire. Only on an FJ-augmented struct – without the tag classes a Join buffers nothing and its departures are timed elsewhere.
  • an SPN marking from which an ENABLE moves the Transition's own row.
  • an SPN marking enabling a TimingStrategy::IMMEDIATE firing mode.

The same predicate drives BOTH the vanishing-row purge and the stochastic complementation, which is why it is one function: a row purged as vanishing and then left in the chain would carry only its immediate arcs and dominate the stationary vector with a 1e-8 sojourn, and a row complemented out without being purged would push its timed arcs into the tangible states.

Returns
0-based row indices, ascending and unique

Definition at line 400 of file solver_ctmc.h.

References line::qn::after_event_join(), line::qn::after_global_event(), ctmc_find_vanishing_states(), line::qn::ModeEvent< T >::event, line::lang::IMMEDIATE, line::qn::ModeEvent< T >::mode, line::qn::ModeEvent< T >::node, line::qn::GlobalOutcome< T >::rate, line::qn::EventOutcome< T >::space, line::qn::GlobalOutcome< T >::space, and line::qn::to_marginal_aggr().

Referenced by ctmc_find_vanishing_states(), and solver_ctmc().

◆ ctmc_firstpasst_moments() [1/2]

template<class T>
CtmcFirstPassageMoments< T > line::ctmc::ctmc_firstpasst_moments ( const NetworkStruct< T > & ,
const CtmcSolution< T > & d,
const Matrix< double > & A,
const Matrix< double > & B,
std::size_t nmax = 3 )

Port of @@SolverCTMC/getFirstPassTMoments.m: moments of order 1..nmax of the first passage time from state set A into state set B.

NO TRANSFORM INVERSION AND NO TIME GRID ARE INVOLVED. The moments come from Eq. 3 of Harrison and Knottenbelt (2002) – one linear solve per order – so they are EXACT and are not limited by the horizon a CDF would have to be truncated at. That is the whole reason this getter exists beside ctmc_cdf_firstpasst: the variance or the skewness of a passage time costs nmax solves here and a numerical integration of a truncated curve there.

mall is zero on B and infinite where B cannot be reached, as the reference reports it. A and B name states as in ctmc_cdf_firstpasst.

Definition at line 499 of file solver_ctmc_getters.h.

References line::ctmc::CtmcSolution< T >::chain, ctmc_firstpasst_moments(), line::mc::ctmc_passage_moments(), line::InputError::InputError(), line::ctmc::CtmcFirstPassageMoments< T >::m, line::mc::PassageMoments< T >::m, line::ctmc::CtmcFirstPassageMoments< T >::mall, line::mc::PassageMoments< T >::mall, line::Matrix< T >::rows(), line::ctmc::CtmcFirstPassageMoments< T >::source, and line::ctmc::CtmcFirstPassageMoments< T >::target.

Referenced by ctmc_firstpasst_moments(), and ctmc_firstpasst_moments().

◆ ctmc_firstpasst_moments() [2/2]

template<class T>
CtmcFirstPassageMoments< T > line::ctmc::ctmc_firstpasst_moments ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
const Matrix< double > & A,
const Matrix< double > & B,
std::size_t nmax = 3 )

As above, solving the chain first.

Definition at line 534 of file solver_ctmc_getters.h.

References ctmc_firstpasst_moments(), and solver_ctmc_analyzer().

◆ ctmc_gd_factor()

template<class T>
Matrix< T > line::ctmc::ctmc_gd_factor ( const NetworkStruct< T > & sn,
const std::vector< NetState< T > > & space )

Tabulates the globally state-dependent rate scaling phi(n) declared through set_global_dependence, ONE evaluation per state.

Returns an (nstates x nstations*nclasses) matrix, row-major in (station, class), of the scaling applying at each state; empty when the model declares no global dependence. Evaluating once per state rather than per transition is the whole point: phi may be expensive (a bandwidth-sharing allocation solves a convex program per call), and within a state it is a CONSTANT multiplying every rate there, which is why it factors out of the generator assembly below.

Definition at line 344 of file solver_ctmc.h.

References ctmc_gd_factor(), ctmc_state_space_aggr(), line::InputError::InputError(), and line::Matrix< T >::Matrix().

Referenced by ctmc_gd_factor(), and solver_ctmc().

◆ ctmc_get_asymptotic_variance()

template<class T>
sim::AsymVarResult< T > line::ctmc::ctmc_get_asymptotic_variance ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
const std::function< T(const NetState< T > &)> & reward )

Port of @@SolverCTMC/getAsymptoticVariance.m: the asymptotic variance of the time-average of a reward along a sample path of this model's CTMC.

WHAT IT IS FOR. A simulation estimate of a steady-state mean has a standard error that shrinks like sqrt(sigma^2/t), where sigma^2 is NOT the stationary variance of the reward but its ASYMPTOTIC variance, which also carries the autocorrelation of the path. That number is what says how long a run has to be, and sim_runlength turns it into a run length for a target precision. It cannot be guessed from the stationary variance: on M/M/1 the two differ by a factor that blows up like (1-rho)^-2.

The reward is a function of the state ROW, evaluated on the state space the generator was built from.

Definition at line 801 of file solver_ctmc_getters.h.

References ctmc_get_asymptotic_variance(), ctmc_get_generator(), line::ctmc::CtmcGenerator< T >::Q, line::sim::sim_asymvar_ctmc(), and line::ctmc::CtmcGenerator< T >::space.

Referenced by ctmc_get_asymptotic_variance().

◆ ctmc_get_generator() [1/2]

template<class T>
CtmcGenerator< T > line::ctmc::ctmc_get_generator ( const NetworkStruct< T > & sn,
const CtmcOptions & opt )

As above, solving the chain first.

keep_filtration is forced on because the filtration is half the answer and cannot be reconstructed afterwards; a caller who only wants Q should read CtmcSolution::chain instead and not pay for one n x n matrix per event.

Definition at line 298 of file solver_ctmc_getters.h.

References ctmc_get_generator(), line::ctmc::CtmcOptions::keep_filtration, and solver_ctmc_analyzer().

◆ ctmc_get_generator() [2/2]

template<class T>
CtmcGenerator< T > line::ctmc::ctmc_get_generator ( const NetworkStruct< T > & sn,
const CtmcSolution< T > & d )

Port of @@SolverCTMC/getGenerator.m: the generator, its event filtration and the synchronization list the filtration is indexed by.

The synchronization list is rebuilt rather than carried, refresh_sync being a pure function of the struct: it returns the same list, in the same order, that indexed filt when the generator was assembled.

Definition at line 274 of file solver_ctmc_getters.h.

References line::ctmc::CtmcSolution< T >::chain, ctmc_get_generator(), line::ctmc::CtmcGenerator< T >::filt, line::InputError::InputError(), line::ctmc::CtmcGenerator< T >::preempt_filt, line::ctmc::CtmcGenerator< T >::Q, line::ctmc::CtmcGenerator< T >::space, line::ctmc::CtmcGenerator< T >::start_filt, and line::ctmc::CtmcGenerator< T >::sync.

Referenced by ctmc_get_asymptotic_variance(), ctmc_get_generator(), ctmc_get_generator(), ctmc_get_infgen(), ctmc_get_infgen(), ctmc_symbolic_generator(), and line::api::infer_mlps().

◆ ctmc_get_infgen() [1/2]

template<class T>
CtmcGenerator< T > line::ctmc::ctmc_get_infgen ( const NetworkStruct< T > & sn,
const CtmcOptions & opt )

@@SolverCTMC/getInfGen.m, solving the chain first.

Definition at line 312 of file solver_ctmc_getters.h.

References ctmc_get_generator(), and ctmc_get_infgen().

◆ ctmc_get_infgen() [2/2]

template<class T>
CtmcGenerator< T > line::ctmc::ctmc_get_infgen ( const NetworkStruct< T > & sn,
const CtmcSolution< T > & d )

@@SolverCTMC/getInfGen.m, a pure alias of getGenerator in the reference.

Definition at line 306 of file solver_ctmc_getters.h.

References ctmc_get_generator(), and ctmc_get_infgen().

Referenced by ctmc_get_infgen(), ctmc_get_infgen(), and line::SolverCTMC::generator().

◆ ctmc_get_preempt_rate() [1/2]

template<class T>
Matrix< T > line::ctmc::ctmc_get_preempt_rate ( const NetworkStruct< T > & ,
const CtmcSolution< T > & d )

As above, for a caller whose solution already carries the filtration.

Definition at line 165 of file solver_ctmc_getters.h.

References line::ctmc::CtmcSolution< T >::avg, and ctmc_get_preempt_rate().

◆ ctmc_get_preempt_rate() [2/2]

template<class T>
Matrix< T > line::ctmc::ctmc_get_preempt_rate ( const NetworkStruct< T > & sn,
const CtmcOptions & opt )

◆ ctmc_get_start_rate() [1/2]

template<class T>
Matrix< T > line::ctmc::ctmc_get_start_rate ( const NetworkStruct< T > & ,
const CtmcSolution< T > & d )

As above, for a caller whose solution already carries the filtration.

Definition at line 151 of file solver_ctmc_getters.h.

References line::ctmc::CtmcSolution< T >::avg, and ctmc_get_start_rate().

◆ ctmc_get_start_rate() [2/2]

template<class T>
Matrix< T > line::ctmc::ctmc_get_start_rate ( const NetworkStruct< T > & sn,
const CtmcOptions & opt )

SolverCTMC.getStartRate and getPreemptRate: the DERIVED rates the START/PREEMPT filtration reduces to.

StartN(i,r) is how often per unit time a class-r service STARTS at station i, and PreemptN(i,r) how often a class-r job in service is pushed back into the buffer there. Both are computed by solver_ctmc_avg_from_pi already; what was missing was any way to ask for them, because solver_ctmc_run_analyzer returns an mva::AvgResult and that shape has no slot for a derived rate. The reference exposes them as plain getters, and so do these.

They need the filtration, so the solve is repeated with keep_filtration set rather than read off a result that may not carry it: a caller who already has one passes the CtmcSolution overload instead and pays nothing.

At a lossless station with no in-service abandonment StartN == TN + PreemptN, which is the identity to check them against.

Definition at line 143 of file solver_ctmc_getters.h.

References ctmc_get_start_rate(), line::ctmc::CtmcOptions::keep_filtration, and solver_ctmc_analyzer().

Referenced by ctmc_get_start_rate(), and ctmc_get_start_rate().

◆ ctmc_get_state_space() [1/2]

template<class T>
CtmcStateSpace< T > line::ctmc::ctmc_get_state_space ( const NetworkStruct< T > & ,
const CtmcSolution< T > & d )

Port of @@SolverCTMC/getStateSpace.m.

The reference derives localStateSpace by cutting the flat matrix at the width of each node's own space, a split that can only be got right by carrying those widths alongside. Here the state IS the split, so flat is the derived form and the widths are reported for a caller comparing columns against MATLAB.

Definition at line 326 of file solver_ctmc_getters.h.

References line::ctmc::CtmcSolution< T >::chain, ctmc_get_state_space(), line::ctmc::CtmcStateSpace< T >::flat, line::ctmc::CtmcStateSpace< T >::local, line::ctmc::CtmcStateSpace< T >::node_width, and line::ctmc::CtmcStateSpace< T >::space.

Referenced by ctmc_get_state_space(), ctmc_get_state_space(), and line::SolverCTMC::state_space().

◆ ctmc_get_state_space() [2/2]

template<class T>
CtmcStateSpace< T > line::ctmc::ctmc_get_state_space ( const NetworkStruct< T > & sn,
const CtmcOptions & opt )

As above, solving the chain first.

Definition at line 337 of file solver_ctmc_getters.h.

References ctmc_get_state_space(), and solver_ctmc_analyzer().

◆ ctmc_get_state_space_aggr() [1/2]

template<class T>
Matrix< T > line::ctmc::ctmc_get_state_space_aggr ( const NetworkStruct< T > & sn,
const CtmcOptions & opt )

Port of @@SolverCTMC/getStateSpaceAggr.m: the per-(station, class) job counts of every state, in column block order (ist-1)*K + k.

The reference returns [] with a warning when the model has not been solved, since its copy is a by-product cached by a previous run. There is no such cache here: the aggregate is a function of the state space alone and is recomputed, so the accessor either answers or throws.

Definition at line 552 of file solver_ctmc_getters.h.

References ctmc_get_state_space_aggr(), ctmc_state_space_aggr(), and solver_ctmc_analyzer().

Referenced by ctmc_get_state_space_aggr(), ctmc_get_state_space_aggr(), line::api::infer_mlps(), line::SolverCTMC::marg_aggr(), and line::SolverCTMC::prob_aggr().

◆ ctmc_get_state_space_aggr() [2/2]

template<class T>
Matrix< T > line::ctmc::ctmc_get_state_space_aggr ( const NetworkStruct< T > & sn,
const CtmcSolution< T > & d )

As above, for a caller who has already solved the chain.

Definition at line 558 of file solver_ctmc_getters.h.

References line::ctmc::CtmcSolution< T >::chain, ctmc_get_state_space_aggr(), and ctmc_state_space_aggr().

◆ ctmc_get_tran_prob() [1/2]

template<class T>
CtmcTranProb< T > line::ctmc::ctmc_get_tran_prob ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
std::size_t ind,
const T & t0,
const T & t1 )

As above, integrating the forward equation first.

Definition at line 659 of file solver_ctmc_getters.h.

References assert_phase_type_states(), ctmc_get_tran_prob(), and solver_ctmc_transient_analyzer().

◆ ctmc_get_tran_prob() [2/2]

template<class T>
CtmcTranProb< T > line::ctmc::ctmc_get_tran_prob ( const NetworkStruct< T > & sn,
const CtmcTransient< T > & tr,
std::size_t ind )

Port of @@SolverCTMC/getTranProb.m: pi(t) over the whole chain, labelled by one node's local state.

IT IS NOT A PER-STATE TRANSIENT PROBABILITY, despite the name's symmetry with getProb. The reference returns the FULL occupancy vector together with the node's slice of the state space, leaving the caller to sum the rows sharing the local state it cares about; that is a strictly richer answer than one marginal and is reproduced as such.

Parameters
ind1-based node index
snthe refreshed network struct
trtransient solution whose pi(t) is being labelled

Definition at line 647 of file solver_ctmc_getters.h.

References assert_phase_type_states(), ctmc_get_tran_prob(), and line::ctmc::CtmcTranProb< T >::labels.

Referenced by ctmc_get_tran_prob(), and ctmc_get_tran_prob().

◆ ctmc_get_tran_prob_aggr() [1/2]

template<class T>
CtmcTranProb< T > line::ctmc::ctmc_get_tran_prob_aggr ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
std::size_t ind,
const T & t0,
const T & t1 )

As above, integrating the forward equation first.

Definition at line 699 of file solver_ctmc_getters.h.

References assert_phase_type_states(), ctmc_get_tran_prob_aggr(), and solver_ctmc_transient_analyzer().

◆ ctmc_get_tran_prob_aggr() [2/2]

template<class T>
CtmcTranProb< T > line::ctmc::ctmc_get_tran_prob_aggr ( const NetworkStruct< T > & sn,
const CtmcTransient< T > & tr,
std::size_t ind )

Port of @@SolverCTMC/getTranProbAggr.m: pi(t), labelled by one node's per-class job counts.

THE REFERENCE SLICES THE AGGREGATE BY NODE INDEX, SSa(:, (jnd-1)*K+1 : jnd*K), while ctmc_ssg writes that matrix in STATION blocks (ist-1)*K+1 : ist*K. The two indices coincide only when every node is a station, so on a model carrying a Router or a ClassSwitch the reference reads the wrong block. The labels are decoded from the node's own state here instead of sliced out of a station-indexed matrix, which sidesteps the mismatch and extends to a stateful non-station – a Cache – that no station block describes at all.

Parameters
ind1-based node index
snthe refreshed network struct
trtransient solution whose pi(t) is being labelled

Definition at line 687 of file solver_ctmc_getters.h.

References assert_phase_type_states(), ctmc_get_tran_prob_aggr(), and line::ctmc::CtmcTranProb< T >::labels.

Referenced by ctmc_get_tran_prob_aggr(), and ctmc_get_tran_prob_aggr().

◆ ctmc_get_tran_prob_sys() [1/2]

template<class T>
CtmcTranProb< T > line::ctmc::ctmc_get_tran_prob_sys ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
const T & t0,
const T & t1 )

As above, integrating the forward equation first.

Definition at line 723 of file solver_ctmc_getters.h.

References assert_phase_type_states(), ctmc_get_tran_prob_sys(), and solver_ctmc_transient_analyzer().

◆ ctmc_get_tran_prob_sys() [2/2]

template<class T>
CtmcTranProb< T > line::ctmc::ctmc_get_tran_prob_sys ( const NetworkStruct< T > & sn,
const CtmcTransient< T > & tr )

Port of @@SolverCTMC/getTranProbSys.m: pi(t), labelled by the whole network state with its phases.

Definition at line 714 of file solver_ctmc_getters.h.

References assert_phase_type_states(), ctmc_get_tran_prob_sys(), and line::ctmc::CtmcTranProb< T >::labels.

Referenced by ctmc_get_tran_prob_sys(), and ctmc_get_tran_prob_sys().

◆ ctmc_get_tran_prob_sys_aggr() [1/2]

template<class T>
CtmcTranProb< T > line::ctmc::ctmc_get_tran_prob_sys_aggr ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
const T & t0,
const T & t1 )

As above, integrating the forward equation first.

Definition at line 752 of file solver_ctmc_getters.h.

References assert_phase_type_states(), ctmc_get_tran_prob_sys_aggr(), and solver_ctmc_transient_analyzer().

◆ ctmc_get_tran_prob_sys_aggr() [2/2]

template<class T>
CtmcTranProb< T > line::ctmc::ctmc_get_tran_prob_sys_aggr ( const NetworkStruct< T > & sn,
const CtmcTransient< T > & tr )

Port of @@SolverCTMC/getTranProbSysAggr.m: pi(t), labelled by the network's per-(station, class) job counts.

The labels are ctmc_state_space_aggr, the same matrix the transient analyzer already integrates Q(t) and U(t) against, so a caller summing these rows by hand reproduces its QNt exactly.

Definition at line 742 of file solver_ctmc_getters.h.

References assert_phase_type_states(), ctmc_get_tran_prob_sys_aggr(), ctmc_state_space_aggr(), and line::ctmc::CtmcTranProb< T >::labels.

Referenced by ctmc_get_tran_prob_sys_aggr(), and ctmc_get_tran_prob_sys_aggr().

◆ ctmc_has_waitq_region()

template<class T>
bool line::ctmc::ctmc_has_waitq_region ( const NetworkStruct< T > & sn)

True when the model declares a region that applies anything other than DROP.

Definition at line 725 of file solver_ctmc_waitq.h.

References ctmc_has_waitq_region().

Referenced by ctmc_has_waitq_region(), solver_ctmc_analyzer_any(), line::ssa::solver_ssa_reachability(), and line::ssa::SsaSerialEngine< T >::SsaSerialEngine().

◆ ctmc_in_drop_region()

template<class T>
std::vector< bool > line::ctmc::ctmc_in_drop_region ( const NetworkStruct< T > & sn)

True where a class sits at a station inside a DROP region, per station.

solver_ctmc_avg_from_pi needs it for the same reason it needs a finite capacity: a job that can be dropped never entered service, so the offered arrival rate is not what the server did and only the carried rate is a utilization.

Definition at line 165 of file solver_ctmc_fcr.h.

References ctmc_in_drop_region().

Referenced by ctmc_in_drop_region().

◆ ctmc_region_admissible()

template<class T>
bool line::ctmc::ctmc_region_admissible ( const NetworkStruct< T > & sn,
const std::vector< T > & nir )

True when nir – the per-(station, class) counts of one state, in (ist-1)*K + k order – satisfies every region.

The caps are compared against the counts SUMMED OVER THE MEMBER STATIONS, which is the whole point of a region: a per-station cap cannot express "at most 6 jobs between these three stations". The reference's -1 sentinel means unbounded and is skipped rather than compared.

Definition at line 86 of file solver_ctmc_fcr.h.

References line::ctmc::NetworkStruct< T >::Region::cap, ctmc_region_admissible(), line::ctmc::NetworkStruct< T >::Region::lincon_A, line::ctmc::NetworkStruct< T >::Region::lincon_b, line::ctmc::NetworkStruct< T >::Region::maxmem, line::ctmc::NetworkStruct< T >::Region::members, and line::ctmc::NetworkStruct< T >::Region::size.

Referenced by ctmc_filter_regions(), and ctmc_region_admissible().

◆ ctmc_signal_busy()

template<class T>
std::vector< T > line::ctmc::ctmc_signal_busy ( const NetworkStruct< T > & sn,
std::size_t ist,
const CtmcResult< T > & r,
const std::vector< T > & p,
std::size_t isf )

Port of ctmc_signal_busy: the exact per-class busy-server fraction, read off the enumerated state space.

WHY THE DEPARTURE ESTIMATOR IS NOT ENOUGH. T*E[S]/c is exact for a lossy class only under EXPONENTIAL service: a job destroyed mid-service leaves busy time behind with no completion to account for it, so with phase-type service the carried-rate estimator under-counts. Measured on an M/Er2/1 with lambda+ = 0.5 and lambda- = 0.4 it gives 0.34941 against a true 0.37696. The in-service occupancy below is exact for any service process.

A PS-like discipline shares the servers among every resident job, so class k takes the weighted share n_k w_k / sum_j n_j w_j of the busy servers; every other discipline exposes the in-service indicator directly through to_marginal.

Definition at line 1285 of file solver_ctmc.h.

References ctmc_signal_busy(), line::qn::Marginal< T >::nir, line::qn::Marginal< T >::sir, line::ctmc::CtmcResult< T >::space, and line::qn::to_marginal().

Referenced by ctmc_signal_busy(), and solver_ctmc_avg_from_pi().

◆ ctmc_signal_lossy()

template<class T>
std::vector< bool > line::ctmc::ctmc_signal_lossy ( const NetworkStruct< T > & sn,
const CtmcResult< T > & r,
const std::vector< T > & p,
std::size_t isf )

Port of ctmc_signal_lossy: classes a G-network signal can annihilate here.

Such a job leaves the station WITHOUT a service completion, so the arrival-based (offered-load) utilization estimator is invalid for it and only the departure-based carried load is meaningful – the same reasoning as the finite-capacity canDropClass, reached by a different route.

A signal class is active at this node when its stationary arrival rate there is positive. A TARGETED signal removes only its target class; an untargeted one is class-agnostic and removes any non-signal class, matching after_event_station_signal, MAM and LDES.

Definition at line 1242 of file solver_ctmc.h.

References line::ctmc::CtmcResult< T >::arv_rates, ctmc_signal_lossy(), and line::ctmc::CtmcResult< T >::space.

Referenced by ctmc_signal_lossy(), and solver_ctmc_avg_from_pi().

◆ ctmc_state_space_aggr()

template<class T>
Matrix< T > line::ctmc::ctmc_state_space_aggr ( const NetworkStruct< T > & sn,
const std::vector< NetState< T > > & space )

Port of StateSpaceAggr: the per-(station, class) job counts of every state, as an (nstates x nstations*nclasses) matrix in column block order (ist-1)*K + k.

It is what @@SolverCTMC/getStateSpaceAggr returns and what the transient analyzer, the reward analyzer and the BAS shift all index; building it once keeps the three from re-deriving the same marginal decode with three chances to disagree about the buffer encoding.

A SOURCE ROW IS ZERO, not Inf. to_marginal reports an infinite reservoir for an EXT station, which describes the encoding rather than a queue length, and an Inf here would propagate into every aggregate that sums this matrix.

Definition at line 1201 of file solver_ctmc.h.

References ctmc_state_space_aggr(), line::qn::Marginal< T >::nir, and line::qn::to_marginal().

Referenced by ctmc_filter_regions(), ctmc_gd_factor(), ctmc_get_state_space_aggr(), ctmc_get_state_space_aggr(), ctmc_get_tran_prob_sys_aggr(), ctmc_state_space_aggr(), line::ssa::SsaSerialEngine< T >::run(), solver_ctmc_fes_aggregation(), solver_ctmc_reward(), solver_ctmc_sample_sys_aggr(), solver_ctmc_tran_reward(), and solver_ctmc_transient_analyzer().

◆ ctmc_stationary()

template<class T>
CtmcStationaryResult< T > line::ctmc::ctmc_stationary ( const Matrix< T > & Q,
std::size_t init_index = static_cast<std::size_t>(-1) )

◆ ctmc_symbolic_eval_infgen()

template<class T>
Matrix< T > line::ctmc::ctmc_symbolic_eval_infgen ( const CtmcSymbolicGenerator< T > & g,
const std::vector< T > & x )

Evaluates the symbolic generator at a symbol assignment, the twin of the JAR's evalInfGen.

With x[e] = rate0[e] this reproduces the numeric generator, which is the cheapest way to check a symbolic build against ctmc_get_generator.

Parameters
gthe symbolic generator
xone value per event, in the same order; an inactive event's value is ignored

Definition at line 276 of file solver_ctmc_symbolic.h.

References ctmc_symbolic_eval_infgen(), line::InputError::InputError(), line::ctmc::CtmcSymbolicGenerator< T >::invert_symbol, line::ctmc::CtmcSymbolicGenerator< T >::Q, line::ctmc::CtmcSymbolicGenerator< T >::symbols, and line::ctmc::CtmcSymbolicGenerator< T >::terms.

Referenced by ctmc_symbolic_eval_infgen().

◆ ctmc_symbolic_generator()

template<class T>
CtmcSymbolicGenerator< T > line::ctmc::ctmc_symbolic_generator ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
bool invert_symbol = false )

Port of @@SolverCTMC/getSymbolicGenerator.m.

No backend is contacted: the generator is linear in the symbols, so it is assembled from the numeric filtration ctmc_get_generator already returns.

Parameters
snthe refreshed network struct
optCTMC options; keep_filtration is forced on, the filtration being the whole content of the answer
invert_symboldivide each filtration by its symbol instead of multiplying, i.e. parameterize by mean times not rates
Returns
the expression matrix, the symbols, and the numeric terms they scale

Definition at line 226 of file solver_ctmc_symbolic.h.

References line::Matrix< T >::cols(), ctmc_get_generator(), line::mc::ctmc_makeinfgen(), ctmc_symbolic_generator(), line::ctmc::CtmcGenerator< T >::filt, line::ctmc::CtmcSymbolicGenerator< T >::filt, line::ctmc::CtmcSymbolicGenerator< T >::invert_symbol, line::ctmc::CtmcGenerator< T >::Q, line::ctmc::CtmcSymbolicGenerator< T >::Q, line::ctmc::CtmcSymbolicGenerator< T >::rate0, line::Matrix< T >::rows(), line::ctmc::CtmcGenerator< T >::space, line::ctmc::CtmcSymbolicGenerator< T >::space, line::ctmc::CtmcSymbolicGenerator< T >::symbols, line::ctmc::CtmcGenerator< T >::sync, line::ctmc::CtmcSymbolicGenerator< T >::sync, and line::ctmc::CtmcSymbolicGenerator< T >::terms.

Referenced by ctmc_symbolic_generator(), and ctmc_symbolic_solution().

◆ ctmc_symbolic_solution()

◆ ctmc_waitq_parked()

template<class T>
std::vector< T > line::ctmc::ctmc_waitq_parked ( const NetworkStruct< T > & sn,
const WaitqResult< T > & r,
const std::vector< T > & pi )

The mean number of parked jobs per class, over a stationary law.

IT IS IN NO QLen. A parked job is in no station and in no region, so solver_ctmc_avg_from_pi cannot see it and the model's population is conserved only once this is added back. That is the JMT report convention, not an omission.

Definition at line 925 of file solver_ctmc_waitq.h.

References line::ctmc::WaitqResult< T >::buf, and ctmc_waitq_parked().

Referenced by ctmc_waitq_parked(), and solver_ctmc_waitq_analyzer().

◆ is_stateless_method()

bool line::ctmc::is_stateless_method ( const std::string & method)
inline

True for a method whose analyzer is not the explicit-generator one.

Definition at line 242 of file solver_ctmc_analyzer.h.

References is_stateless_method().

Referenced by check_method(), and is_stateless_method().

◆ list_valid_methods()

std::vector< std::string > line::ctmc::list_valid_methods ( )
inline

Port of SolverCTMC.listValidMethods.

exact is an explicit ALIAS for the default state-space path: it pins the intent at the call site so an example or test cannot be re-baselined by a later change of what default selects. It must stay behaviourally identical to default – nothing below branches on the name – and that equivalence is the point of the alias.

mdd and the cftp pair never build the explicit generator, so they are served by solver_ctmc_mdd_analyzer and solver_ctmc_cftp and return before this file's state-space machinery is reached; they appear here only because this is the list the gate below is read against.

Definition at line 237 of file solver_ctmc_analyzer.h.

References list_valid_methods().

Referenced by line::autosolver::auto_family_methods(), check_method(), list_valid_methods(), and line::NetworkSolver::list_valid_methods().

◆ make_infgen()

template<class T>
void line::ctmc::make_infgen ( Matrix< T > & Q)

Port of ctmc_makeinfgen: turn an off-diagonal rate matrix into a generator.

The diagonal is discarded first and then set to minus the row sum, so any self-loop that was accumulated cancels exactly.

Definition at line 319 of file solver_ctmc.h.

References line::Matrix< T >::cols(), make_infgen(), and line::Matrix< T >::rows().

Referenced by make_infgen(), solver_ctmc(), and solver_ctmc_waitq().

◆ method_fallback_warning()

std::string line::ctmc::method_fallback_warning ( const std::string & method)
inline

The reference's fallback warning, or empty when the method needs none.

Definition at line 276 of file solver_ctmc_analyzer.h.

References method_fallback_warning().

Referenced by method_fallback_warning(), and solve_struct().

◆ reachable_space_generator()

template<class T>
std::vector< NetState< T > > line::ctmc::reachable_space_generator ( const NetworkStruct< T > & sn,
const NetState< T > & init,
const std::vector< Sync< T > > & sync,
const std::vector< qn::GlobalSync< T > > & gsync = std::vector<qn::GlobalSync<T>>(),
std::size_t maxst = 3000000,
const std::vector< qn::FjSync< T > > & fjsync = std::vector<qn::FjSync<T>>(),
const std::vector< std::size_t > & cutoff = std::vector<std::size_t>(),
const std::vector< std::vector< std::size_t > > & cutoff_mat = std::vector<std::vector<std::size_t>>() )

Port of State.reachableSpaceGenerator: the states reachable from init.

space_generator enumerates every state the ENCODING admits; this walks the ones the DYNAMICS can actually occupy. The two differ whenever the encoding is wider than the model – a retrial station's idle-server states are reachable, whereas an ordinary queue's are not, and enumerating the latter leaves a generator with absorbing junk that perturbs the stationary vector after normalization.

The walk applies exactly the same handlers the generator does, so a state is included precisely when some synchronization produces it at a positive rate.

IT IS THE ONLY GENERATOR AN SPN HAS. from_marginal_node emits a single row for a Transition – every mode's servers free, nothing firing – because a transition's state is per-MODE and no population marginal determines it. The lattice enumeration therefore never produces a state in which a mode is firing, and a generator built over that space has every ENABLE landing outside it. Walking gsync from the idle state is what materializes them, which is why the reference forces state_space_gen='reachable' for any model whose firings break per-chain population conservation.

cutoff TRUNCATES AN OPEN CLASS, and without it this walk does not terminate. The lattice generator bounds an open class's total population by the cutoff; this walk had no such bound, so on ANY open SPN – spn_basic_open at cutoff 1, spn_pareto_service, spn_open_sevenplaces – the Source kept producing tokens and the walk ran to the maxst cap instead of answering. Passing the same cutoff makes the two paths mean the same thing by "cutoff": a candidate whose open-class population would exceed it is not a state of the truncated chain, so the arc to it simply does not exist and make_infgen re-closes the row, which is exactly what the lattice path leaves behind. Empty means unbounded, which is right for a closed model and is what every existing caller passes.

THE INITIAL MARKING RAISES THE BOUND WHERE IT EXCEEDS IT. A Place may start with more tokens than the cutoff – spn_open_sevenplaces puts 2 in P1 against a default cutoff of 2 – and a bound below the state the walk starts from censors every successor of it, leaving the initial state alone in a chain that is not the model's. A state space that cannot contain its own initial state is empty by construction, so the floor is the initial marking.

Definition at line 1055 of file solver_ctmc.h.

References line::qn::Sync< T >::active, line::qn::after_event(), line::qn::after_fj_event(), line::qn::after_global_event(), line::qn::NetState< T >::local, line::qn::Sync< T >::passive, line::qn::EventOutcome< T >::prob, line::qn::GlobalOutcome< T >::prob, line::qn::EventOutcome< T >::rate, line::qn::GlobalOutcome< T >::rate, reachable_space_generator(), line::qn::EventOutcome< T >::space, line::qn::GlobalOutcome< T >::space, and line::UnsupportedError::UnsupportedError().

Referenced by reachable_space_generator(), solve_struct(), and line::ssa::solver_ssa_reachability().

◆ solve_struct()

template<class T>
CtmcSolution< T > line::ctmc::solve_struct ( const NetworkStruct< T > & sn_in,
const CtmcOptions & opt,
const std::vector< qn::FjSync< T > > & fjsync )

◆ solver_ctmc()

template<class T>
CtmcResult< T > line::ctmc::solver_ctmc ( const NetworkStruct< T > & sn,
const std::vector< NetState< T > > & space,
const std::vector< Sync< T > > & sync,
const std::vector< qn::GlobalSync< T > > & gsync = std::vector<qn::GlobalSync<T>>(),
bool want_filtration = false,
const std::vector< qn::FjSync< T > > & fjsync = std::vector<qn::FjSync<T>>() )

Port of the generator assembly of solver_ctmc.m.

Parameters
snthe network struct
spacethe enumerated state space, from space_generator
syncthe synchronization list, from refresh_sync
gsyncthe SPN global synchronizations, from refresh_gsync
fjsyncthe fork firing list, from fj_tag
want_filtrationalso return the per-synchronisation rate matrices (the filtration), which sampling and reward paths need

Definition at line 502 of file solver_ctmc.h.

References line::qn::Sync< T >::active, line::qn::after_event(), line::qn::after_fj_event(), line::qn::after_global_event(), line::ctmc::CtmcResult< T >::arv_rates, line::ctmc::CtmcResult< T >::arv_rates_imm, line::qn::FjSync< T >::auxclasses, line::qn::FjSync< T >::branchheads, line::qn::FjSync< T >::cls, line::qn::ModeEvent< T >::cls, line::qn::GlobalOutcome< T >::completion, ctmc_find_vanishing_states(), ctmc_gd_factor(), line::ctmc::CtmcResult< T >::dep_rates, line::ctmc::CtmcResult< T >::dep_rates_imm, line::qn::ModeEvent< T >::event, line::ctmc::CtmcResult< T >::filt, line::qn::FjSync< T >::fork, line::lang::IMMEDIATE, line::qn::NetState< T >::local, make_infgen(), line::Matrix< T >::Matrix(), line::qn::ModeEvent< T >::mode, line::qn::ModeEvent< T >::node, line::qn::Sync< T >::passive, line::ctmc::CtmcResult< T >::preempt_filt, line::qn::EventOutcome< T >::prob, line::qn::GlobalOutcome< T >::prob, line::ctmc::CtmcResult< T >::Q, line::ctmc::CtmcResult< T >::Qimm, line::qn::EventOutcome< T >::rate, line::qn::GlobalOutcome< T >::rate, line::Matrix< T >::rows(), line::qn::rt_state(), solver_ctmc(), line::ctmc::CtmcResult< T >::space, line::qn::EventOutcome< T >::space, line::qn::GlobalOutcome< T >::space, line::ctmc::CtmcResult< T >::start_filt, line::util::LineConsole::step(), line::ctmc::CtmcResult< T >::vanishing, and line::qn::ModeEvent< T >::weight.

Referenced by solve_struct(), and solver_ctmc().

◆ solver_ctmc_analyzer()

template<class T>
CtmcSolution< T > line::ctmc::solver_ctmc_analyzer ( const NetworkStruct< T > & sn_in,
const CtmcOptions & opt )

Port of solver_ctmc_analyzer.m plus the fork-join wrapper of @@SolverCTMC/runAnalyzer.m.

A fork-join model is solved on the TAG-AUGMENTED copy and the sibling classes are folded back at the end. The chain and the stationary vector returned are the AUGMENTED ones, as the reference's result.space is: they are indexed by a class set the caller did not declare, which is why fjclassmap comes back with them rather than being discarded.

Definition at line 1168 of file solver_ctmc_analyzer.h.

References line::ctmc::CtmcSolution< T >::avg, check_method(), ctmc_check_support(), line::qn::ctmc_feature_set(), line::qn::feature_gate(), line::tr::fj_foldback(), line::qn::fj_tag(), line::ctmc::CtmcSolution< T >::fjclassmap, line::qn::FjTagged< T >::fjclassmap, line::qn::FjTagged< T >::fjsync, line::tr::has_fork_join(), line::qn::FjTagged< T >::korig, line::api::NonmarkovOptions::order, line::api::Ph, line::api::NonmarkovOptions::phfit, line::api::sn_has_nonmarkov(), line::api::sn_nonmarkov_toph(), solve_struct(), solver_ctmc_analyzer(), and line::qn::FjTagged< T >::V.

Referenced by ctmc_cdf_firstpasst(), ctmc_firstpasst_moments(), ctmc_get_generator(), ctmc_get_preempt_rate(), ctmc_get_start_rate(), ctmc_get_state_space(), ctmc_get_state_space_aggr(), line::SolverCTMC::generator(), line::SolverCTMC::marg_aggr(), line::SolverCTMC::prob_aggr(), solver_ctmc_analyzer(), solver_ctmc_analyzer_any(), solver_ctmc_fes_aggregation(), solver_ctmc_reward(), solver_ctmc_run_analyzer(), solver_ctmc_sample_sys(), solver_ctmc_sensitivity(), solver_ctmc_transient_analyzer(), and line::SolverCTMC::state_space().

◆ solver_ctmc_analyzer_any()

template<class T>
CtmcAnySolution< T > line::ctmc::solver_ctmc_analyzer_any ( const NetworkStruct< T > & sn,
const CtmcOptions & opt )

The entry point a caller who does not know which path a model needs should use: pick the WAITQ walk when a region asks for anything other than DROP, and the lattice analyzer otherwise.

IT IS A SEPARATE ENTRY POINT AND NOT A CHANGE TO solver_ctmc_run_analyzer. That function is the DEFAULT path, and a WAITQ region reaching it is a defect it must keep reporting: its generator carries no token buffer, so it would solve the region as DROP. The dispatch is therefore placed here, where both paths are in scope, and the default path keeps refusing by name.

ctmc_check_support runs on both branches. ctmc_check_waitq_support covers fork-join and true blocking on its own and needs no entry for class or joint dependence: this generator never scales a rate itself, it walks on whatever EventOutcome::rate the shared qn::after_event -> after_event_station dispatcher hands back (state_events.h:1591, :1675), and cd_factor is folded into that rate INSIDE the dispatcher (state_events.h:831-832, :1298) for every caller alike. solver_ctmc.h's default generator calls the same qn::after_event, so the two paths scale identically by construction, not by coincidence. GREPPING THIS FILE FOR cd_factor FINDS NOTHING BY DESIGN – that is not a missing call, it is this generator having no rate arithmetic of its own to put one in. Trace the dispatcher, not the grep, before concluding otherwise. MATLAB has the identical shape for the identical reason: solver_ctmc_fcr_waitq.m computes every rate through State.afterEventHashed, which calls the same State.afterEvent the default generator uses, so it too carries no cdscaling/jdscaling text of its own.

Definition at line 1009 of file solver_ctmc_waitq.h.

References line::ctmc::CtmcAnySolution< T >::buf, line::ctmc::WaitqSolution< T >::buf, ctmc_check_support(), line::qn::ctmc_feature_set(), ctmc_has_waitq_region(), line::qn::feature_gate(), line::ctmc::CtmcAnySolution< T >::parked, line::ctmc::WaitqSolution< T >::parked, line::ctmc::CtmcAnySolution< T >::sol, line::ctmc::WaitqSolution< T >::sol, solver_ctmc_analyzer(), solver_ctmc_analyzer_any(), solver_ctmc_waitq_analyzer(), and line::ctmc::CtmcAnySolution< T >::waitq.

Referenced by solver_ctmc_analyzer_any(), and solver_ctmc_run_analyzer_any().

◆ solver_ctmc_avg_from_pi()

template<class T>
CtmcAvg< T > line::ctmc::solver_ctmc_avg_from_pi ( const NetworkStruct< T > & sn,
const CtmcResult< T > & r,
const std::vector< T > & pivec )

Port of solver_ctmc_avg_from_pi: map a state distribution to mean metrics.

Factored from the analyzer exactly as the reference factors it, so a caller holding its own distribution – a time-averaged transient one, say – reuses the same discipline-aware reduction instead of re-deriving it.

Definition at line 1381 of file solver_ctmc.h.

References line::ctmc::CtmcResult< T >::arv_rates, line::qn::Station< T >::cdscaling, line::qn::Station< T >::cdscalingpeak, line::qn::ReplyBlockInfo::classes, line::ctmc::CtmcAvg< T >::CN, ctmc_all_phasetype(), ctmc_signal_busy(), ctmc_signal_lossy(), line::lang::Distrib< T >::D0, line::mam::Map< T >::D0, line::lang::Distrib< T >::D1, line::mam::Map< T >::D1, line::ctmc::CtmcResult< T >::dep_rates, line::lang::Distrib< T >::disabled, line::lang::DROP, line::qn::Station< T >::jdscaling, line::qn::Station< T >::jdscalingpeak, line::mam::map_mean(), line::Matrix< T >::Matrix(), line::qn::Marginal< T >::nir, line::ctmc::CtmcResult< T >::preempt_filt, line::ctmc::CtmcAvg< T >::PreemptN, line::ctmc::CtmcAvg< T >::QN, line::qn::reply_block_info(), line::ctmc::CtmcAvg< T >::RN, line::qn::Marginal< T >::sir, solver_ctmc_avg_from_pi(), line::ctmc::CtmcResult< T >::space, line::ctmc::CtmcResult< T >::start_filt, line::ctmc::CtmcAvg< T >::StartN, line::ctmc::CtmcAvg< T >::TN, line::qn::to_marginal(), line::ctmc::CtmcAvg< T >::UN, line::qn::ReplyBlockInfo::width, line::ctmc::CtmcAvg< T >::XN, and line::ctmc::GlobalConstants::Zero.

Referenced by solve_struct(), solver_ctmc_avg_from_pi(), and solver_ctmc_waitq_analyzer().

◆ solver_ctmc_avg_reward()

template<class T>
std::vector< T > line::ctmc::solver_ctmc_avg_reward ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
std::vector< std::string > * names = nullptr )

Port of @@SolverCTMC/getAvgReward: the steady-state expected rewards.

Definition at line 200 of file solver_ctmc_reward.h.

References line::ctmc::CtmcReward< T >::names, solver_ctmc_avg_reward(), solver_ctmc_reward(), and line::ctmc::CtmcReward< T >::steady_state.

Referenced by solver_ctmc_avg_reward().

◆ solver_ctmc_avg_table()

template<class T>
mva::AvgResult< T > line::ctmc::solver_ctmc_avg_table ( const NetworkStruct< T > & sn,
const CtmcSolution< T > & d,
const std::string & method )

Port of @@SolverCTMC/runAnalyzer.m's result assembly: solve, then apply the metric filter @@NetworkSolver/getAvg puts between the analyzer and the caller, so the table is the same shape SolverMVA and SolverNC print.

The response-time mask the product-form runners apply – drop a metric whose response time is below the tolerance – is NOT applied here. A CTMC reports what the chain does, and a station a class genuinely visits with a tiny response time is a real measurement rather than a numerical artefact of a fixed point that did not converge there.

Definition at line 1233 of file solver_ctmc_analyzer.h.

References line::ctmc::CtmcSolution< T >::actualmethod, line::mva::AvgResult< T >::actualmethod, line::mva::AvgResult< T >::AN, line::mva::ArvR, line::ctmc::CtmcSolution< T >::avg, line::ctmc::CtmcSolution< T >::cache, line::mva::AvgResult< T >::cache, line::mva::AvgResult< T >::CN, line::mva::filter_metric(), line::mva::AvgResult< T >::iter, line::mva::AvgResult< T >::method, line::mva::QLen, line::mva::AvgResult< T >::QN, line::mva::ResidT, line::mva::RespT, line::mva::AvgResult< T >::RN, line::mva::sn_get_arvr_from_tput(), line::mva::sn_get_residt_from_respt(), solver_ctmc_avg_table(), line::mva::AvgResult< T >::TN, line::mva::Tput, line::mva::AvgResult< T >::UN, line::mva::Util, line::mva::AvgResult< T >::WN, and line::mva::AvgResult< T >::XN.

Referenced by solver_ctmc_avg_table(), solver_ctmc_cftp_run_analyzer(), solver_ctmc_fes_aggregation(), solver_ctmc_mdd_run_analyzer(), solver_ctmc_run_analyzer(), and solver_ctmc_run_analyzer_any().

◆ solver_ctmc_cdf_respt()

template<class T>
std::vector< std::vector< CdfCurve< T > > > line::ctmc::solver_ctmc_cdf_respt ( const NetworkStruct< T > & sn,
const CtmcOptions & opt )

Port of @@SolverCTMC/getCdfRespT.m: the per-(station, class) response-time CDF, indexed [ist-1][r-1].

Entries are EMPTY where the curve does not exist: a station the chain never visits has no arrival event to condition on, and a class outside every chain that holds jobs is never tagged. Every class of a chain gets the SAME curve, which is what the reference produces – the tagged job's passage through a station is one quantity per chain, since the job carries its class with it.

Definition at line 274 of file solver_ctmc_cdf.h.

References line::ctmc::GlobalConstants::CoarseTol, line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::mam::map_normalize(), line::mam::map_pie(), solver_ctmc_cdf_respt(), and line::UnsupportedError::UnsupportedError().

Referenced by line::SolverCTMC::cdf_respt(), and solver_ctmc_cdf_respt().

◆ solver_ctmc_cdf_sys_respt()

template<class T>
std::vector< CdfCurve< T > > line::ctmc::solver_ctmc_cdf_sys_respt ( const NetworkStruct< T > & sn,
const CtmcOptions & opt )

Port of @@SolverCTMC/getCdfSysRespT.m: the per-chain SYSTEM response-time CDF, indexed by chain.

The split is taken at the tagged job's arrival at its OWN reference station, for both halves of the MAP: the state seen on arrival there, and the absorption at the next arrival there. The passage is therefore one full cycle of the network – MATLAB's system response time – and not a single visit.

The reference has no closed-model guard here, unlike getCdfRespT; tag_chain supplies one, since tagging moves a job out of a finite population.

Definition at line 346 of file solver_ctmc_cdf.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::ctmc::GlobalConstants::FineTol, line::mam::map_normalize(), line::mam::map_pie(), line::NumericError::NumericError(), and solver_ctmc_cdf_sys_respt().

Referenced by solver_ctmc_cdf_sys_respt().

◆ solver_ctmc_cftp()

◆ solver_ctmc_cftp_run_analyzer()

template<class T>
mva::AvgResult< T > line::ctmc::solver_ctmc_cftp_run_analyzer ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
const CtmcCftpOptions & cftpopt )

◆ solver_ctmc_cftp_supports()

template<class T>
std::string line::ctmc::solver_ctmc_cftp_supports ( const NetworkStruct< T > & sn)

The cftp model-class gate as a public predicate.

The one call a REPORT can make: auto_family_refusal reaches the structural rules the feature set has no name for (the class count, the station count and the phase count) through this, and solver_ctmc_cftp refuses through the same body, so a pair the report offers is a pair the sampler runs.

Parameters
snthe refreshed struct of the model
Returns
an empty string when the sampler may run, else the refusal

Definition at line 210 of file solver_ctmc_cftp.h.

References solver_ctmc_cftp_supports().

Referenced by line::autosolver::auto_family_refusal(), and solver_ctmc_cftp_supports().

◆ solver_ctmc_chain()

template<class T>
CtmcChainSolution< T > line::ctmc::solver_ctmc_chain ( const MarkovChainModel< T > & chain)

Steady-state analysis of a user-supplied Markov chain.

infgen is Q for a CTMC and the uniformized generator P-I for a DTMC, which carries the same stationary vector; returning it under one name is what lets a caller treat the two chain kinds alike.

Definition at line 108 of file solver_ctmc_chain.h.

References line::mc::ctmc_solve(), line::mc::ctmc_solve_reducible(), line::lang::processes::MarkovChainModel< T >::discrete, line::mc::dtmc_solve(), line::mc::dtmc_solve_reducible(), line::ctmc::CtmcChainSolution< T >::infgen, line::InputError::InputError(), line::lang::processes::MarkovChainModel< T >::mat, line::ctmc::CtmcChainSolution< T >::pi, line::ctmc::CtmcChainSolution< T >::runtime, solver_ctmc_chain(), and line::ctmc::CtmcChainSolution< T >::state_space.

Referenced by solver_ctmc_chain().

◆ solver_ctmc_chain_aggregation()

template<class T>
mva::AvgResult< T > line::ctmc::solver_ctmc_chain_aggregation ( const NetworkStruct< T > & sn,
const CtmcOptions & opt )

Solve the CHAIN-AGGREGATED model and map its metrics back to the classes.

api::sn_aggregate_chains collapses every chain onto a single class, class switching disappearing with it, and mva::sn_deaggregate_chain_results maps chain-level metrics back through alpha, the per-station share of the chain's visits each class carries. Both transforms existed in all four codebases with no solver consumer; this is that consumer.

WHAT IS TRADED. Exactness on a non-product-form model: one aggregate service law, fitted to the alpha-weighted first two moments, replaces the per-class ones. On a product-form model the chain IS the unit MVA and convolution already solve in, so the answer is exact and the state space is the smaller one.

Definition at line 1279 of file solver_ctmc_analyzer.h.

References solver_ctmc_chain_aggregation(), solver_ctmc_run_analyzer(), and line::tr::transform_solve_chains().

Referenced by solver_ctmc_chain_aggregation(), and solver_ctmc_run_analyzer().

◆ solver_ctmc_chain_transient()

template<class T>
CtmcChainTransientSolution< T > line::ctmc::solver_ctmc_chain_transient ( const MarkovChainModel< T > & chain,
const std::vector< T > & pi0in,
const T & t0in,
const T & t1 )

Transient distribution of a user-supplied Markov chain over [t0,t1].

For a MarkovProcess the Kolmogorov forward equations are integrated from pi0; for a MarkovChain the distribution is advanced one step per unit of time, so the returned t holds the integer steps within the timespan.

Parameters
pi0ininitial distribution; empty for the uniform one

Definition at line 150 of file solver_ctmc_chain.h.

References line::mc::ctmc_transient(), line::lang::processes::MarkovChainModel< T >::discrete, line::ctmc::GlobalConstants::FineTol, line::InputError::InputError(), line::lang::processes::MarkovChainModel< T >::mat, line::Matrix< T >::Matrix(), line::mc::TransientResult< T >::pi, line::ctmc::CtmcChainTransientSolution< T >::pi_t, solver_ctmc_chain_transient(), line::ctmc::CtmcChainTransientSolution< T >::t, and line::mc::TransientResult< T >::t.

Referenced by solver_ctmc_chain_transient().

◆ solver_ctmc_fes_aggregation()

template<class T>
mva::AvgResult< T > line::ctmc::solver_ctmc_fes_aggregation ( const NetworkStruct< T > & sn,
const CtmcOptions & opt )

Solve with a station subset replaced by a FLOW-EQUIVALENT SERVER, then recover the collapsed stations' own metrics by conditioning.

api::fes_aggregate has existed in all four codebases with no solver consumer at all: it was exercised by examples and tests only, so nothing in the solver stack depended on it. Flow-equivalent aggregation is the standard route to HIERARCHICAL DECOMPOSITION – a subnetwork is solved in isolation and enters the outer chain as a single load-dependent station, which is what makes an otherwise intractable state space tractable.

The reduced model answers for the surviving stations directly. For a collapsed station the answer is the Chandy-Herzog-Woo conditional sum E[Q_i] = sum_n P(N_fes = n) * Q_i(n), with P read off the reduced chain's stationary law and Q_i(n) from the isolated subnetwork (fes::fes_compute_metrics). Throughput needs no conditioning: flow is fixed by the routing and an exact reduction leaves the chain throughput unchanged.

EXACT when the collapsed subnetwork is product-form, which is the condition fes_aggregate already imposes; an approximation otherwise, and the state-space saving is the reason to accept that.

Definition at line 1335 of file solver_ctmc_analyzer.h.

References line::mva::AvgResult< T >::actualmethod, line::mva::AvgResult< T >::AN, line::ctmc::CtmcSolution< T >::chain, line::mva::AvgResult< T >::CN, line::fes::FesDeaggInfo< T >::complementIndices, ctmc_state_space_aggr(), line::fes::FesDeaggInfo< T >::cutoffs, line::fes::FesAggregateResult< T >::deagg, line::fes::fes_aggregate(), line::fes::fes_compute_metrics(), line::fes::FesDeaggInfo< T >::fesNode, line::InputError::InputError(), line::fes::FesDeaggInfo< T >::isolatedDemands, line::fes::FesDeaggInfo< T >::isolatedIsDelay, line::fes::FesDeaggInfo< T >::isolatedServers, line::fes::ljd_linearize(), line::Matrix< T >::Matrix(), line::mva::AvgResult< T >::method, line::fes::FesAggregateResult< T >::model, line::qn::NetworkStruct< T >::nodes, line::ctmc::CtmcSolution< T >::pi, line::fes::FesConditionalMetrics< T >::QN, line::mva::AvgResult< T >::QN, line::mva::AvgResult< T >::RN, line::Matrix< T >::rows(), line::mva::sn_get_arvr_from_tput(), line::mva::sn_get_residt_from_respt(), solver_ctmc_analyzer(), solver_ctmc_avg_table(), solver_ctmc_fes_aggregation(), line::qn::NetworkStruct< T >::stateful_of_station(), line::fes::FesDeaggInfo< T >::subsetIndices, line::mva::AvgResult< T >::TN, line::fes::FesConditionalMetrics< T >::UN, line::mva::AvgResult< T >::UN, line::qn::NetworkStruct< T >::visits, line::mva::AvgResult< T >::WN, and line::mva::AvgResult< T >::XN.

Referenced by solver_ctmc_fes_aggregation(), and solver_ctmc_run_analyzer().

◆ solver_ctmc_joint()

template<class T>
T line::ctmc::solver_ctmc_joint ( const NetworkStruct< T > & sn,
const CtmcSolution< T > & d,
const NetState< T > & state )

Port of solver_ctmc_joint: P(the network is in exactly state).

Returns zero when the state is not in the enumerated space, which is the honest answer for a state the encoding cannot represent or the dynamics cannot reach – not an error, because findrows returning nothing is how the reference reports the same thing.

Definition at line 118 of file solver_ctmc_prob.h.

References assert_phase_type_states(), line::ctmc::CtmcSolution< T >::chain, line::qn::NetState< T >::local, line::ctmc::CtmcSolution< T >::pi, and solver_ctmc_joint().

Referenced by solver_ctmc_joint().

◆ solver_ctmc_jointaggr()

template<class T>
T line::ctmc::solver_ctmc_jointaggr ( const NetworkStruct< T > & sn,
const CtmcSolution< T > & d,
const NetState< T > & state )

Port of solver_ctmc_jointaggr: P(the network holds exactly these per-class counts), summed over every phase and buffer arrangement that realizes them.

Definition at line 135 of file solver_ctmc_prob.h.

References assert_phase_type_states(), line::ctmc::CtmcSolution< T >::chain, line::qn::NetState< T >::local, line::ctmc::CtmcSolution< T >::pi, and solver_ctmc_jointaggr().

Referenced by solver_ctmc_jointaggr().

◆ solver_ctmc_load_concealment()

template<class T>
mva::AvgResult< T > line::ctmc::solver_ctmc_load_concealment ( const NetworkStruct< T > & sn,
const CtmcOptions & opt )

Solve by LOAD CONCEALMENT, the iterated transformation.

tr::transform_solve_lc sweeps the chains in Gauss-Seidel order, solving each concealed single-chain struct with THIS analyzer. Clearing the flag on the inner options states that a subproblem must not be concealed again, rather than relying on its one-chain shape to decline.

Definition at line 1302 of file solver_ctmc_analyzer.h.

References solver_ctmc_load_concealment(), solver_ctmc_run_analyzer(), and line::tr::transform_solve_lc().

Referenced by solver_ctmc_load_concealment(), and solver_ctmc_run_analyzer().

◆ solver_ctmc_marg()

template<class T>
std::vector< T > line::ctmc::solver_ctmc_marg ( const NetworkStruct< T > & sn,
const CtmcSolution< T > & d,
const NetState< T > & state )

Port of solver_ctmc_marg: per STATION, P(that station is in exactly its local slice of state), marginalized over every other node.

Returns
one entry per station, indexed 0-based

Definition at line 166 of file solver_ctmc_prob.h.

References assert_phase_type_states(), line::ctmc::CtmcSolution< T >::chain, line::qn::NetState< T >::local, line::ctmc::CtmcSolution< T >::pi, and solver_ctmc_marg().

Referenced by solver_ctmc_marg().

◆ solver_ctmc_margaggr()

template<class T>
std::vector< T > line::ctmc::solver_ctmc_margaggr ( const NetworkStruct< T > & sn,
const CtmcSolution< T > & d,
const NetState< T > & state )

Port of solver_ctmc_margaggr: per STATION, P(that station holds exactly these per-class counts).

This is the aggregate solver_ctmc_marg is the refinement of: it sums the per-state probabilities of every local state sharing the marginal, so on a single-phase model with no buffer ordering the two coincide.

Definition at line 191 of file solver_ctmc_prob.h.

References assert_phase_type_states(), line::ctmc::CtmcSolution< T >::chain, line::qn::NetState< T >::local, line::ctmc::CtmcSolution< T >::pi, and solver_ctmc_margaggr().

Referenced by solver_ctmc_margaggr().

◆ solver_ctmc_mdd_analyzer()

template<class T>
CtmcMddSolution< T > line::ctmc::solver_ctmc_mdd_analyzer ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
const mdd::MddMcdOptions & mcdopt = mdd::MddMcdOptions() )

Solve with the mdd method.

Parameters
snthe refreshed struct of a CLOSED single-class network
optthe SolverCTMC knobs; only method is read, the state-space ones having no meaning for a solve that enumerates nothing
mcdoptthe level-iteration knobs, an INNER numerical solve whose tolerance must stay far tighter than any solver-level iter_tol

Definition at line 321 of file solver_ctmc_mdd_analyzer.h.

References line::ctmc::CtmcMddSolution< T >::actualmethod, line::ctmc::CtmcMddSolution< T >::avg, line::mdd::MDD::cardinality(), line::lang::Distrib< T >::D0, line::lang::Distrib< T >::D1, line::mdd::MddDescriptor< T >::domain, line::ctmc::CtmcMddSolution< T >::encoding, line::mdd::MddDescriptor< T >::init, line::ctmc::CtmcMddSolution< T >::iters, line::mdd::MddMcdResult< T >::iters, line::ctmc::CtmcMddSolution< T >::level_sizes, line::mdd::MddMcdResult< T >::level_sizes, line::Matrix< T >::Matrix(), line::mdd::mdd_descriptor(), line::mdd::mdd_mcd(), line::mdd::mdd_ps(), line::mdd::mdd_reachset(), line::mdd::MddDescriptor< T >::nextfun, line::ctmc::CtmcMddSolution< T >::no_aggregation, line::mdd::MddMcdResult< T >::no_aggregation, line::ctmc::CtmcMddSolution< T >::num_states, line::ctmc::CtmcMddSolution< T >::paths_per_level, line::mdd::MddMcdResult< T >::paths_per_level, line::lang::Distrib< T >::phases(), line::mdd::MddMcdResult< T >::QLen, line::lang::sched_to_text(), solver_ctmc_mdd_analyzer(), solver_ctmc_mdd_supports(), line::mdd::MDD::to_struct(), line::mdd::MddMcdResult< T >::U, line::UnsupportedError::UnsupportedError(), and line::mdd::MddMcdResult< T >::X.

Referenced by solver_ctmc_mdd_analyzer(), and solver_ctmc_mdd_run_analyzer().

◆ solver_ctmc_mdd_run_analyzer()

template<class T>
mva::AvgResult< T > line::ctmc::solver_ctmc_mdd_run_analyzer ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
const mdd::MddMcdOptions & mcdopt = mdd::MddMcdOptions() )

◆ solver_ctmc_mdd_supports()

template<class T>
std::string line::ctmc::solver_ctmc_mdd_supports ( const NetworkStruct< T > & sn)

Can the mdd decision-diagram method be asked for this model?

The model-shape gate asked as a predicate rather than thrown. solver_ctmc_mdd_analyzer refuses with it before it builds anything, and a REPORT reaches the same call, so a pair the report offers is a pair the method runs. One predicate with two callers is what stops the two from disagreeing about which models the method serves.

A STOCHASTIC PETRI NET IS EXEMPT: a Place model is read through spn_route, which builds the reachable set and the Kronecker descriptor from the marking rather than from the (station,class) encoding, so neither the single-class rule nor the closed-population rule applies to it.

The deeper refusals the analyzer still raises – a station-to-station chain that is not stochastic, and a phase-type law at a discipline neither local encoding represents – are not restated here: they are decided from quantities the analyzer computes on its way through, not from the model shape, so a caller cannot be told about them without doing the work.

Parameters
snthe refreshed struct of the model
Returns
an empty string when the method may run, else the refusal

Definition at line 282 of file solver_ctmc_mdd_analyzer.h.

References solver_ctmc_mdd_supports().

Referenced by line::autosolver::auto_family_refusal(), solver_ctmc_mdd_analyzer(), and solver_ctmc_mdd_supports().

◆ solver_ctmc_ratecomplement()

template<class T>
std::vector< T > line::ctmc::solver_ctmc_ratecomplement ( const Matrix< T > & D,
const std::vector< std::size_t > & nonimm,
const std::vector< std::size_t > & imm,
const Matrix< T > & Q12,
const Matrix< T > & Q22 )

Port of solver_ctmc_ratecomplement: the long-run rate of an action as seen from each TANGIBLE state, given the action's rate filter D.

Vanishing states are removed from the generator by stochastic complementation, so an action that fires only in vanishing states – a fork firing, a join departure, the firing of an immediate SPN mode – would be lost if its rate were read off the tangible rows alone. The rate observed from tangible state s is the direct exit rate via the action plus the expected number of firings along the vanishing chain entered from s:

r = D(nonimm,:)*1 + Q12*(-Q22)^-1*(D(imm,:)*1)

NOT YET REACHED BY THIS PORT'S GENERATOR, which gives an immediate transition the reference's ~1e8 rate rather than eliminating it, so there are no vanishing states to complement out. It is ported at its own signature so the elimination can be added without re-deriving the correction.

Parameters
nonimm0-based tangible row indices, in the order they appear in Q11
imm0-based vanishing row indices
Q12tangible-to-vanishing block
Q22vanishing-to-vanishing block
Dgenerator whose immediate states are being eliminated

Definition at line 239 of file solver_ctmc_prob.h.

References line::Matrix< T >::cols(), line::Matrix< T >::rows(), line::solve(), and solver_ctmc_ratecomplement().

Referenced by solver_ctmc_ratecomplement().

◆ solver_ctmc_reward()

template<class T>
CtmcReward< T > line::ctmc::solver_ctmc_reward ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
std::size_t tmax = 1000 )

Port of solver_ctmc_reward.m.

Parameters
tmaxnumber of value-iteration steps; the reference's default is 1000
snthe refreshed network struct, carrying the reward definitions
optCTMC options (state-space cutoff, tolerances, method)

Definition at line 66 of file solver_ctmc_reward.h.

References line::ctmc::CtmcReward< T >::chain, ctmc_state_space_aggr(), line::InputError::InputError(), line::ctmc::CtmcReward< T >::names, solver_ctmc_analyzer(), solver_ctmc_reward(), line::ctmc::CtmcReward< T >::state_space_aggr, line::ctmc::CtmcReward< T >::steady_state, line::ctmc::CtmcReward< T >::t, and line::ctmc::CtmcReward< T >::V.

Referenced by solver_ctmc_avg_reward(), and solver_ctmc_reward().

◆ solver_ctmc_run_analyzer()

template<class T>
mva::AvgResult< T > line::ctmc::solver_ctmc_run_analyzer ( const NetworkStruct< T > & sn,
const CtmcOptions & opt )

◆ solver_ctmc_run_analyzer_any()

template<class T>
mva::AvgResult< T > line::ctmc::solver_ctmc_run_analyzer_any ( const NetworkStruct< T > & sn,
const CtmcOptions & opt )

◆ solver_ctmc_sample()

template<class T>
Matrix< T > line::ctmc::solver_ctmc_sample ( const NetworkStruct< T > & sn,
const CtmcSamplePath< T > & path,
std::size_t ind )

Port of @@SolverCTMC/sample: the walk restricted to ONE stateful node's local block.

Parameters
ind1-based node index
snthe refreshed network struct
pathsample path to label
Returns
row i is that node's local state at path.t[i]

Definition at line 169 of file solver_ctmc_sample.h.

References line::ctmc::CtmcSamplePath< T >::chain, line::InputError::InputError(), solver_ctmc_sample(), and line::ctmc::CtmcSamplePath< T >::state.

Referenced by solver_ctmc_sample().

◆ solver_ctmc_sample_aggr()

template<class T>
Matrix< T > line::ctmc::solver_ctmc_sample_aggr ( const NetworkStruct< T > & sn,
const CtmcSamplePath< T > & path,
std::size_t ind )

Port of @@SolverCTMC/sampleAggr: one node's per-class counts over time.

Definition at line 184 of file solver_ctmc_sample.h.

References line::ctmc::CtmcSamplePath< T >::chain, line::InputError::InputError(), solver_ctmc_sample_aggr(), and line::ctmc::CtmcSamplePath< T >::state.

Referenced by solver_ctmc_sample_aggr().

◆ solver_ctmc_sample_sys()

template<class T>
CtmcSamplePath< T > line::ctmc::solver_ctmc_sample_sys ( const NetworkStruct< T > & sn,
const CtmcOptions & opt_in,
std::size_t nevents,
unsigned long seed = 23000 )

Port of @@SolverCTMC/sampleSys: a marked walk on the whole network state.

Requires the event filtration, so opt.keep_filtration is forced on – the mark cannot be recovered from Q, whose entries have already summed every synchronization's contribution.

Parameters
neventsnumber of transitions to draw
seedthe stream; two runs are the same trace only if this matches
snthe refreshed network struct
opt_inCTMC options (state-space cutoff, tolerances, method)

Definition at line 67 of file solver_ctmc_sample.h.

References assert_phase_type_states(), line::ctmc::CtmcSamplePath< T >::chain, line::ctmc::CtmcSamplePath< T >::event, line::InputError::InputError(), line::pfqn::mc_uniform(), solver_ctmc_analyzer(), solver_ctmc_sample_sys(), line::ctmc::CtmcSamplePath< T >::state, and line::ctmc::CtmcSamplePath< T >::t.

Referenced by solver_ctmc_sample_sys().

◆ solver_ctmc_sample_sys_aggr()

template<class T>
Matrix< T > line::ctmc::solver_ctmc_sample_sys_aggr ( const NetworkStruct< T > & sn,
const CtmcSamplePath< T > & path )

Port of @@SolverCTMC/sampleSysAggr: the same walk, reported as per-(station, class) job counts rather than as detailed states.

Returns
row i is the aggregate state at path.t[i], in (ist-1)*K + k column order

Definition at line 150 of file solver_ctmc_sample.h.

References line::ctmc::CtmcSamplePath< T >::chain, line::Matrix< T >::cols(), ctmc_state_space_aggr(), solver_ctmc_sample_sys_aggr(), and line::ctmc::CtmcSamplePath< T >::state.

Referenced by solver_ctmc_sample_sys_aggr().

◆ solver_ctmc_sensitivity()

template<class T>
CtmcSens< T > line::ctmc::solver_ctmc_sensitivity ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
const CtmcSensParam< T > & param,
const std::vector< T > & reward = std::vector<T>(),
const std::string & method = "fd",
const CtmcSymbolicOptions & symopt = CtmcSymbolicOptions() )

Port of @@SolverCTMC/getSensitivity.

Parameters
rewardreward RATE per state; empty returns dpi and pi with S unset
methodfd (the default) or symbolic, which needs a backend
snthe refreshed network struct
optCTMC options (state-space cutoff, tolerances, method)
paramthe parameter theta being perturbed, and how to set it
symoptbackend selection, read only by method='symbolic'

Definition at line 246 of file solver_ctmc_sens.h.

References line::ctmc::CtmcSolution< T >::chain, line::mc::ctmc_sens(), line::ctmc::CtmcSens< T >::dpi, line::InputError::InputError(), line::ctmc::CtmcSens< T >::pi, line::ctmc::CtmcSolution< T >::pi, line::ctmc::CtmcSens< T >::S, line::ctmc::CtmcSens< T >::scaled_valid, line::ctmc::CtmcSensParam< T >::set, solver_ctmc_analyzer(), solver_ctmc_sensitivity(), line::ctmc::CtmcSens< T >::SS, line::ctmc::CtmcSensParam< T >::step, line::ctmc::CtmcSensParam< T >::value, and line::ctmc::GlobalConstants::Zero.

Referenced by solver_ctmc_sensitivity(), and solver_ctmc_sensitivity_ranking().

◆ solver_ctmc_sensitivity_ranking()

template<class T>
std::vector< CtmcSensRank< T > > line::ctmc::solver_ctmc_sensitivity_ranking ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
const std::vector< CtmcSensParam< T > > & params,
const std::vector< T > & reward )

Port of @@SolverCTMC/getSensitivityRanking: rank parameters by influence.

The order is by DESCENDING ABSOLUTE SCALED sensitivity, because the scaled form is dimensionless and so is the only one comparable across parameters measured in different units. The SIGN is retained in the table, since it says whether increasing a parameter helps or hurts.

Definition at line 327 of file solver_ctmc_sens.h.

References line::InputError::InputError(), line::ctmc::CtmcSens< T >::S, line::ctmc::CtmcSens< T >::scaled_valid, solver_ctmc_sensitivity(), solver_ctmc_sensitivity_ranking(), and line::ctmc::CtmcSens< T >::SS.

Referenced by solver_ctmc_sensitivity_ranking().

◆ solver_ctmc_tran_reward()

template<class T>
std::vector< std::vector< T > > line::ctmc::solver_ctmc_tran_reward ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
const T & t0,
const T & t1,
std::vector< T > * tout = nullptr,
std::vector< std::string > * names = nullptr )

Port of @@SolverCTMC/getTranReward: E[r(X(t))] = sum_s pi_t(s) r(s).

NOT THE VALUE FUNCTION V above. This is the expected reward RATE at time t, which converges to the steady-state E[r]; V is the reward accumulated over k uniformized steps and diverges. The two are related by V being roughly the integral of this, and confusing them is the easiest mistake to make here.

Parameters
t0,t1the timespan; an infinite one has no transient to report
snthe refreshed network struct, carrying the reward definitions
optCTMC options (state-space cutoff, tolerances, method)
toutoptional out-parameter receiving the integration time points
namesoptional out-parameter receiving the reward names, in result order
Returns
out[r][i] is reward r at time t[i]

Definition at line 155 of file solver_ctmc_reward.h.

References line::Matrix< T >::cols(), ctmc_state_space_aggr(), line::InputError::InputError(), solver_ctmc_tran_reward(), and solver_ctmc_transient_analyzer().

Referenced by solver_ctmc_tran_reward().

◆ solver_ctmc_transient_analyzer()

template<class T>
CtmcTransient< T > line::ctmc::solver_ctmc_transient_analyzer ( const NetworkStruct< T > & sn,
const CtmcOptions & opt,
const T & t0,
const T & t1,
const std::vector< T > & grid = std::vector<T>() )

Port of solver_ctmc_transient_analyzer.m.

Parameters
t0,t1the timespan; the initial state is the model's default one

options.config.rate_sched – the time-INHOMOGENEOUS generator, where a per-(station, class) rate follows a schedule and Q(t) is rebuilt by probing its linear dependence on sn.rates – is not ported, and there is NO refusal for it here because there is nothing to refuse: CtmcOptions carries no such field, so the schedule cannot be requested at this entry at all. What this function solves is always the constant-rate generator. Adding the option means adding the refusal with it, or the schedule would be accepted and silently ignored, which would answer a different question.

Parameters
snthe refreshed network struct
optCTMC options (state-space cutoff, tolerances, method)

Definition at line 130 of file solver_ctmc_transient.h.

References line::ctmc::CtmcTransient< T >::chain, check_method(), ctmc_state_space_aggr(), line::mc::ctmc_transient(), line::mc::ctmc_transient_on_grid(), line::lang::Distrib< T >::D0, line::lang::Distrib< T >::disabled, line::tr::has_fork_join(), line::InputError::InputError(), line::ctmc::CtmcTransient< T >::pit, line::ctmc::CtmcTransient< T >::QNt, solver_ctmc_analyzer(), solver_ctmc_transient_analyzer(), line::ctmc::CtmcTransient< T >::t, line::ctmc::CtmcTransient< T >::TNt, line::UnsupportedError::UnsupportedError(), line::ctmc::CtmcTransient< T >::UNt, and line::ctmc::GlobalConstants::Zero.

Referenced by ctmc_get_tran_prob(), ctmc_get_tran_prob_aggr(), ctmc_get_tran_prob_sys(), ctmc_get_tran_prob_sys_aggr(), solver_ctmc_tran_reward(), and solver_ctmc_transient_analyzer().

◆ solver_ctmc_waitq()

template<class T>
WaitqResult< T > line::ctmc::solver_ctmc_waitq ( const NetworkStruct< T > & sn,
const CtmcOptions & opt )

Port of the reachability walk of solver_ctmc_fcr_waitq.m.

The space is WALKED and not enumerated, for the reason an SPN is: no population marginal produces a state whose region FIFO is non-empty, so a lattice enumeration would emit only the empty-buffer states and every blocking transition would land outside the space.

Definition at line 809 of file solver_ctmc_waitq.h.

References line::ctmc::WaitqResult< T >::buf, line::ctmc::WaitqState< T >::buf, line::ctmc::WaitqResult< T >::chain, ctmc_check_waitq_support(), line::InputError::InputError(), make_infgen(), line::Matrix< T >::Matrix(), line::ctmc::WaitqState< T >::net, solver_ctmc_waitq(), and line::UnsupportedError::UnsupportedError().

Referenced by solver_ctmc_waitq(), and solver_ctmc_waitq_analyzer().

◆ solver_ctmc_waitq_analyzer()

template<class T>
WaitqSolution< T > line::ctmc::solver_ctmc_waitq_analyzer ( const NetworkStruct< T > & sn,
const CtmcOptions & opt )

Build the WAITQ chain, solve it, and map it onto the same means every other CTMC path reports.

NO WEAKLY-CONNECTED-COMPONENT STEP, unlike solver_ctmc_analyzer. That step exists because the lattice enumeration emits states the dynamics cannot reach; this walk starts at the initial state and applies the same handlers the generator does, so every state it holds is reachable by construction and restricting to a component could only remove states the model does occupy.

Definition at line 957 of file solver_ctmc_waitq.h.

References line::ctmc::WaitqResult< T >::buf, line::ctmc::WaitqSolution< T >::buf, line::ctmc::WaitqResult< T >::chain, check_method(), line::mc::ctmc_solve(), ctmc_waitq_parked(), line::ctmc::WaitqSolution< T >::parked, line::ctmc::WaitqSolution< T >::sol, solver_ctmc_avg_from_pi(), solver_ctmc_waitq(), and solver_ctmc_waitq_analyzer().

Referenced by solver_ctmc_analyzer_any(), and solver_ctmc_waitq_analyzer().

Variable Documentation

◆ CTMC_DEFAULT_CUTOFF

std::size_t line::ctmc::CTMC_DEFAULT_CUTOFF = 10
constexpr

SolverOptions.m:107: the per-class state-space cutoff SolverCTMC defaults an open or mixed model to.

It is a SOLVER default, not a fallback computed from the model, and the reference's ceil(6000^(1/(M*K))) is reached only from an explicitly infinite request. See resolve_cutoff.

Definition at line 75 of file solver_ctmc_analyzer.h.

◆ kArcTol

const double line::ctmc::kArcTol = 1e-12
static

Magnitude above which an off-diagonal generator entry counts as an arc.

Definition at line 45 of file ctmc_stationary.h.