5#ifndef LINE_SOLVERS_MVA_SOLVER_MVA_RUNNER_H
6#define LINE_SOLVERS_MVA_SOLVER_MVA_RUNNER_H
165 std::set<std::string> drop;
168 drop.insert({
"aql",
"amva.aql",
"qsa",
"amva.qsa",
"tay",
"amva.tay",
"sqni"});
171 bool open =
true, closed =
false;
179 bool has_bas =
false;
183 if (!(L.
nclasses == 1 && !open && has_bas)) drop.insert(
"sqd");
188 bool any_open_class =
false;
190 if (std::isinf(c.
population)) any_open_class =
true;
191 if (any_open_class) drop.insert(
"mvac");
194 drop.insert({
"sjn.mva",
"sjn.amva"});
197 bool classdep_routing =
false;
199 drop.insert({
"marie",
"amva.marie"});
201 drop.insert({
"qna",
"rqna",
"rqt"});
202 for (std::size_t r = 0; r + 1 < L.
nclasses; ++r)
203 for (std::size_t i = 1; i <= L.
nof_nodes() && !classdep_routing; ++i)
204 for (std::size_t j = 1; j <= L.
nof_nodes(); ++j)
206 classdep_routing =
true;
209 if (classdep_routing) drop.insert({
"marie",
"amva.marie"});
211 bool has_prio =
false;
213 if (st.
sched == qn::SchedStrategy::FCFSPRPRIO) has_prio =
true;
214 if (!has_prio) drop.insert({
"priomva",
"amva.priomva"});
217 const std::set<std::string>
qsys = {
"mm1",
"mmk",
"mg1",
"mgi1",
"gm1",
"gig1",
"gim1",
"gimc",
218 "gig1.kingman",
"gigk",
"gigk.kingman_approx",
219 "gig1.gelenbe",
"gig1.heyman",
"gig1.kimura",
"gig1.allen",
220 "gig1.kobayashi",
"gig1.klb",
"gig1.marchal",
221 "gigk.whitt",
"qed",
"gig1.extremal",
"gigk.diffusion"};
223 drop.insert(
qsys.begin(),
qsys.end());
224 drop.insert({
"erlanga",
"mgisrgi"});
226 const std::size_t qi = detail::station_of_type(L, qn::NodeType::Queue);
228 drop.insert({
"erlanga",
"mgisrgi"});
230 drop.insert(
"erlanga");
235 for (
const char* fs : {
"mg1kk",
"ddckk",
"mmckk"})
238 std::vector<std::string> kept;
239 kept.reserve(m.size());
240 for (
const std::string& name : m)
241 if (drop.count(name) == 0) kept.push_back(name);
245 std::size_t n_inf = 0;
247 if (st.
sched == qn::SchedStrategy::INF) ++n_inf;
252 std::vector<double> sx_n;
253 std::vector<bool> sx_fcfs;
254 bool sx_ready =
false;
255 std::vector<std::string> keep;
256 keep.reserve(m.size());
257 for (
const std::string& name : m) {
266 for (std::size_t c = 0; c < L.
nchains; ++c) sx_n.push_back(cd.
Nchain[c]);
268 if (st.
sched != qn::SchedStrategy::INF && st.
sched != qn::SchedStrategy::EXT)
269 sx_fcfs.push_back(st.
sched == qn::SchedStrategy::FCFS);
277 keep.push_back(name);
290 if (method ==
"mvablo") {
294 if (method ==
"debemva") {
299 if (method ==
"oqnrc") {
304 if (method ==
"erlanga") {
309 if (std::find(valid.begin(), valid.end(), method) != valid.end())
return;
312 if (std::find(all.begin(), all.end(), method) != all.end())
314 "' method does not apply to this model. list_valid_methods names the methods that do.");
332 return std::string(
"oqnrc");
333 if (method !=
"default" || L.
nclasses != 1)
return method;
336 for (std::size_t r = 0; r < L.
nclasses; ++r)
337 if (std::isfinite(L.
classes[r].population))
return method;
344 const std::size_t qi = detail::station_of_type(L, qn::NodeType::Queue);
366 for (std::size_t c = 0; c < L.
nchains; ++c)
367 for (std::size_t i = 0; i < L.
nstations; ++i) {
369 for (std::size_t k = 0; k < L.
nclasses; ++k)
370 V(i, k) = T(V(i, k) + L.
visits[c](sf - 1, k));
390 const Matrix<T> V = detail::station_visits(L);
392 for (std::size_t i = 0; i < M; ++i)
393 for (std::size_t k = 0; k < K; ++k) {
402 const bool is_place = L.
stations[i].nodetype == qn::NodeType::Place;
403 if ((L.
disabled[i][k] && !is_place) || !(RN(i, k) > zero))
continue;
409 for (std::size_t cc = 0; cc < L.
nchains; ++cc)
410 if (L.
chains[cc][k]) c = cc;
412 const std::size_t rs = L.
classes[k].refstat;
417 for (std::size_t r : L.
inchain[c]) den += V(rs - 1, r - 1);
419 if (den > zero) WN(i, k) = T(RN(i, k) * V(i, k) / den);
421 for (std::size_t i = 0; i < M; ++i)
422 for (std::size_t k = 0; k < K; ++k)
446 for (std::size_t nd = 0; nd < L.
nodes.size(); ++nd) {
447 if (L.
nodes[nd].nodetype != qn::NodeType::Join)
continue;
448 const std::size_t ist = L.
nodes[nd].station;
449 if (ist == 0 || ist > RN.
rows())
continue;
450 for (std::size_t r = 0; r < RN.
cols(); ++r)
451 if (AN(ist - 1, r) > zero) RN(ist - 1, r) = QN(ist - 1, r) / AN(ist - 1, r);
487 if (L.
rt.rows() != S * R)
return AN;
491 if (TN.
rows() == 0)
return AN;
496 for (std::size_t sf = 0; sf < S; ++sf) {
498 const std::size_t ist = L.
nodes[nd - 1].station;
499 if (ist == 0)
continue;
500 for (std::size_t r = 0; r < R; ++r) TS(sf, r) = TN(ist - 1, r);
505 std::vector<std::size_t> ucols;
506 std::vector<bool> is_u(S * R,
false);
507 for (std::size_t sf = 0; sf < S; ++sf) {
509 for (std::size_t k = 0; k < R; ++k) {
510 ucols.push_back(sf * R + k);
511 is_u[sf * R + k] =
true;
514 if (!ucols.empty()) {
515 const std::size_t nU = ucols.size();
517 std::vector<T> b(nU, zero);
518 for (std::size_t j = 0; j < nU; ++j) {
520 for (std::size_t col = 0; col < S * R; ++col)
521 if (!is_u[col]) acc += T(TS(col / R, col % R) * L.
rt(col, ucols[j]));
523 for (std::size_t i = 0; i < nU; ++i)
527 for (std::size_t j = 0; j < nU; ++j) TS(ucols[j] / R, ucols[j] % R) = xu[j];
529 for (std::size_t ist = 0; ist < M; ++ist) {
531 if (L.
stations[ist].nodetype == qn::NodeType::Source)
continue;
533 for (std::size_t k = 0; k < R; ++k) {
535 for (std::size_t sf2 = 0; sf2 < S; ++sf2)
536 for (std::size_t r = 0; r < R; ++r)
537 acc += T(TS(sf2, r) * L.
rt(sf2 * R + r, sf_i * R + k));
546 for (std::size_t ist = 0; ist < M; ++ist) {
548 if (ind == 0 || ind > ANn.
rows())
continue;
549 for (std::size_t k = 0; k < R; ++k) AN(ist, k) = ANn(ind - 1, k);
555 bool any_place =
false;
556 for (std::size_t a = 0; a < L.
nodes.size() && !any_place; ++a)
557 any_place = L.
nodes[a].nodetype == qn::NodeType::Place;
561 for (std::size_t pp = 0; pp < fr.
place_nodes.size(); ++pp) {
563 if (ist == 0)
continue;
564 for (std::size_t k = 0; k < R; ++k) {
566 for (std::size_t mm = 0; mm < fr.
x.size(); ++mm) {
567 const std::size_t col = pp * fr.
nclasses + k;
587 for (std::size_t i = 0; i < AN.
rows(); ++i)
588 for (std::size_t k = 0; k < AN.
cols(); ++k)
600 if (TH.
rows() == 0 || TN.
rows() == 0) {
605 if (ANn.
rows() > 0) {
607 for (std::size_t ist = 0; ist < M; ++ist) {
609 if (ind == 0 || ind > ANn.
rows())
continue;
610 for (std::size_t k = 0; k < R; ++k) AN(ist, k) = ANn(ind - 1, k);
632enum class MetricKind { QLen, Util, RespT, ResidT, Tput, ArvR };
643 const std::vector<std::vector<bool>>* zero_mask) {
658 bool has_fj =
false, has_cache =
false, has_spn =
false;
660 if (nd.
nodetype == qn::NodeType::Fork || nd.
nodetype == qn::NodeType::Join) has_fj =
true;
661 if (nd.
nodetype == qn::NodeType::Cache) has_cache =
true;
662 if (nd.
nodetype == qn::NodeType::Transition) has_spn =
true;
668 std::vector<bool> is_cache_class(K,
false);
671 for (std::size_t r = 0; r < cp.
hitclass.size(); ++r) {
674 is_cache_class[cp.
missclass[r] - 1] =
true;
679 for (std::size_t i = 0; i < M; ++i) {
681 const bool src_or_sink = (nt == qn::NodeType::Source || nt == qn::NodeType::Sink);
682 bool kind_disabled =
false;
687 kind_disabled = src_or_sink;
690 kind_disabled = src_or_sink || nt == qn::NodeType::Fork || nt == qn::NodeType::Join;
694 kind_disabled =
false;
697 if (kind_disabled)
continue;
720 bool service_tunnel = (nt == qn::NodeType::Source || nt == qn::NodeType::Fork ||
721 nt == qn::NodeType::Join);
722 if (nt == qn::NodeType::Place) {
723 service_tunnel =
true;
724 for (std::size_t k = 0; k < K && k < L.
service[i].size(); ++k)
725 if (!L.
service[i][k].disabled) { service_tunnel =
false;
break; }
727 for (std::size_t k = 0; k < K; ++k) {
728 if (!L.
disabled[i][k] || service_tunnel) {
729 out(i, k) = metric(i, k);
730 }
else if (is_cache_class[k] &&
735 out(i, k) = metric(i, k);
740 for (std::size_t i = 0; i < M; ++i)
741 for (std::size_t k = 0; k < K; ++k)
742 if ((*zero_mask)[i][k]) out(i, k) = zero;
743 for (std::size_t i = 0; i < M; ++i)
744 for (std::size_t k = 0; k < K; ++k)
747 for (std::size_t k = 0; k < K; ++k) {
749 for (std::size_t cc = 0; cc < L.
nchains; ++cc)
750 if (L.
chains[cc][k]) c = cc;
752 for (std::size_t i = 0; i < M; ++i) {
754 if ((has_fj || has_cache || has_spn) &&
799 (void)L; (void)QN; (void)UN; (void)RN; (void)TN;
803 bool any_open =
false;
804 for (std::size_t r = 0; r < K; ++r)
805 if (std::isinf(L.
classes[r].population)) any_open =
true;
806 if (!any_open)
return false;
808 const double dinf = std::numeric_limits<double>::infinity();
809 bool any_unstable =
false;
810 for (std::size_t i = 0; i < M; ++i) {
814 if (!std::isfinite(c) || c <= 0.0)
continue;
815 if (nt == qn::NodeType::Source || nt == qn::NodeType::Sink)
continue;
816 if (sch == qn::SchedStrategy::INF || sch == qn::SchedStrategy::EXT)
continue;
824 if (sch == qn::SchedStrategy::OI || sch == qn::SchedStrategy::PAS)
continue;
826 bool bounded = (i < L.
cap.size() && std::isfinite(L.
cap[i]));
827 if (!bounded && i < L.
classcap.size())
829 if (std::isfinite(cc)) { bounded =
true;
break; }
831 for (
const auto& rg : L.
regions)
832 if (i < rg.members.size() && rg.members[i]) { bounded =
true;
break; }
833 if (bounded)
continue;
835 bool reneges =
false;
838 if (reneges)
continue;
840 double lldpeak = 1.0;
841 for (
const T& v : L.
stations[i].lldscaling) {
843 if (std::isfinite(d) && d > 0.0 && d > lldpeak) lldpeak = d;
846 std::vector<double> rho(K, 0.0);
847 double rho_open = 0.0, rho_tot = 0.0;
848 for (std::size_t r = 0; r < K; ++r) {
851 if (rate > 0.0 && tp > 0.0) rho[r] = tp / (c * lldpeak * rate);
853 if (std::isinf(L.
classes[r].population)) rho_open += rho[r];
855 if (rho_open < 1.0 || rho_tot <= 0.0)
continue;
857 for (std::size_t r = 0; r < K; ++r) {
859 if (std::isinf(L.
classes[r].population) && rho[r] > 0.0) {
871 return "The model has unstable queues (utilization >= 1); station utilization is "
872 "reported capped at 1.0, queue length and response time as Inf.";
909 if ((method ==
"default" || method ==
"exact") &&
qn::is_oi_loss(L))
return;
960 "SolverMVA: this model uses a Finite Capacity Region (addRegion), which SolverMVA supports only "
961 "through method 'oqnrc' (an open network whose stations all sit in one region). Use SolverCTMC, "
962 "SolverSSA, SolverLDES or SolverJMT, or setCapacity for a single-station limit.");
987 std::string actualmethod, warning;
991 std::shared_ptr<qn::NetworkStruct<T>> refreshed;
1000 if (st.
sched == qn::SchedStrategy::OI || st.
sched == qn::SchedStrategy::PAS) oi =
true;
1003 "SolverMVA: method 'exact' requires a product-form solution; use 'mva' for the "
1004 "approximation based on the exact MVA algorithm");
1006 if (rm ==
"oqnrc") {
1008 actualmethod =
"oqnrc";
1016 std::vector<T> lam(
tr.V.classes.size() + 1,
1020 std::string am, wn, fjw;
1030 if (!fjw.empty()) warning = warning.empty() ? fjw : warning +
" " + fjw;
1045 std::vector<std::vector<bool>> mask(M, std::vector<bool>(K,
false));
1046 for (std::size_t i = 0; i < M; ++i)
1047 for (std::size_t k = 0; k < K; ++k)
1053 std::vector<std::vector<bool>> srcmask(M, std::vector<bool>(K,
false));
1054 for (std::size_t i = 0; i < M; ++i)
1055 if (L.
stations[i].nodetype == qn::NodeType::Source)
1056 for (std::size_t k = 0; k < K; ++k) srcmask[i][k] =
true;
1080 if (!warning.empty()) warning +=
" ";
1095 if (!warning.empty()) warning +=
" ";
1097 "SolverMVA does not handle immediate feedback (immfeed); the solver will treat "
1098 "self-loops as class-switching with re-queueing.";
What a solver observed about the Cache nodes of a model.
UnsupportedError(const std::string &what)
A network plus its refreshed NetworkStruct.
bool has_immediate_feedback() const
Whether immediate feedback is EFFECTIVE anywhere in the model.
std::size_t stateful_of_station(std::size_t st) const
std::size_t nof_nodes() const
std::size_t nof_stateful() const
std::vector< std::size_t > stateful_nodes
1-based node indices, ascending
std::vector< std::vector< Distrib< T > > > service
service[i][r], 0-based station and class; a disabled entry marks a pair never visited.
std::vector< std::vector< bool > > chains
(nchains x nclasses)
std::vector< std::size_t > refclass
(nchains) 1-based class, 0 = none
std::vector< std::vector< bool > > disabled
Matrix< T > rt
sn.rt and sn.rtnodes: the class-expanded routing.
std::map< std::size_t, CacheParam< T > > nodeparam
Cache parameters by 1-based NODE index; only Cache nodes have an entry.
std::vector< double > cap
sn.cap and sn.classcap: the total and per-class buffers.
std::vector< JobClass > classes
std::vector< Station< T > > stations
stations[k-1] is the k-th station
Matrix< T > rates
(nstations x nclasses) service rates and SCVs, with a PARALLEL disabled flag instead of MATLAB's NaN ...
T route_eff(std::size_t r, std::size_t s, std::size_t i, std::size_t j) const
The routing actually in force: the expansion when there is one, else P.
std::vector< std::vector< std::size_t > > inchain
1-based class indices per chain
bool has_multi_server() const
std::vector< NodeDef > nodes
every node, in creation order
std::vector< std::vector< double > > classcap
std::vector< Matrix< T > > visits
(nchains) each (nstateful x nclasses)
std::vector< std::pair< std::size_t, std::size_t > > fj
fj(f,j): the Join node j that closes the Fork node f, 1-based.
bool has_product_form() const
sn_has_product_form, conjunct for conjunct.
std::vector< std::size_t > station_to_node
(nstations) 1-based node index
std::vector< Region > regions
The fork-join fixed point that drives one inner MVA solve.
The Heidelberger-Trivedi fork-join transform, options.config.fork_join='ht'.
The fork-join transform SolverMVA applies before solving a layer that contains a Fork.
The inputs of a loss network solved by SolverNC, kept beside the result.
LU factorization with partial pivoting, templated on the number type.
The method names of each solver, in listing order.
Port of @@SolverMVA/mvaDispatch.m: one inner solve, choosing the analyzer that fits the model.
The option and result types every MVA analyzer shares.
SnPnFiringRates sn_pn_firing_rates(const qn::NetworkStruct< T > &sn, const Matrix< T > &TN, bool tput_is_tokens)
Ports of matlab/src/api/sn/sn_pn_firing_rates.m and sn_pn_avg_rates.m.
PatienceHandles< T > sn_patience_handles(const qn::NetworkStruct< T > &sn, std::size_t ist, std::size_t r)
Build the patience handles of station ist (0-based), class r.
bool sn_has_bursty_arrival(const qn::NetworkStruct< T > &sn)
std::string sn_patience_refusal(const qn::NetworkStruct< T > &sn, std::size_t ist, std::size_t r)
Port of sn_patience_refusal.m: the by-name refusal of a reneging patience that is not a Markovian law...
Matrix< T > sn_get_node_arvr_from_tput(const qn::NetworkStruct< T > &sn, const Matrix< T > &TN, const Matrix< T > &AN)
Port of sn_get_node_arvr_from_tput.
std::string sn_reducible_chain_refusal(const qn::NetworkStruct< T > &sn)
The by-name refusal of the first closed chain whose (station,class) routing has more than one closed ...
SchedStrategy
Scheduling disciplines, with the values of MATLAB SchedStrategy.
NodeType
Node kinds, with the values of MATLAB NodeType.
ImpatienceType
Impatience kinds, with the values of MATLAB ImpatienceType.
std::vector< std::string > methods(const std::string &solver)
Every method name the solver can be asked for, in listing order.
std::pair< std::string, std::string > mvablo_scope_reason(const qn::NetworkStruct< T > &L)
Port of mvablo_scope_reason.m: why method 'mvablo' cannot solve L, as {reason, kind}...
Matrix< T > sn_get_residt_from_respt(const qn::NetworkStruct< T > &L, const Matrix< T > &RN)
Port of sn_get_residt_from_respt: the per-JOB residence time.
Matrix< T > filter_metric(const qn::NetworkStruct< T > &L, const Matrix< T > &metric, MetricKind kind, const std::vector< std::vector< bool > > *zero_mask)
Port of filterMetric: what @@NetworkSolver/getAvg does between the analyzer and the caller.
MvaSolution< T > solver_oqnrc(const qn::NetworkStruct< T > &L, const MvaOptions &opt)
Port of solver_oqnrc.m.
bool sn_has_sjn(const qn::NetworkStruct< T > &L)
True when the layer has an SJF station, the reference's any(sn.sched == SchedStrategy....
std::string mva_single_class_open_reason(const qn::NetworkStruct< T > &L, const std::string &method)
RQNA and RQT decompose an open network into GI/G/1 queues and build one uncertainty set per flow out ...
bool cap_unstable_open_stations(const qn::NetworkStruct< T > &L, Matrix< T > &QN, Matrix< T > &UN, Matrix< T > &RN, const Matrix< T > &TN)
The saturated open-station rule of @@NetworkSolver/getAvg.m:221-308.
std::string mva_finite_source_variant(const qn::NetworkStruct< T > &L, const std::string &method)
Port of SolverMVA.finiteSourceVariant(sn, method): the finite-source closed form solver_mva_finite_so...
std::string mva_schmidt_ext_reason(const std::vector< double > &njobs, const std::vector< bool > &fcfs, const std::string &method)
The extended Schmidt method needs a customer of every class to tag.
bool sn_is_mm1k_loss(const qn::NetworkStruct< T > &L)
Port of matlab/src/api/sn/sn_is_mm1k_loss.m: a single-class open Source-Queue-Sink system whose queue...
MetricKind
Which metric is being filtered.
std::string polling_reason(const qn::NetworkStruct< T > &L, const std::string &method)
Why SolverMVA cannot answer a model holding a POLLING station under method, or "" when it can (or the...
std::string resolve_method(const qn::NetworkStruct< T > &L, const std::string &method)
Port of SolverMVA.resolveMethod: the feature-driven default -> rqna upgrade for a bursty single-class...
std::vector< std::string > list_valid_methods(const qn::NetworkStruct< T > &L)
Port of SolverMVA.listValidMethods.
std::string mva_erlanga_patience_reason(const qn::NetworkStruct< T > &L)
Why method 'erlanga' cannot answer this model's patience, or "".
bool sn_is_bas_model(const qn::NetworkStruct< T > &L)
Port of matlab/src/api/sn/sn_is_bas_model.m: a closed single-CLASS model with a BAS drop rule.
std::string mva_mvac_reason(const qn::NetworkStruct< T > &L, const std::string &method)
MVAC is the exact chain recursion over single-server fixed-rate (SSFR) queues and infinite-server cen...
void apply_analyzer_arvr(Matrix< T > &AN, const Matrix< T > &supplied)
Overwrite the routing-derived arrival rates with those an analyzer supplied (MvaSolution::AN,...
const char * unstable_open_warning()
The warning getAvg.m raises when cap_unstable_open_stations() fires.
void mva_check_finite_capacity(const qn::NetworkStruct< T > &L, const std::string &method)
Port of SolverMVA.supportsFiniteCapacity (SolverMVA.m:158-186), the structural capacity gate SolverMV...
std::pair< std::string, std::string > debemva_scope_reason(const qn::NetworkStruct< T > &L)
Port of debemva_scope_reason.m: why method 'debemva' cannot solve L, as {reason, kind}...
std::string mva_mapqn_reason(const qn::NetworkStruct< T > &L, const std::string &method)
The reason 'amva.mapqn' cannot solve L, or "" when it can (and "" for any other method).
FjMmt< T > fj_fork_join_transform(const qn::NetworkStruct< T > &L, const std::string &method)
options.config.fork_join -> the transform it names.
std::string mva_breakdown_reason(const qn::NetworkStruct< T > &L, const std::string &method)
Port of SolverMVA.supportsBreakdown: a station with Queue.setBreakdown is served by one arm,...
MvaSolution< T > fj_fixed_point(const qn::NetworkStruct< T > &L, FjMmt< T > &tr, std::vector< T > &lam, const MvaOptions &opt, InnerSolve inner, std::string *warning=nullptr)
Drive the fork-join fixed point of a transformed model to convergence.
void sn_apply_join_respt(const qn::NetworkStruct< T > &L, const Matrix< T > &QN, const Matrix< T > &AN, Matrix< T > &RN)
A Join reports the PER-SIBLING waiting time, QLen over the SIBLING ARRIVAL RATE, and not QLen over it...
std::string mva_closed_population_reason(const qn::NetworkStruct< T > &L, const std::string &method)
The closed-population AMVA family: an open chain, or a network outside strict product form,...
Matrix< T > sn_get_arvr_from_tput(const qn::NetworkStruct< T > &L, const Matrix< T > &TN)
Port of sn_get_arvr_from_tput: the arrival rate each station sees, from the throughputs and the class...
void check_method(const qn::NetworkStruct< T > &L, const std::string &method)
Port of runAnalyzerChecks' method gate: a method the solver does not list is refused before any analy...
std::pair< std::string, std::string > oqnrc_scope_reason(const qn::NetworkStruct< T > &L)
{reason, kind} of oqnrc_scope, two empty strings when 'oqnrc' can solve L.
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,...
DispatchResult< T > mva_dispatch(const qn::NetworkStruct< T > &L, const MvaOptions &opt, const Matrix< T > &init_sol)
The ladder itself.
ChainDemands< T > sn_get_demands_chain(const qn::NetworkStruct< T > &L)
Port of sn_get_demands_chain.
bool is_oi_loss(const NetworkStruct< T > &sn, std::size_t *qist=nullptr)
Port of sn_is_oi_loss.m: an open Source -> Queue -> Sink system (any number of classes,...
void check_binding_capacity(const std::string &solver, const NetworkStruct< T > &sn)
NetworkSolver.checkBindingCapacity (NetworkSolver.m:1172-1228): the shared structural gate for finite...
FeatureSet mva_feature_set(const std::string &raw_method)
SolverMVA.getFeatureSet, plus getMethodFeatureSet's per-method deltas.
void feature_gate(const std::string &solver, const FeatureSet &declared, const NetworkStruct< T > &sn, const std::string &requested_method="", const std::string &resolved_method="")
runAnalyzerChecks: refuse a model the solver does not declare, by name.
std::string mva_base_method(const std::string &method)
The method name with any leading "amva." alias stripped.
Conservation laws of a layered queueing network, enumerated from its structure.
std::vector< T > solve(const Matrix< T > &A, const std::vector< T > &b)
Convenience: solve Ax = b, leaving A and b untouched.
A queueing network and its refreshed NetworkStruct.
Chain aggregation and de-aggregation.
Port of matlab/src/api/sn/sn_has_bursty_arrival.m.
Ports of matlab/src/api/sn/sn_get_node_arvr_from_tput.m and sn_get_node_tput_from_tput....
Port of matlab/src/api/sn/sn_patience_handles.m.
Ports of matlab/src/api/sn/sn_pn_firing_rates.m and sn_pn_avg_rates.m.
Port of sn_reducible_chain_refusal.m: refusal of a closed chain whose (station,class) routing is redu...
The DECLARED side of the gate: one feature set per solver.
Closed networks with shortest-job-next (SJF) stations, ladder branch 0.
The <kind> part of a LINE:<category>:<kind> identifier (see _kb/17-error-vocabulary....
The patience law of one station-class pair, in the forms the solvers consume.
bool present
Whether the pair declares reneging at all; everything below is unset when false.
bool isExponential
Whether the law is exponential, in which case the analysis is exact.
What sn_pn_firing_rates returns; x empty means "no answer", as in the reference.
std::vector< std::vector< double > > produced
produced[mode][place * nclasses + class], the reference's (mm, pp, k).
std::vector< double > x
firing rate per mode
std::vector< std::size_t > place_nodes
1-based Place node indices
std::size_t nclasses
the stride of the two tables above
The metrics getAvg returns, after filtering.
std::shared_ptr< qn::NetworkStruct< T > > refreshed_struct
The struct whose cache self-switch carries the CONVERGED hit/miss split, filled by the cacheqn branch...
solvers::LossnInfo lossn
self.result.LossN: the loss-network inputs SolverNC keeps for getAvgLinkTable, EMPTY for every other ...
Matrix< T > RN
response time, per visit
std::string warning
The reference's own warning text, verbatim, empty when it did not warn.
Matrix< T > UN
utilization
solvers::FjMetrics< T > fj
self.result.FJ: the fork-join section metrics FJQLen, FJRespT and FJTput, filled by the solvers the f...
std::vector< T > listcost
(h) mean storage cost held by each cache list, K_j = sum_i sigma_i pi_ij, filled only by the NC cache...
std::optional< double > lognormconst
@@SolverNC/getProbNormConstAggr, i.e.
std::optional< bool > converged
Whether the fixed point met its tolerance, empty when the handler reports none.
Matrix< T > WN
residence time, per job
std::string method
the method asked for
std::string actualmethod
the algorithm that ran
std::vector< T > DropRateNfcr
Matrix< T > QN
queue length
std::vector< T > CN
system response time per class
std::vector< T > XN
system throughput per class
solvers::CacheMetrics< T > cache
What the cache branches observed, EMPTY on a model with no Cache node and on every solver that does n...
std::vector< T > QNfcr
Finite capacity region row (1 x K each), filled by method 'oqnrc' alone, EMPTY otherwise.
Matrix< T > AN
arrival rate
The chain-level view of a layer, as sn_get_demands_chain returns it.
std::vector< double > Nchain
(C) population, infinite for an open chain
What the dispatch returns: the metrics plus the algorithm that produced them.
std::string actualmethod
The concrete algorithm, as the reference's actualmethod.
std::string warning
Non-empty when the analyzer that ran would have raised a reference line_warning and still returned a ...
solvers::CacheMetrics< T > cache
What a cache branch measured, EMPTY on every model without a Cache.
std::shared_ptr< qn::NetworkStruct< T > > refreshed_struct
Set only by the integrated cacheqn branch: the converged struct whose routing carries the actual hit/...
The transformed layer and the bookkeeping the fixed point needs to drive it and to merge its results ...
static constexpr double FineTol
The options SolverMVA reads.
bool base_has_fork
Whether the model this solve came from has a Fork, which the model handed to the analyzer no longer d...
Class-level results, the [Q,U,R,T,C,X] of the MATLAB analyzers.
std::vector< T > QNfcr
Finite capacity region row (1 x K each), filled by solver_oqnrc alone and EMPTY otherwise: jobs in th...
Matrix< T > AN
Analyzer-supplied station arrival rates (M x K), NaN where the runner derives them from the routing; ...
std::vector< T > DropRateNfcr
std::optional< bool > converged
Whether the fixed point met its tolerance, or empty when the handler reports none.
solvers::FjMetrics< T > fj
Fork-join section metrics set by the fork-join fixed point (fj_driver.h); empty otherwise.
The parameters of a Cache node, MATLAB's sn.nodeparam{ind} for a Cache.
std::vector< std::size_t > missclass
std::vector< std::size_t > hitclass
One job class of the network.
double population
infinite for an open class
One station of the network.
std::vector< int > droprule
Per-class blocking rule as an INT, with 0 meaning "not set".
Every Cache node of the model, in node order; empty on a model with none.
self.result.FJ: one row per Fork/Join pair, one column per class.