LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
solver_mam_runner.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012-2026, QORE Lab, Imperial College London
3 * All rights reserved.
4 */
5#ifndef LINE_SOLVERS_MAM_SOLVER_MAM_RUNNER_H
6#define LINE_SOLVERS_MAM_SOLVER_MAM_RUNNER_H
7
8/**
9 * @file
10 * @ingroup line_solvers
11 * The SolverMAM class surface: `@@SolverMAM/runAnalyzer.m` and the gates around
12 * it.
13 *
14 * Everything that happens BEFORE and AFTER one inner solve lives here: the
15 * method whitelist (`SolverMAM.listValidMethods`), the per-method structural
16 * gates (`SolverMAM.supportsModelMethod`), the process gate, and the metric
17 * filter. `runAnalyzer`'s Finite Capacity Region rejection needs no counterpart:
18 * the C++ `NetworkStruct` has no region field, so such a model cannot be built.
19 *
20 * THE METRIC FILTER IS SHARED WITH SolverMVA AND SolverNC VERBATIM
21 * (`filter_metric`, `sn_get_residt_from_respt`, `sn_get_arvr_from_tput` in
22 * `solver_mva_runner.h`), because `@@NetworkSolver/getAvg` is
23 * solver-independent: it is literally the same code path for all three in the
24 * reference.
25 *
26 * NON-MARKOVIAN SERVICE IS CONVERTED, NOT REFUSED (since 2026-08-01).
27 * `solver_mam_analyzer.m:40` runs `sn_nonmarkov_toph` on its own copy of the
28 * struct, and so does `solver_mam_solve` here: a Gamma, Weibull, Lognormal,
29 * Pareto or Uniform is replaced by the two-moment concentrated-ME fit, or by the
30 * 20-phase Bernstein density fit under `phfit_cme = false`, and a Det by a
31 * 20-phase Erlang when `preserve_det` is off. The conversion runs AFTER the
32 * slotted test, which would otherwise see a continuous fit where a Geometric was
33 * declared. What survives the conversion and still reaches `check_processes` is
34 * NHPP / MAPt / PHt, whose content is a schedule that no homogeneous surrogate
35 * can carry, and those are refused by name.
36 *
37 * TWO GATES REMAIN STRICTER HERE THAN IN THE REFERENCE, and both are the honest
38 * outcome rather than a limitation:
39 *
40 * - A CLASS-SWITCHING CHAIN AT AN FCFS STATION. The reference's own chain-1
41 * mark collapse makes the marking handed to the queue solver disagree with
42 * the class count, and MATLAB then fails on a dimension mismatch. The
43 * analyzer refuses by name with both counts; see solver_mam_basic.h.
44 * - LOAD DEPENDENCE UNDER 'default' OUTSIDE THE LD-QBD SHAPE. MATLAB has no
45 * counterpart because it has no LoadDependence declaration for MAM at all
46 * (mam_feature_set's declaration is a C++-only widening, solver_feature_sets.h).
47 * `check_model_method` refuses a load-dependent model here when its shape is
48 * not the one `solver_mam_ldqbd` requires, because the featset gate cannot
49 * see topology and 'default' would otherwise fall through to
50 * `solver_mam_basic`, which never reads `st.lldscaling`.
51 */
52
53#include <algorithm>
54#include <cmath>
55#include <string>
56#include <vector>
57
70#include "line/util/error.h"
72
73namespace line {
74namespace mam {
75
76using lang::GlobalConstants;
77
78/**
79 * Port of `SolverMAM.listValidMethods`.
80 *
81 * The reference's list verbatim, in its order (the comment there records that
82 * test files index into it, so nothing may be inserted in the middle). A listed
83 * name that has no ported analyzer passes this gate and is then refused BY NAME
84 * by the dispatch, which is the honest outcome and different from silently
85 * solving a different model.
86 *
87 * `exact` at the end is the RCAT ALIAS -- `mam_dispatch.h` groups it with
88 * `inap`/`inaprc`/`inapinf`, exactly as `solver_mam_analyzer.m` does -- and
89 * NOT the retired autocat of `solver_mam_autocat.h`, whose own refusal message
90 * predates the reference re-advertising the name. `retrial` names the
91 * BMAP/PH/N/N analyzer that `default` also resolves to on a retrial topology.
92 */
93inline std::vector<std::string> list_valid_methods() {
94 // the names and their order are this solver's row of the method registry (doc/line-methods.json)
95 return ::line::method_registry::methods("MAM");
96}
97
98/**
99 * True for the four RCAT names that moved to SolverAG, with the redirect message.
100 *
101 * It lives here, and is called from `check_method` BEFORE the unlisted-method
102 * throw, because that ordering is the whole point: the names are no longer in
103 * `list_valid_methods`, so a caller carrying an old `options.method` would
104 * otherwise be told only that the method is "unsupported by this solver" and
105 * left to guess. `check_model_method` calls the same helper so the two paths
106 * cannot drift into two different messages.
107 */
108inline bool rcat_moved_to_ag(const std::string& method, std::string& why) {
109 if (method != "inap" && method != "inaprc" && method != "inapinf"
110 && method != "exact") {
111 return false;
112 }
113 why = "SolverMAM: the '" + method + "' method moved to SolverAG: RCAT decomposes the "
114 "model into cooperating agents rather than decomposing traffic, and no MAM "
115 "algorithm shares its machinery. Solve it with -s ag";
116 return true;
117}
118
119/**
120 * True for the methods that lower a LAL Composition (`lal::SolverMAM`) and have
121 * no counterpart on a LINE Network. They are listed in `list_valid_methods`, so
122 * that they are discoverable, and refused by `check_model_method` with the
123 * message of `@SolverMAM/runAnalyzer.m`.
124 */
125inline bool lal_only_method(const std::string& method) {
126 static const char* const names[] = {"finiteqbd", "reachableqbd", "infiniteqbd",
127 "jackson", "parallelqbd", "marked.thinning"};
128 for (const char* n : names)
129 if (method == n) return true;
130 return false;
131}
132
133/** An unlisted method is refused; one that MOVED is redirected by name. */
134inline void check_method(const std::string& method) {
135 const std::vector<std::string> valid = list_valid_methods();
136 if (std::find(valid.begin(), valid.end(), method) != valid.end()) return;
137 std::string why;
138 if (rcat_moved_to_ag(method, why)) throw UnsupportedError(ErrorKind{"Method"}, why);
139 throw UnsupportedError(ErrorKind{"Method"}, "SolverMAM: the '" + method + "' method is unsupported by this solver");
140}
141
142namespace runner_detail {
143
144/**
145 * The distributions `getFeatureSet` lists, plus the Markovian ones.
146 *
147 * Runs AFTER `sn_nonmarkov_toph`, so the families that have a Markovian
148 * surrogate are already gone; what can still arrive is a schedule family, whose
149 * whole content is the time dependence a single generator cannot carry.
150 *
151 * `is_discrete` is set when sn_is_discrete_time claimed the model: the lattice
152 * laws are then solved on their own time scale by solver_mam_dt and must not be
153 * refused for lacking a continuous phase-type fit, which is the only reason the
154 * refusal below exists.
155 */
156template <class T>
157void check_processes(const qn::NetworkStruct<T>& L, bool is_discrete, bool batch_gated = false) {
158 using lang::ProcessType;
159 if (is_discrete) return;
160 for (std::size_t i = 0; i < L.nstations; ++i)
161 for (std::size_t r = 0; r < L.nclasses; ++r) {
162 if (L.disabled[i][r]) continue;
163 const ProcessType p = L.service[i][r].type;
164 if (basic_detail::is_markovian_type(p) || p == ProcessType::DET) continue;
165 // A stationary BMAP is a Markovian family, not a schedule. On the
166 // steady-state entry the dispatch's node gate owns it by name: a
167 // bulk server and a batch-emitting source are refused there, and a
168 // source whose only batch block has size 1 is the MAP it reduces
169 // to, which the reference solves. Refusing it here preempted both
170 // messages with the schedule one and refused the solvable case.
171 if (p == ProcessType::BMAP) {
172 if (batch_gated) continue;
173 throw UnsupportedError(ErrorKind{"BMAP"},
174 std::string("SolverMAM: station '") + L.stations[i].name + "' class '" +
175 L.classes[r].name + "' uses a batch (BMAP) process, which this SolverMAM "
176 "entry does not analyse. Use SolverLDES");
177 }
178 throw UnsupportedError(ErrorKind{"Distribution"},
179 std::string("SolverMAM: station '") + L.stations[i].name + "' class '" +
180 L.classes[r].name + "' uses a " + lang::process_to_text(p) +
181 " service process, which sn_nonmarkov_toph has no Markovian surrogate for: its "
182 "content is a piecewise-constant SCHEDULE, and collapsing it to one homogeneous "
183 "generator would answer for a stationary model the caller did not describe. Solve "
184 "it with SolverFLD or SolverLDES, which integrate the schedule");
185 }
186}
187
188/**
189 * True when any station declares a non-trivial load-dependent scaling, the
190 * same test `used_lang_features` (feature_set.h) applies to derive
191 * Feature::LoadDependence.
192 */
193template <class T>
194bool has_load_dependence(const qn::NetworkStruct<T>& L) {
195 for (const qn::Station<T>& st : L.stations)
196 if (!st.lldscaling.empty()) return true;
197 return false;
198}
199
200/** True when the model declares at least one G-network signal class. */
201template <class T>
202bool has_signal_class(const qn::NetworkStruct<T>& L) {
203 for (std::size_t r = 0; r < L.issignal.size(); ++r)
204 if (L.issignal[r]) return true;
205 return false;
206}
207
208/**
209 * `mam_buffer_refusal.m`: why no MAM method can answer a model whose finite
210 * buffer a CLOSED class can fill, or "" when every binding buffer is reached by
211 * open classes only.
212 *
213 * A MAM analyzer represents a finite buffer as a LOSS buffer (M/M/c/K,
214 * MMAP[K]/G/1/K, truncate-and-renormalize). That is the right model for an OPEN
215 * class, whose refused arrival is lost. A closed job that finds no room BLOCKS
216 * instead, and no MAM analyzer blocks: the loss formulas answer a different
217 * system, and the closed routes of 'default' (solver_mam_ldqbd,
218 * solver_mam_bgchain, solver_mna_closed) read no cap or classcap at all, so
219 * they would answer the model with the buffer removed.
220 *
221 * Only a buffer that can BIND counts, which is what `buffer_size`
222 * (sn_get_buffer_size) decides: refresh_capacity derives a finite classcap (the
223 * chain population) at every station of every closed model, so a plain
224 * finiteness test would refuse every closed model. A Cache builds its own
225 * capped retrieval queues and is exempt, as in `has_blocking`.
226 */
227template <class T>
228std::string mam_buffer_refusal(const qn::NetworkStruct<T>& L) {
229 for (const qn::NodeDef& nd : L.nodes)
230 if (nd.nodetype == qn::NodeType::Cache) return std::string();
231 if (L.classcap.empty()) return std::string();
232 for (std::size_t ist = 1; ist <= L.nstations && ist <= L.classcap.size(); ++ist) {
233 if (!std::isfinite(L.buffer_size(ist))) continue;
234 for (std::size_t r = 0; r < L.nclasses; ++r) {
235 if (!std::isfinite(L.classes[r].population)) continue; // open class
236 if (!(L.classcap[ist - 1][r] > 0.0)) continue; // not served here
237 return "Station " + L.stations[ist - 1].name +
238 " carries a finite capacity that binds for the closed class " +
239 L.classes[r].name +
240 ". SolverMAM represents a finite buffer as a LOSS buffer (M/M/c/K, "
241 "MMAP[K]/G/1/K, truncate-and-renormalize), which is the open-class model: a "
242 "closed job that finds no room blocks instead, and no MAM analyzer blocks, "
243 "while the closed routes of the default method (ldqbd, bgchain, mna) read no "
244 "capacity at all. Use SolverCTMC, SolverSSA or SolverLDES, or SolverMVA with "
245 "method 'sqd' for blocking after service.";
246 }
247 }
248 return std::string();
249}
250
251/**
252 * `mam_ldqbd_applicable.m`: why the 'ldqbd' method cannot answer this model,
253 * or "" when it can. THE RULE IS A SHAPE: one class, and either one Source plus
254 * one FCFS Queue fed by a Poisson stream (open) or one Delay plus one FCFS Queue
255 * with a positive population (closed). Checking only the class count let the
256 * AUTO report offer mam.ldqbd on a closed FCFS tandem (BUG-105).
257 */
258template <class T>
259std::string mam_ldqbd_refusal(const qn::NetworkStruct<T>& L) {
261 if (L.nclasses != 1) return "SolverMAM: the ldqbd method requires a single-class model";
262 std::size_t nDelay = 0, nQueue = 0, nSource = 0, src = 0;
263 for (std::size_t i = 0; i < L.nstations; ++i) {
264 const SchedStrategy sc = L.stations[i].sched;
265 if (sc == SchedStrategy::INF) ++nDelay;
266 else if (sc == SchedStrategy::FCFS) ++nQueue;
267 else if (sc == SchedStrategy::EXT) {
268 if (nSource == 0) src = i + 1;
269 ++nSource;
270 }
271 }
272 const double pop = L.classes[0].population;
273 if (!std::isfinite(pop)) {
274 if (nSource != 1 || nQueue != 1 || L.nstations != 2)
275 return "SolverMAM: open LDQBD method requires exactly one Source and one Queue station";
276 if (L.procid(src, 1) != lang::ProcessType::EXP || L.phases_of(src, 1) > 1)
277 return "SolverMAM: open LDQBD method currently supports Poisson (exponential) arrivals "
278 "only; the Source uses a MAP/MMPP process";
279 return std::string();
280 }
281 if (!(pop > 0))
282 return "SolverMAM: closed LDQBD method requires a positive population";
283 if (nDelay != 1 || nQueue != 1 || L.nstations != 2)
284 return "SolverMAM: closed LDQBD method requires exactly one Delay and one Queue station";
285 return std::string();
286}
287
288/** `SolverMAM.supportsModelMethod`, the per-method structural gates. */
289template <class T>
290void check_model_method(const qn::NetworkStruct<T>& L, const std::string& method,
291 bool transient = false, std::size_t sync_phases = 0) {
292 using lang::ProcessType;
293 // The RCAT methods moved to SolverAG. `check_method` normally reports this
294 // first; the same helper is used here so a direct caller of
295 // check_model_method (the twin of SolverMAM.supportsModelMethod, which the
296 // reference also answers false for) gets the identical message.
297 {
298 std::string why;
299 if (rcat_moved_to_ag(method, why)) throw UnsupportedError(ErrorKind{"Method"}, why);
300 }
301 // The LAL lowerings read agents and synchronisations, which a Network has not.
302 if (lal_only_method(method))
303 throw UnsupportedError(ErrorKind{"Method"}, "This MAM method requires a LAL Composition.");
304 // A stochastic Petri net goes to the iSPN analyzer (solver_mam_ispn.h), and
305 // 'ispn' needs one; the queueing gates below read no Place field.
306 {
307 const std::string why = ispn_refusal(L, method);
308 if (!why.empty()) throw UnsupportedError(ErrorKind{"Structure"}, why);
309 if (ispn_has_place(L)) return;
310 }
311 // G-network signals belong to the RCAT analyzer alone: no MAM algorithm
312 // reads issignal, so every one of them would solve the model with the
313 // signals turned into ordinary customers and report that as the answer.
314 if (has_signal_class(L)) {
315 throw UnsupportedError(
316 "SolverMAM: the " + method + " method does not support G-network signals: no MAM "
317 "algorithm reads issignal, so this method would solve the model with every signal "
318 "turned into an ordinary customer. Use SolverAG (-s ag), whose RCAT methods are "
319 "the only ones that model signals");
320 }
321 // A finite buffer a closed class can fill: no MAM analyzer blocks, so every
322 // method refuses it (the open loss case is the one the envelope declares).
323 // Same place as SolverMAM.supportsModelMethod, after the signal gate.
324 {
325 const std::string bufferWhy = mam_buffer_refusal(L);
326 if (!bufferWhy.empty()) throw UnsupportedError(ErrorKind{"Structure"}, bufferWhy);
327 }
328 if (method == "mna") {
329 bool open = false, closed = false;
330 for (const qn::JobClass& c : L.classes) {
331 if (std::isinf(c.population)) open = true;
332 else closed = true;
333 }
334 if (open && closed)
335 throw UnsupportedError(ErrorKind{"MixedNetwork"},
336 "SolverMAM: the mna method does not support mixed open/closed models");
337 // mam_feature_set declares RoutingStrategy_RROBIN for 'mna' because
338 // solver_mna_open resolves the deterministic split through
339 // npfqn_traffic_split_rr. solver_mna_closed has no counterpart -- the
340 // reference corrects the open traffic equations only -- so a closed
341 // round-robin model would be solved as if the dispatcher were random.
342 if (!open) {
343 for (const qn::NodeDef& nd : L.nodes)
344 for (qn::RoutingStrategy rs : nd.routing)
345 if (rs == qn::RoutingStrategy::RROBIN)
346 throw UnsupportedError(ErrorKind{"RoutingStrategy_RROBIN"},
347 "SolverMAM: the mna method supports round-robin routing in open "
348 "models only");
349 }
350 } else if (method == "default") {
351 // mam_feature_set declares LoadDependence for 'default' because the
352 // single-class closed Delay+Queue shape routes here to solver_mam_ldqbd
353 // (mam_dispatch.h branch 2e), which reads st.lldscaling. The featset
354 // cannot see topology, so a load-dependent model outside that shape --
355 // or one carrying a setup/delay-off pair, which steals the same shape
356 // ahead of ldqbd -- must be refused here rather than falling through
357 // to solver_mam_basic, which never reads the field and would solve
358 // every level at the nominal rate.
359 if (has_load_dependence(L) &&
360 !(L.setupparam.empty() && dispatch_detail::is_closed_delay_queue(L)))
361 throw UnsupportedError(ErrorKind{"LoadDependence"},
362 "SolverMAM: this model uses load-dependent service rates outside the "
363 "single-class closed Delay+Queue shape that solver_mam_analyzer.m routes to the "
364 "level-dependent QBD (solver_mam_ldqbd); the 'default' method would otherwise "
365 "fall through to solver_mam_basic's dec.source decomposition, which does not "
366 "read the load-dependent scaling and would solve every level at the nominal "
367 "rate. Call method 'ldqbd' directly, which refuses by name if the shape still "
368 "does not fit, or restructure the model to the required shape");
369 // mam_feature_set declares Reneging for 'default' because the MAP/M/s+G
370 // shape routes to solver_mam_reneging (mam_dispatch.h branch 2d); any
371 // other reneging model would fall through to dec.source, which reads no
372 // patience. Same predicate as the dispatch.
373 const std::string renWhy = mam_reneging_default_refusal(L);
374 if (!renWhy.empty()) throw UnsupportedError(ErrorKind{"Reneging"}, renWhy);
375 } else if (method == "ldqbd") {
376 // As in SolverMAM.m, a transient run the transient QBD can take is exempt:
377 // that engine is not bound to the steady-state LD-QBD shape.
378 if (!(transient && mam_transient_qbd_applicable(L))) {
379 const std::string ldWhy = mam_ldqbd_refusal(L);
380 if (!ldWhy.empty()) throw UnsupportedError(ErrorKind{"LoadDependence"}, ldWhy);
381 }
382 } else if (method == "retrial") {
383 // A "MUST BE PRESENT" RULE, which is why it cannot live in a feature
384 // set: a FeatureSet says "I accept this construct", so it can refuse a
385 // model for HAVING something and never for LACKING it.
386 // solver_mam_retrial needs the BMAP/PH/N/N bufferless retrial topology
387 // of Dudin et al. to analyze, and a model without one is not a smaller
388 // retrial model, it is a different one. mam_retrial_refusal is the same
389 // predicate mam_dispatch's 'retrial' arm and auto_family_refusal ask,
390 // and it reports WHICH requirement the model missed.
391 const std::string retrialWhy = mam_retrial_refusal(L);
392 if (!retrialWhy.empty()) throw UnsupportedError(ErrorKind{"Retrial"}, retrialWhy);
393 } else if (method == "sync.faster" || method == "sync.slower") {
394 // One M/G/c/K station of a deterministic or phase-type law: the
395 // predicate the dispatch arm and solver_mam_sync also ask.
396 const std::string syncWhy = mam_sync_refusal(L, sync_phases);
397 if (!syncWhy.empty())
398 throw UnsupportedError(ErrorKind{"Structure"}, "SolverMAM: " + syncWhy);
399 } else if (method == "bgchain") {
400 // The closed classes ARE the background chain, so a purely open model has
401 // nothing to build it from. A purely CLOSED one is accepted: it is the
402 // degenerate case where the chain answers alone, with no open work to
403 // modulate it.
404 bool hasClosed = false;
405 for (std::size_t k = 0; k < L.nclasses; ++k) {
406 if (!std::isinf(L.classes[k].population)) hasClosed = true;
407 }
408 if (!hasClosed)
409 throw UnsupportedError(ErrorKind{"OpenClass"},
410 "SolverMAM: the bgchain method requires at least one closed class: the background "
411 "chain IS the closed population vector, which a purely open model does not have. "
412 "Use the dec.source method");
413 // Priority disciplines need the per-class QBD of MMAPPH1PRPR, which has
414 // no counterpart in the modulated level-dependent QBD this method builds.
415 bool prioSched = false;
416 for (std::size_t i = 0; i < L.nstations; ++i) {
417 const lang::SchedStrategy sc = L.stations[i].sched;
419 prioSched = true;
420 }
421 if (prioSched && L.has_distinct_priorities())
422 throw UnsupportedError(ErrorKind{"Priority"},
423 "SolverMAM: the bgchain method does not support class priorities: it aggregates "
424 "the open classes into one phase-type mixture per station, which cannot express a "
425 "priority order. Use the dec.source method");
426 if (L.has_fork())
427 throw UnsupportedError(ErrorKind{"Fork"},
428 "SolverMAM: the bgchain method does not support fork-join: the background chain "
429 "conserves the closed population per station, which a fork violates. Use the "
430 "dec.source method");
431 }
432}
433
434} // namespace runner_detail
435
436/**
437 * `check_model_method` asked WITHOUT raising: the same verdict as a sentence.
438 *
439 * `autosolver::auto_family_refusal` needs a reason rather than an exception --
440 * the report answers yes or no per (family, method) pair and prints why -- and
441 * asking the gate itself is what keeps the offered pairs and the runnable ones
442 * the same set. Duplicating the rules there is how a method comes to be offered
443 * on a model its own runner refuses, which is exactly what happened to
444 * 'dec.mmap' and 'retrial'.
445 */
446template <class T>
447std::string mam_model_method_refusal(const qn::NetworkStruct<T>& L, const std::string& method) {
448 try {
449 runner_detail::check_model_method(L, method);
450 } catch (const std::exception& e) {
451 return std::string(e.what());
452 }
453 return std::string();
454}
455
456/**
457 * The gates and the dispatch of `@@SolverMAM/runAnalyzer.m`, without the metric
458 * filter.
459 */
460template <class T>
462 check_method(opt.method);
463 runner_detail::check_model_method(L, opt.method, false, opt.sync_phases);
464 // A stochastic Petri net under 'default' or 'ispn' (check_model_method
465 // refused every other method): the iSPN analyzer, ahead of the phase-type
466 // conversion and the queueing feature gate, neither of which reads a Place.
467 if (ispn_has_place(L)) {
469 return finish_dispatch(L, out);
470 }
471 // Whether the slotted path will claim the model, which decides both the
472 // process gate below and branch -1 of the dispatch. Asking here keeps the
473 // two answers from diverging.
474 bool is_discrete = false;
475 if constexpr (num_traits<T>::has_transcendental) {
477 dtopt.timescale = opt.timescale;
478 dtopt.slotted = opt.slotted;
479 dtopt.slotlength = opt.slotlength;
480 double slot = 1.0;
482 is_discrete = api::sn_is_discrete_time(L, dtopt, &slot, &dtinfo);
483 }
484
485 // `solver_mam_analyzer.m:40` runs sn_nonmarkov_toph on its own copy, AFTER
486 // the slotted test (which would otherwise see a continuous CME where a
487 // Geometric was declared) and with preserveDet on for every method but
488 // 'bgchain', so the exact MAP/D/c branch still sees its Det while bgchain,
489 // which has no deterministic-service branch, gets the Det fitted to PH.
490 // That resolution lives in MamOptions::preserve_det_resolved. The struct is
491 // copied only when something in it would actually be replaced.
492 // The RCAT methods build a CTMC per component out of (D0,D1), so a preserved
493 // Det would reach them with no matrix at all and be read back as its mean
494 // rate, and a concentrated matrix exponential is not a generator at all.
495 // They need a genuine phase-type, as SSA, Fluid and JMT do.
496 const bool preserve_det = opt.preserve_det_resolved();
497 qn::NetworkStruct<T> converted;
498 const qn::NetworkStruct<T>* Lp = &L;
499 if constexpr (num_traits<T>::has_transcendental) {
500 if (!is_discrete && api::nonmkv_enabled(opt.nonmkv) && api::sn_has_nonmarkov(L, preserve_det)) {
501 converted = L;
503 no.order = opt.nonmkv_order;
504 no.phfit = opt.phfit_cme ? api::PhFit::Cme : api::PhFit::Ph;
505 no.preserve_det = preserve_det;
506 api::sn_nonmarkov_toph(converted, no);
507 Lp = &converted;
508 }
509 }
510 const qn::NetworkStruct<T>& Lc = *Lp;
511
512 runner_detail::check_processes(Lc, is_discrete, true);
513 // runAnalyzerChecks' universal feature gate, AFTER the three structural
514 // checks so their specific messages (map_bernstein, single-class ldqbd,
515 // single-server inap, and the load-dependence shape check just above)
516 // still win. The declared set carries LoadDependence over MATLAB's for
517 // 'default' and 'ldqbd' only, without which every ldqbd model would
518 // refuse here; every other method leaves it undeclared, so a
519 // load-dependent model under 'dec.source', 'dec.poisson' or 'mna' is
520 // refused cleanly by the gate instead of silently solved at nominal rates.
521 qn::feature_gate("SolverMAM", qn::mam_feature_set(opt.method), Lc);
522 return mam_dispatch(Lc, opt);
523}
524
525/**
526 * Port of `@@SolverMAM/runAnalyzer.m` for the `lang='matlab'` path: solve, then
527 * apply the metric filter `@@NetworkSolver/getAvg` puts between the analyzer and
528 * the caller.
529 */
530template <class T>
532 const std::string origmethod = opt.method;
533 const MamSolution<T> d = solver_mam_solve(L, opt);
534 const mva::MvaSolution<T>& s = d.sol;
535
536 const std::size_t M = L.nstations, K = L.nclasses;
537 std::vector<std::vector<bool>> mask(M, std::vector<bool>(K, false));
538 for (std::size_t i = 0; i < M; ++i)
539 for (std::size_t k = 0; k < K; ++k)
540 mask[i][k] = num_traits<T>::to_double(s.R(i, k)) < 10.0 * GlobalConstants::FineTol;
541 std::vector<std::vector<bool>> srcmask(M, std::vector<bool>(K, false));
542 for (std::size_t i = 0; i < M; ++i)
543 if (L.stations[i].nodetype == qn::NodeType::Source)
544 for (std::size_t k = 0; k < K; ++k) srcmask[i][k] = true;
545
547 out.QN = mva::filter_metric(L, s.Q, mva::MetricKind::QLen, &mask);
548 out.UN = mva::filter_metric(L, s.U, mva::MetricKind::Util, &mask);
549 out.RN = mva::filter_metric(L, s.R, mva::MetricKind::RespT, nullptr);
550 out.TN = mva::filter_metric(L, s.Tp, mva::MetricKind::Tput, nullptr);
552 mva::MetricKind::ResidT, nullptr);
554 &srcmask);
555 // The saturated open-station rule of getAvg.m, applied AFTER out.WN so the
556 // residence times keep their pre-saturation value. Without it SolverMAM
557 // reported the `Uden = min(1-FineTol, sum(UN))` clamp's own artefact --
558 // `QLen 9.99e7, RespT 5.33e8` -- where MATLAB reports Inf. The clamp is in
559 // the reference too; what was missing is this layer above it.
560 if (mva::cap_unstable_open_stations(L, out.QN, out.UN, out.RN, out.TN))
561 out.warning = out.warning.empty()
563 : out.warning + " " + mva::unstable_open_warning();
564 out.CN = s.C;
565 out.XN = s.X;
566 out.method = origmethod;
567 // `runAnalyzer` reports 'default/<algorithm>' when the caller asked for the
568 // default, so the algorithm that produced the numbers is never lost.
569 out.actualmethod = (origmethod == "default" && !d.actualmethod.empty())
570 ? "default/" + d.actualmethod
571 : d.actualmethod;
572 out.iter = s.iter;
573 return out;
574}
575
576// ---------------------------------------------------------------------------
577// The rest of the @@SolverMAM class surface.
578//
579// Each of these mirrors one accessor and does its own gating; they take the
580// converged `AvgResult` where the reference calls `self.getAvg()` first, so a
581// caller cannot reach them on an unsolved model by accident.
582// ---------------------------------------------------------------------------
583
584/** `@@SolverMAM/getProb.m`: the joint (level, phase) table at a node. */
585template <class T>
587 std::size_t node, const mva::AvgResult<T>& avg) {
588 ispn_refuse_entry(L, "getProb");
589 return solver_mam_getprob(L, opt, node, avg);
590}
591
592/** `@@SolverMAM/getProbMarg.m`: P(n jobs of one class) at a station. */
593template <class T>
595 std::size_t ist, std::size_t jobclass,
596 const mva::AvgResult<T>& avg) {
597 ispn_refuse_entry(L, "getProbMarg");
598 return solver_mam_getprobmarg(L, opt, ist, jobclass, avg);
599}
600
601/** `@@SolverMAM/getMAMResult.m`: the M/G/1-type internals of a single queue. */
602template <class T>
607
608/**
609 * `@@SolverMAM/getCdfRespT.m`: the response-time CDF per class.
610 *
611 * `getSjrnT` and `sjrnT` are aliases of this in the reference and are not given
612 * separate entry points here; there is nothing for them to do that this does
613 * not already do, and a second name for one function is a maintenance cost
614 * rather than a feature.
615 */
616template <class T>
617std::vector<RespTCdf<T>> solver_mam_get_cdf_respt(const qn::NetworkStruct<T>& L,
618 const MamOptions& opt) {
619 check_method(opt.method);
620 ispn_refuse_entry(L, "getCdfRespT");
621 runner_detail::check_model_method(L, opt.method);
622 // The same non-Markovian conversion the steady-state entry runs. NOT
623 // exempted for a slotted model: solver_mam_passage_time reads the CONTINUOUS
624 // phase-type fit, so a lattice law has to be refused here even though the
625 // steady-state entry solves it on its own time scale.
626 const bool preserve_det = opt.preserve_det_resolved();
627 qn::NetworkStruct<T> converted;
628 const qn::NetworkStruct<T>* Lp = &L;
629 if constexpr (num_traits<T>::has_transcendental) {
630 if (api::nonmkv_enabled(opt.nonmkv) && api::sn_has_nonmarkov(L, preserve_det)) {
631 converted = L;
633 no.order = opt.nonmkv_order;
634 no.phfit = opt.phfit_cme ? api::PhFit::Cme : api::PhFit::Ph;
635 no.preserve_det = preserve_det;
636 api::sn_nonmarkov_toph(converted, no);
637 Lp = &converted;
638 }
639 }
640 runner_detail::check_processes(*Lp, false);
641 return solver_mam_passage_time(*Lp, opt);
642}
643
644/** `@@SolverMAM/getSjrnT.m` and `sjrnT.m`, both aliases of getCdfRespT. */
645template <class T>
646std::vector<RespTCdf<T>> solver_mam_get_sjrn_t(const qn::NetworkStruct<T>& L,
647 const MamOptions& opt) {
648 return solver_mam_get_cdf_respt(L, opt);
649}
650
651/**
652 * Whether `getPerctRespT` reads the FJ_codes table rather than inverting a CDF.
653 *
654 * The reference decides by whether the last solve left a `result.Percentile`
655 * behind, which happens exactly when the analyzer took branch 2a. That is a
656 * state test on a stateless interface here, so the condition is recomputed from
657 * the model. Exposed rather than inlined because the CLI needs the SAME answer:
658 * a fork-join model has no response-time CDF at all, so a caller that asked for
659 * one must be told which of the two it is getting.
660 *
661 * Compiled out below double: `mam_fj_is_homogeneous` fits a phase-type per
662 * branch and is not instantiable in an exact field.
663 */
664template <class T>
666 if constexpr (!num_traits<T>::has_transcendental) {
667 (void)L;
668 (void)opt;
669 return false;
670 } else {
671 // Branch 2a is reachable from 'default' and 'dec.source' only; any other
672 // method names a different analyzer, which stores no percentile table.
673 if (opt.method != "default" && opt.method != "dec.source") return false;
674 if (L.fj.empty()) return false;
675 return mam_fj_is_homogeneous(L).ok;
676 }
677}
678
679/**
680 * `@@SolverMAM/getPerctRespT.m`: response-time percentiles per class.
681 *
682 * TWO PATHS, split by `mam_has_fj_percentiles`: a homogeneous fork-join model
683 * reads the table FJ_codes stored, and everything else inverts the
684 * response-time CDF. Any other fork-join model is refused by name.
685 */
686template <class T>
687std::vector<std::vector<T>> solver_mam_get_perct_respt(const qn::NetworkStruct<T>& L,
688 const MamOptions& opt,
689 const std::vector<double>& percentiles) {
690 ispn_refuse_entry(L, "getPerctRespT");
692 return solver_mam_fj_percentiles(L, opt, percentiles);
693 // A fork-join off the homogeneous FJ_codes topology was solved by dec.source.mmap, which yields means only, and
694 // the passage-time CDF has no fork-join arm: name the reason, as getPerctRespT.m does, instead of inverting it.
695 if (L.has_fork()) {
696 std::string why = "the model is solved in an exact field, where the FJ_codes phase-type fit is unavailable.";
697 if constexpr (num_traits<T>::has_transcendental) {
698 if (opt.method != "default" && opt.method != "dec.source")
699 why = "method '" + opt.method + "' stores no fork-join percentile table.";
700 else
701 why = mam_fj_is_homogeneous(L).why;
702 }
703 throw UnsupportedError(ErrorKind{"Fork"},
704 "SolverMAM computes fork-join response-time percentiles only on the Source->Fork->K identical "
705 "queues->Join->Sink topology (Qiu-Perez-Harrison FJ_codes): " + why +
706 " Use fj::fj_tail_forktail for the topology-driven approximation.");
707 }
708 const std::vector<RespTCdf<T>> rd = solver_mam_get_cdf_respt(L, opt);
709 std::vector<std::vector<T>> out;
710 out.reserve(rd.size());
711 for (const RespTCdf<T>& c : rd) out.push_back(mam_percentiles_from_cdf(c, percentiles));
712 return out;
713}
714
715/**
716 * Port of `@@SolverMAM/getTranAvg.m`: transient queue length, utilization and
717 * throughput.
718 *
719 * The reference forces `options.method = 'ldqbd'` and `options.lang = 'matlab'`
720 * before delegating, so the transient path is NOT selected by the caller's
721 * method; it is fixed. Reproduced: this ignores `opt.method` entirely.
722 *
723 * Which engine runs is decided by `mam_transient_qbd_applicable`: a correlated
724 * or non-Poisson arrival, or a non-renewal service, goes to the Laplace-domain
725 * transient QBD, and everything else to the QBD fast path.
726 */
727template <class T>
729 ispn_refuse_entry(L, "getTranAvg");
730 MamOptions opt = opt_in;
731 opt.method = "ldqbd";
732 runner_detail::check_model_method(L, opt.method, true);
733 // As in the passage-time entry: the transient engines are continuous-time,
734 // so a lattice law is refused rather than read through its continuous fit.
735 runner_detail::check_processes(L, false);
736 // The transient entry never reaches solver_mam_solve, so it needs its own
737 // gate, and that gate is NOT the steady-state ldqbd envelope even though the
738 // method name says ldqbd. `ldqbd` withdraws FiniteCapacity because the
739 // steady-state LD-QBD solves the buffer away, but BOTH transient engines
740 // honour it: solver_mam_transient_qbd builds the level-dependent generator up
741 // to the cap, and solver_mam_ldqbd_transient integrates that same generator.
742 // The M/M/1/5 case in test_mam.cpp checks the exact stationary law the
743 // construction never uses, so it is a genuine oracle for the limit. Gating
744 // this entry on the steady-state set refused a model these engines solve.
745 qn::FeatureSet tranSet = qn::mam_feature_set(opt.method);
746 tranSet.set(qn::Feature::FiniteCapacity);
747 qn::feature_gate("SolverMAM", tranSet, L);
750}
751
752} // namespace mam
753} // namespace line
754
755#endif // LINE_SOLVERS_MAM_SOLVER_MAM_RUNNER_H
UnsupportedError(const std::string &what)
Definition error.h:119
A subset of the registry: MATLAB's SolverFeatureSet, whose list is a flag per field.
FeatureSet & set(Feature f)
A network plus its refreshed NetworkStruct.
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 > > disabled
std::vector< JobClass > classes
std::vector< Station< T > > stations
stations[k-1] is the k-th station
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.
The exception types the port throws.
Port of solver_mam_analyzer.m: one inner solve, choosing the analyzer that fits the model and the req...
The option and result types SolverMAM shares with its analyzers.
The method names of each solver, in listing order.
bool sn_has_nonmarkov(const qn::NetworkStruct< T > &sn, bool preserve_det=false)
Whether any law in the struct would be replaced, so a caller can skip copying the struct when there i...
bool nonmkv_enabled(const std::string &method)
Resolve options.config.nonmkv to NonmarkovOptions::enabled.
@ Ph
Bernstein density fit: a genuine phase-type, shape-carrying.
@ Cme
concentrated ME plus exponential tail: two moments, exactly
void sn_nonmarkov_toph(qn::NetworkStruct< T > &sn, const NonmarkovOptions &opts=NonmarkovOptions())
Replace every non-Markovian service and firing law by a Markovian surrogate.
bool sn_is_discrete_time(const qn::NetworkStruct< T > &sn, const DiscreteTimeOptions &options, double *slot_length, DiscreteTimeInfo *info)
True when every law of sn is lattice-valued on slot_length.
SchedStrategy
Scheduling disciplines, with the values of MATLAB SchedStrategy.
Definition lang_types.h:194
RoutingStrategy
Routing strategies, with the values of MATLAB RoutingStrategy.
Definition lang_types.h:430
ProcessType
Distribution kinds, with the values of MATLAB ProcessType.
Definition lang_types.h:524
const char * process_to_text(ProcessType p)
The MATLAB ProcessType name, as sn.procid prints it.
Definition lang_types.h:655
MamSolution< T > & finish_dispatch(const qn::NetworkStruct< T > &L, MamSolution< T > &out, bool pin_source=true)
What solver_mam_analyzer.m does AFTER whichever analyzer ran: pin the throughput of every EXT (Source...
std::vector< RespTCdf< T > > solver_mam_get_sjrn_t(const qn::NetworkStruct< T > &L, const MamOptions &opt)
@@SolverMAM/getSjrnT.m and sjrnT.m, both aliases of getCdfRespT.
qsys::BmapM1Result< T > solver_mam_getmamresult(const qn::NetworkStruct< T > &L)
Port of @@SolverMAM/getMAMResult.m: the matrix-analytic internals of a single-queue model,...
bool rcat_moved_to_ag(const std::string &method, std::string &why)
True for the four RCAT names that moved to SolverAG, with the redirect message.
void check_method(const std::string &method)
An unlisted method is refused; one that MOVED is redirected by name.
MamSolution< T > mam_dispatch(const qn::NetworkStruct< T > &L, const MamOptions &opt_in)
The ladder.
void ispn_refuse_entry(const qn::NetworkStruct< T > &L, const std::string &entry)
Refuses the SolverMAM entry point ENTRY on a stochastic Petri net model with LINE:unsupported:Place.
std::vector< T > mam_percentiles_from_cdf(const RespTCdf< T > &cdf, const std::vector< double > &pcts)
Port of the CDF path of @@SolverMAM/getPerctRespT.m: linear interpolation of the response-time CDF at...
TranResult< T > solver_mam_get_tran_avg(const qn::NetworkStruct< T > &L, const MamOptions &opt_in)
Port of @@SolverMAM/getTranAvg.m: transient queue length, utilization and throughput.
bool ispn_has_place(const qn::NetworkStruct< T > &L)
True when the model holds a Place node, i.e.
std::vector< std::string > list_valid_methods()
Port of SolverMAM.listValidMethods.
TranResult< T > solver_mam_transient_qbd(const qn::NetworkStruct< T > &L, const MamOptions &opt)
Port of solver_mam_transient_qbd.m.
MamSolution< T > solver_mam_solve(const qn::NetworkStruct< T > &L, const MamOptions &opt)
The gates and the dispatch of @@SolverMAM/runAnalyzer.m, without the metric filter.
std::vector< RespTCdf< T > > solver_mam_get_cdf_respt(const qn::NetworkStruct< T > &L, const MamOptions &opt)
@@SolverMAM/getCdfRespT.m: the response-time CDF per class.
std::vector< RespTCdf< T > > solver_mam_passage_time(const qn::NetworkStruct< T > &L, const MamOptions &opt)
Port of solver_mam_passage_time.m.
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...
bool lal_only_method(const std::string &method)
True for the methods that lower a LAL Composition (lal::SolverMAM) and have no counterpart on a LINE ...
ProbTable< T > solver_mam_get_prob(const qn::NetworkStruct< T > &L, const MamOptions &opt, std::size_t node, const mva::AvgResult< T > &avg)
@@SolverMAM/getProb.m: the joint (level, phase) table at a node.
bool mam_transient_qbd_applicable(const qn::NetworkStruct< T > &L)
Port of mam_transient_qbd_applicable.m: true when the Laplace-domain transient QBD should run instead...
MamFjInfo mam_fj_is_homogeneous(const qn::NetworkStruct< T > &L)
Port of fj_is_homogeneous.m.
std::vector< std::vector< T > > solver_mam_get_perct_respt(const qn::NetworkStruct< T > &L, const MamOptions &opt, const std::vector< double > &percentiles)
@@SolverMAM/getPerctRespT.m: response-time percentiles per class.
bool mam_has_fj_percentiles(const qn::NetworkStruct< T > &L, const MamOptions &opt)
Whether getPerctRespT reads the FJ_codes table rather than inverting a CDF.
std::vector< T > solver_mam_get_prob_marg(const qn::NetworkStruct< T > &L, const MamOptions &opt, std::size_t ist, std::size_t jobclass, const mva::AvgResult< T > &avg)
@@SolverMAM/getProbMarg.m: P(n jobs of one class) at a station.
TranResult< T > solver_mam_ldqbd_transient(const qn::NetworkStruct< T > &L, const MamOptions &opt)
Port of solver_mam_ldqbd_transient.m.
std::string mam_sync_refusal(const qn::NetworkStruct< T > &L, std::size_t nph, MamSyncParams< T > *par=nullptr)
mam_sync_applicable.m: why the sync methods cannot answer this model, or "" when they can,...
std::string mam_reneging_default_refusal(const qn::NetworkStruct< T > &L)
The sentence supportsModelMethod('default') refuses a declared reneging with when the model is not th...
std::string ispn_refusal(const qn::NetworkStruct< T > &L, const std::string &method)
Why the iSPN route cannot take this model under METHOD, or "" when it can or when the model is not a ...
ProbTable< T > solver_mam_getprob(const qn::NetworkStruct< T > &L, const MamOptions &opt, std::size_t node, const mva::AvgResult< T > &avg)
Port of @@SolverMAM/getProb.m.
std::string mam_model_method_refusal(const qn::NetworkStruct< T > &L, const std::string &method)
check_model_method asked WITHOUT raising: the same verdict as a sentence.
std::vector< std::vector< T > > solver_mam_fj_percentiles(const qn::NetworkStruct< T > &L, const MamOptions &opt, const std::vector< double > &percentiles)
@@SolverMAM/getPerctRespT.m's fork-join path: the percentiles solver_mam_fj.m stores in percResults....
MamSolution< T > solver_mam_ispn(const qn::NetworkStruct< T > &L, const MamOptions &opt)
The analyzer.
std::string mam_retrial_refusal(const qn::NetworkStruct< T > &L)
The 'retrial' method's applicability as one sentence; empty when applicable.
std::vector< T > solver_mam_getprobmarg(const qn::NetworkStruct< T > &L, const MamOptions &opt, std::size_t ist, std::size_t jobclass, const mva::AvgResult< T > &avg)
Port of @@SolverMAM/getProbMarg.m: P(n jobs of class jobclass) at station ist, for n = 0....
qsys::BmapM1Result< T > solver_mam_get_mam_result(const qn::NetworkStruct< T > &L)
@@SolverMAM/getMAMResult.m: the M/G/1-type internals of a single queue.
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.
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.
const char * unstable_open_warning()
The warning getAvg.m raises when cap_unstable_open_stations() fires.
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...
FeatureSet mam_feature_set(const std::string &method)
SolverMAM.getFeatureSet, the union of its four setTrue calls: 55 MATLAB names, WIDENED for 'default'/...
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.
Conservation laws of a layered queueing network, enumerated from its structure.
Definition aoi_dist2ph.h:51
A queueing network and its refreshed NetworkStruct.
Port of matlab/src/api/sn/sn_is_discrete_time.m.
Replace every non-Markovian service and firing law by a Markovian surrogate.
The DECLARED side of the gate: one feature set per solver.
Port of solver_mam_fj.m, the fork-join route of SolverMAM.
Port of solver_mam_ldqbd_transient.m: transient queue length, utilization and throughput of a single-...
Port of solver_mam_passage_time.m: the response-time (sojourn-time) distribution of a single open que...
Port of @@SolverMAM/getProb.m and @@SolverMAM/getProbMarg.m: the joint (level, phase) and marginal qu...
Transient analysis of a single-class open queue by the Laplace-domain transient QBD plus numerical in...
The SolverMVA class surface: @@SolverMVA/runAnalyzer.m and the gates around it.
The <kind> part of a LINE:<category>:<kind> identifier (see _kb/17-error-vocabulary....
Definition error.h:37
Which laws the model carries, and why it was refused when it was.
How the caller may override the automatic decision.
bool slotted
options.config.slotted: true asks for the discrete time scale.
std::string timescale
"auto", "discrete" or "continuous".
double slotlength
Slot length in model time units: the lattice unit, never a rescale of a law.
options.config.nonmkv and friends.
std::size_t order
nonmkvorder, the phase budget
PhFit phfit
which surrogate family
bool preserve_det
Leave Det alone for the exact MAP/D/c branch, options.config.preserveDet.
static constexpr double FineTol
Definition lang_types.h:823
std::string why
the reference's errorMsg, empty when ok
The options SolverMAM reads.
Definition mam_types.h:30
What the MAM dispatch returns: the metrics plus the algorithm that ran.
Definition mam_types.h:211
std::string actualmethod
The concrete algorithm, as the reference's actualmethod.
Definition mam_types.h:214
mva::MvaSolution< T > sol
Definition mam_types.h:212
The joint (level, phase) table getProb returns: rows levels, cols phases.
One class's response-time CDF, the reference's RD{station, class} = [F, X].
What getTranAvg returns: queue length, utilization and throughput curves.
The metrics getAvg returns, after filtering.
Matrix< T > TN
throughput
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
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
Class-level results, the [Q,U,R,T,C,X] of the MATLAB analyzers.
Definition mva_types.h:97
std::vector< T > X
Definition mva_types.h:99
std::vector< T > C
Definition mva_types.h:99
Everything qsys_bmapm1 returns, mirroring the MATLAB result struct.
Definition qsys_bmapm1.h:62