5#ifndef LINE_SOLVERS_UQ_UQ_DISPATCH_H
6#define LINE_SOLVERS_UQ_UQ_DISPATCH_H
80 return std::vector<std::string>{
"mva",
"nc",
"mam",
"ba",
"ctmc",
"fluid",
"ssa"};
86template <
class T,
class Sol>
89 const std::size_t M = r.
QN.rows(), K = r.QN.cols();
97 for (std::size_t i = 0; i < M; ++i)
98 for (std::size_t c = 0; c < K; ++c) {
106 a.
WN(i, c) = a.
RN(i, c);
109 for (
double v : r.CN) a.
CN.push_back(num_traits<T>::from_double(v));
110 for (
double v : r.XN) a.
XN.push_back(num_traits<T>::from_double(v));
126 const std::string s = o.
solver;
164 if constexpr (std::is_same<T, double>::value) {
174 "SolverUQ: the MAM stage solver fits phase-type representations, whose fitter "
175 "requires transcendental arithmetic; run UQ under the double backend");
178 if (s ==
"fluid" || s ==
"fld") {
179 if constexpr (std::is_same<T, double>::value) {
190 "SolverUQ: the fluid stage solver integrates its drift with LSODA, which is double "
191 "precision by construction; run UQ under the double backend");
195 if constexpr (std::is_same<T, double>::value) {
210 "SolverUQ: an SSA sample path is generated from exponential clocks, which are "
211 "transcendental; run UQ under the double backend");
216 "SolverUQ: no stage solver was named. UQ solves nothing itself; name the solver that "
217 "runs at each design point (mva, nc, mam, ba, ctmc, fluid or ssa)");
219 "' is not a stage solver this port carries; the ported names are mva, "
220 "nc, mam, ba, ctmc, fluid and ssa");
UnsupportedError(const std::string &what)
A network plus its refreshed NetworkStruct.
The exception types the port throws.
The fluid solver's outermost entry point: @@SolverFLD/runAnalyzer.m's method resolution over solver_f...
mva::AvgResult< T > solver_ba_run_analyzer(const qn::NetworkStruct< T > &L, const BaOptions &opt_in)
Port of @@SolverBA/runAnalyzer.m for the lang='matlab' path.
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.
FluidSolution solver_fluid_run_analyzer(const qn::NetworkStruct< T > &sn, const FluidOptions &opt, qn::NetworkStruct< T > *sn_out=nullptr, qn::NetworkStruct< T > *refreshed_out=nullptr, solvers::CacheMetrics< T > *cache_out=nullptr)
Port of @@SolverFLD/runAnalyzer.m: resolve the method, route to the function the reference routes to,...
mva::AvgResult< T > solver_mam_run_analyzer(const qn::NetworkStruct< T > &L, const MamOptions &opt)
Port of @@SolverMAM/runAnalyzer.m for the lang='matlab' path: solve, then apply the metric filter @@N...
AvgResult< T > solver_mva_run_analyzer(const qn::NetworkStruct< T > &L, const MvaOptions &opt_in, const Matrix< T > &init_sol)
Port of @@SolverMVA/runAnalyzer.m for the lang='matlab' path: gate, solve, convert,...
mva::AvgResult< T > solver_nc_run_analyzer(const qn::NetworkStruct< T > &L_in, const NcSolverOptions &opt_in)
Port of @@SolverNC/runAnalyzer.m for the lang='matlab' path: solve, then apply the metric filter @@Ne...
SsaSolution solver_ssa(const qn::NetworkStruct< T > &sn, const SsaOptions &opt, std::vector< SsaCacheRatio > *cache=nullptr)
solver_ssa_analyzer.m: choose the method.
std::function< mva::AvgResult< T >(const qn::NetworkStruct< T > &)> UqStageSolver
What solves one design point: the C++ spelling of @(m) SolverXXX(m).
UqStageSolver< T > uq_stage_solver(const UqStageOptions &o)
The stage solver named by o.solver.
std::vector< std::string > uq_list_stage_solvers()
The solver method names uq_stage_solver accepts, for a caller that lists them.
A queueing network and its refreshed NetworkStruct.
Number-type abstraction for the templated API port.
The SolverBA class surface: @@SolverBA/runAnalyzer.m, listValidMethods, getBounds and getBoundsTable.
Port of solver_ctmc_analyzer.m and the parts of @@SolverCTMC/runAnalyzer.m that surround one solve: t...
Port of solver_ctmc_fcr_waitq.m: the reachability-built generator of a model whose finite capacity re...
SolverFluid: the closing method, a port of solver_fluid.m, solver_fluid_iteration....
The SolverMAM class surface: @@SolverMAM/runAnalyzer.m and the gates around it.
The SolverMVA class surface: @@SolverMVA/runAnalyzer.m and the gates around it.
The SolverNC class surface: @@SolverNC/runAnalyzer.m and the gates around it.
SolverUQ: uncertainty quantification by expansion over a Prior.
The SolverSSA entry surface: a port of @@SolverSSA/runAnalyzer.m's method whitelist,...
The options SolverBA reads.
The SolverCTMC knobs this port honours.
Controls, defaulting to SolverOptions('Fluid') in the reference.
The options SolverMAM reads.
The metrics getAvg returns, after filtering.
Matrix< T > RN
response time, per visit
Matrix< T > UN
utilization
Matrix< T > WN
residence time, per job
std::string method
the method asked for
std::string actualmethod
the algorithm that ran
Matrix< T > QN
queue length
std::vector< T > CN
system response time per class
std::vector< T > XN
system throughput per class
Matrix< T > AN
arrival rate
The options SolverMVA reads.
Controls, defaulting to SolverOptions('NC') in the reference.
Controls, defaulting to SolverOptions('SSA') in the reference.
The inner solver's knobs, carried through untranslated.
double tol
< 0 = not given
std::size_t samples
ssa run length; 0 = not given
std::string method
The method WITHIN that solver; empty or default leaves its own default.
unsigned long seed
ssa stream; 0 = not given
double cutoff
ctmc open-population cutoff; < 0 = not given
std::string solver
mva | nc | mam | ba | ctmc | fluid | ssa.