LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
env_dispatch.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_ENV_ENV_DISPATCH_H
6#define LINE_SOLVERS_ENV_ENV_DISPATCH_H
7
8/**
9 * @file
10 * @ingroup line_solvers
11 * The SolverENV entry surface: a port of the analyzer selection that
12 * `@@SolverENV/SolverENV.m`'s `init` performs (lines 311-327) and of the
13 * compression switch `setCompression` arms (line 160, applied at line 412).
14 *
15 * WHAT SELECTS WHAT. The reference holds ONE solver object and swaps the
16 * function handle it delegates `pre`/`analyze`/`post`/`finish` to:
17 * `method` == statevec installs `solver_env_statevec_analyzer`, and every other
18 * method installs `solver_env_meanfield_analyzer` -- `blend` among them since
19 * 2026-09-13, when that name was repointed from the state-vector coupling to
20 * the mean-field one. This port has two solver CLASSES instead of one object
21 * with two handles, because the two couplings carry different objects across
22 * an environment switch -- the mean-field one carries the marginal mean queue
23 * lengths, the state-vector one the whole joint distribution -- and so they
24 * need different options, different stage solvers and different result types.
25 * This file is the switch that stands in front of them, and it is the only
26 * place that knows both exist.
27 *
28 * WHY `SolverEnv` STILL REFUSES `statevec` BY NAME. It is the mean-field
29 * coupling and nothing else; asked for the state-vector one it cannot answer,
30 * and answering with the mean-field collapse would be the silent fallback the
31 * whole port avoids. The refusal is therefore kept where it is and this entry
32 * routes AROUND it rather than through it.
33 *
34 * THE THIRD THING THIS SWITCH SELECTS is neither coupling: `avg` and `dec`, the
35 * closed-form fast/slow limits of `solveEnvLimit`, which bypass the fixed point
36 * entirely and are ported as `SolverEnvLimit`. The reference routes them the
37 * same way, at the TOP of `runAnalyzer` and before `iterate`, because there is
38 * no inter-stage coupling to choose when nothing crosses a switch.
39 *
40 * WHICH COUPLINGS TAKE A LAYERED STAGE. The mean-field one and the
41 * `occupation` limit (each layered stage solved by SolverLN and read over its
42 * LQN elements), and that is the reference's split rather than this port's:
43 * a `statevec` run needs
44 * one generator per stage to propagate a joint law across, which an LQN does not
45 * have (it decomposes into a network per layer), and the `avg`/`dec` limits read
46 * a stage's station rate table, which an LQN does not carry. Both refuse a
47 * LayeredNetwork stage by name, in their own `init`, through
48 * `Environment::reject_lqn_stages`; so does the compression, whose macro-state
49 * is a network at averaged rates. The cache aggregation of the two analyzers is
50 * no longer refused: the mean-field one is `aggregate_cache_meanfield`
51 * (solver_env_meanfield.h) and the state-vector one is the `aggregateCacheBlend_`
52 * port in solver_env_statevec.h.
53 *
54 * WHAT COMPRESSION IS, AND WHY IT IS A SEPARATE OVERLOAD. `setCompression` is
55 * an explicit opt-in flag in the reference, defaulting to false, and the knobs
56 * it reads live in `options.config` rather than beside `method`. Passing the
57 * `EnvCompressOptions` is that opt-in here: there is no way to ask for the
58 * compressed solve without saying which decomposition kernel and which
59 * partition search it should use. The reference applies compression inside
60 * `init`, i.e. BEFORE the analyzer runs and independently of which analyzer was
61 * installed, so both couplings can run on a compressed environment and both do
62 * here.
63 */
64
65#include <algorithm>
66#include <cstddef>
67#include <string>
68#include <vector>
69
71#include "line/num/number.h"
76#include "line/util/matrix.h"
78
79namespace line {
80namespace env {
81
82/**
83 * What the ENV entry reports: the environment-blended metrics, and the whole
84 * result of whichever coupling produced them.
85 *
86 * The sub-result is kept rather than reduced away because the two couplings
87 * report different things beside the means -- the mean-field one the per-stage
88 * exit metrics and the entry queue lengths its fixed point converged to, the
89 * state-vector one the entry and sojourn-end DISTRIBUTIONS and the cache blend
90 * -- and a caller who chose a coupling chose it for those.
91 */
92template <class T>
94 /** Environment-averaged metrics, (nstations x nclasses). */
96 /** What ran: `meanfield`, `statevec`, or the limit `avg` / `dec`. */
97 std::string method;
98 /** True when the environment was aggregated before the coupling ran. */
99 bool compressed = false;
100 /** The aggregation, when there was one; its `eps` against `epsMAX` says whether it was meaningful. */
102 /** Populated on the mean-field path. */
104 /** Populated on the state-vector path. */
106 /**
107 * Populated on the closed-form limit path (`avg`, `dec`, `occupation`);
108 * `limit.occupation` / `limit.occupation_weight` are `getStageOccupation`.
109 */
111 /**
112 * The environment-blended cache surface, whichever coupling produced it.
113 *
114 * A Cache does not report in (station, class) and so cannot ride in QN/UN/
115 * TN; all three couplings now report it in `CacheMetrics`' one shape, keyed
116 * by the Cache's NAME. EMPTY on a model with no cache, and within an entry
117 * every field is optional: ABSENT MEANS NOT COMPUTED, never zero.
118 */
120 /**
121 * ZERO ON THE LIMIT PATH, and that is the answer rather than a gap: a limit
122 * reads the environment once and iterates nothing, so reporting an
123 * iteration count would describe a fixed point that never ran.
124 */
125 int iterations = 0;
126 /**
127 * True on the limit path: a closed form has converged by construction. The
128 * flag says whether the numbers can be trusted as the method's own answer,
129 * not whether a loop ended, and a limit's answer is always its own.
130 */
131 bool converged = false;
132};
133
134namespace dispatch_detail {
135
136/** The mean-field metrics, which are double by construction, in the caller's arithmetic. */
137template <class T>
138Matrix<T> env_widen(const Matrix<double>& A) {
140 for (std::size_t i = 0; i < A.rows(); ++i)
141 for (std::size_t j = 0; j < A.cols(); ++j) B(i, j) = num_traits<T>::from_double(A(i, j));
142 return B;
143}
144
145/**
146 * The limit path's cache surface, which is double by construction, in the
147 * caller's arithmetic.
148 *
149 * `EnvLimitSolution` is deliberately not templated -- `SolverEnvLimit::init`
150 * refuses `T != double` -- so the widening happens here rather than by
151 * templating a struct that can only ever hold one arithmetic.
152 */
153template <class T>
156 for (std::size_t i = 0; i < c.caches.size(); ++i) {
159 w.node = m.node;
160 w.name = m.name;
161 w.itemcap = m.itemcap;
162 w.itemsize = m.itemsize;
163 w.nitems = m.nitems;
164 for (std::size_t k = 0; k < m.hitprob.size(); ++k)
165 w.hitprob.push_back(num_traits<T>::from_double(m.hitprob[k]));
166 for (std::size_t k = 0; k < m.missprob.size(); ++k)
168 for (std::size_t k = 0; k < m.delayedprob.size(); ++k)
170 for (std::size_t k = 0; k < m.latency.size(); ++k)
171 w.latency.push_back(num_traits<T>::from_double(m.latency[k]));
172 for (std::size_t k = 0; k < m.listcost.size(); ++k)
174 w.hitproblist = env_widen<T>(m.hitproblist);
175 w.itemprob = env_widen<T>(m.itemprob);
176 out.caches.push_back(w);
177 }
178 return out;
179}
180
181/**
182 * `EnvOptions` as the state-vector coupling reads it.
183 *
184 * `stage_solver` is carried through UNTRANSLATED, so a caller who left it at
185 * the mean-field default of `fluid` is refused by name inside
186 * `SolverEnvStatevec::init` -- which is the reference's own error, "this method
187 * requires SolverENV to be instantiated with the CTMC solver"
188 * (`@@SolverENV/SolverENV.m` line 763). Silently substituting `ctmc` would run a
189 * different inner solver from the one asked for.
190 *
191 * The per-transition state reset maps (functions on a state vector, which have
192 * no counterpart among the mean-field resets, as `ResetStateVec` explains) are
193 * not options: they belong to the Environment, as `resetStateFun` does in the
194 * reference, and `Environment::set_state_reset` installs one on an arc, where
195 * the coupling reads it. `EnvStatevecOptions::reset_state` remains as a
196 * per-call override for a caller of `solver_env_statevec`. No horizon is
197 * carried: the general sojourn is solved in closed form and reads none.
198 */
199template <class T>
200EnvStatevecOptions<T> env_statevec_options(const EnvOptions& o) {
201 EnvStatevecOptions<T> s;
202 s.iter_max = o.iter_max;
203 s.iter_tol = o.iter_tol;
204 s.stage_solver = o.stage_solver;
205 s.sojourn = o.sojourn;
206 // `stage_cutoff` bounds an OPEN stage's level count under either backend:
207 // it truncates the enumerated chain for the CTMC one and the LD-QBD level
208 // recursion for the MAM one. A closed stage takes its population instead
209 // and ignores it in both.
210 if (o.stage_cutoff > 0) s.mam_cutoff = static_cast<std::size_t>(o.stage_cutoff);
211 return s;
212}
213
214/** Read the state-vector result into the common shape. */
215template <class T>
216void env_take_statevec(EnvAnalyzerSolution<T>& out) {
217 out.method = "statevec";
218 out.QN = out.statevec.QN;
219 out.UN = out.statevec.UN;
220 out.TN = out.statevec.TN;
221 out.iterations = out.statevec.iterations;
222 out.converged = out.statevec.converged;
223 out.cache = out.statevec.cache;
224}
225
226/**
227 * Read the mean-field result into the common shape.
228 *
229 * `asked` is reported rather than the bare analyzer name, because `smp` and
230 * `statedep` also run this analyzer and are not the same run: `statedep`
231 * rewrote the environment as it went, and a result labelled `meanfield` would
232 * describe an environment that was an input when it was an output.
233 */
234template <class T>
235void env_take_meanfield(EnvAnalyzerSolution<T>& out, const std::string& asked = "meanfield") {
236 out.method = asked.empty() ? "meanfield" : asked;
237 out.QN = env_widen<T>(out.meanfield.avg.QN);
238 out.UN = env_widen<T>(out.meanfield.avg.UN);
239 out.TN = env_widen<T>(out.meanfield.avg.TN);
240 out.iterations = out.meanfield.avg.iterations;
241 out.converged = out.meanfield.avg.converged;
242 out.cache = out.meanfield.cache;
243}
244
245/** Read a closed-form limit result into the common shape. */
246template <class T>
247void env_take_limit(EnvAnalyzerSolution<T>& out) {
248 out.method = out.limit.method;
249 out.QN = env_widen<T>(out.limit.QN);
250 out.UN = env_widen<T>(out.limit.UN);
251 out.TN = env_widen<T>(out.limit.TN);
252 out.iterations = 0;
253 out.converged = true;
254 out.cache = env_widen_cache<T>(out.limit.cache);
255}
256
257/** True for the one name the reference's `init` installs the state-vector analyzer on. */
258inline bool env_is_statevec(const std::string& m) { return m == "statevec"; }
259
260/**
261 * True when a mean-field spelling (`default`, `blend`, `blending`) RESOLVES to
262 * the state-vector coupling, as `SolverENV.defaultResolvesToStatevec_` rules in
263 * the reference since 2026-11-15.
264 *
265 * The mean-field coupling rounds each entry marginal to an integer state and so
266 * loses mass at every switch (on renv_threestages the two stations' throughputs
267 * part to 1.310 against 1.475, where the exact answer balances at 1.443). When
268 * every stage is a flat network on the enumerated CTMC, none is semi-Markov or
269 * absorbing, and every queue-length reset is the identity (empty here), the
270 * exact joint coupling is available at the same cost and is what `default`
271 * means. Anything else keeps the mean-field coupling: a fluid, MVA or NC stage,
272 * a layered stage, a state-dependent arc (`reset_rates`), or any reset.
273 * `meanfield`/`mean` stay the mean-field coupling by name.
274 */
275template <class T>
276bool env_default_resolves_to_statevec(const Environment<T>& e, const EnvOptions& o) {
277 if (o.method != "default" && o.method != "blend" && o.method != "blending") return false;
278 if (o.stage_solver != "ctmc") return false;
279 const std::size_t E = e.nstages();
280 for (std::size_t s = 0; s < E; ++s) {
281 if (e.is_lqn(s) || !e.stage(s).has_model) return false;
282 if (e.is_semi_markov_stage(s) || e.is_absorbing_stage(s)) return false;
283 for (std::size_t h = 0; h < E; ++h) {
284 const EnvArc<T>& a = e.arc(s, h);
285 if (!a.enabled) continue;
286 if (a.reset || a.reset_rates) return false;
287 }
288 }
289 return true;
290}
291
292/**
293 * True for the names `runAnalyzer` sends to `solveEnvLimit`, plus `occupation`
294 * (`solveEnvOccupation`), which `SolverEnvLimit` serves as the weighted `dec`.
295 */
296inline bool env_is_limit(const std::string& m) {
297 return m == "avg" || m == "dec" || m == "occupation";
298}
299
300} // namespace dispatch_detail
301
302/**
303 * Port of `SolverENV.listValidMethods`.
304 *
305 * Every name here selects a COUPLING -- what crosses an environment switch --
306 * and each is dispatched by this file or by `SolverEnv`'s own ladder:
307 * `default`/`meanfield`/`mean`/`blend` carry the marginal means, `meancov` the
308 * same coupling carrying a COVARIANCE beside the mean (the exit second moment
309 * over the sojourn law, mixed over the origins of a switch by the law of total
310 * variance, handed to the next stage as `FluidOptions::init_qlen`/`init_qcov`),
311 * `statevec` the whole joint distribution, `smp` the marginal means over the
312 * semi-Markov stage probabilities of the embedded jump chain, `statedep` makes the transition depend on the
313 * state it leaves, and `avg`/`dec` are the closed-form fast/slow limits of
314 * `solveEnvLimit`.
315 *
316 * `default` is the reference's spelling and `meanfield` this port's; both name
317 * the mean-field coupling and `SolverEnv::init` accepts either, as it does
318 * `blend`.
319 *
320 * `blend` NAMES THE MEAN-FIELD COUPLING SINCE 2026-09-13 and named the
321 * state-vector one before that. It is kept as a spelling of `default` so an
322 * existing script still runs, but it no longer reaches `SolverEnvStatevec` and
323 * the numbers it returns move: ask for `statevec` by name to carry the joint
324 * distribution.
325 *
326 * SINCE 2026-11-15 `default`, `blend` and `blending` RESOLVE TO `statevec` when
327 * `dispatch_detail::env_default_resolves_to_statevec` holds (all stages flat on
328 * the CTMC, none semi-Markov or absorbing, no reset, no state-dependent arc);
329 * the result's `method` then reads `statevec`. `meanfield` and `mean` never do. The word survives inside the analyzers as the
330 * environment-averaged BLEND they both compute, which is what it described.
331 */
332inline std::vector<std::string> env_list_valid_methods() {
333 // the names and their order are this solver's row of the method registry (doc/line-methods.json)
334 return ::line::method_registry::methods("ENV");
335}
336
337/** Port of `runAnalyzerChecks`' method gate: an unlisted method is refused. */
338inline void env_check_method(const std::string& method) {
339 const std::vector<std::string> valid = env_list_valid_methods();
340 if (std::find(valid.begin(), valid.end(), method) != valid.end()) return;
341 throw UnsupportedError(ErrorKind{"Method"}, "SolverENV: the '" + method + "' method is unsupported by this solver");
342}
343
344/**
345 * `SolverENV.init`'s analyzer selection: solve the environment with the
346 * coupling `o.method` names.
347 *
348 * An unknown method is refused by `SolverEnv`'s ladder, which is reached
349 * because everything that is not the state-vector coupling IS the mean-field
350 * one in the reference -- the `else` of its `if`, not a separate case.
351 */
352template <class T>
355 if (dispatch_detail::env_is_limit(o.method)) {
356 out.limit = solver_env_limit(e, o);
357 dispatch_detail::env_take_limit(out);
358 return out;
359 }
360 if (dispatch_detail::env_is_statevec(o.method)
361 || dispatch_detail::env_default_resolves_to_statevec(e, o)) {
362 out.statevec = solver_env_statevec(e, dispatch_detail::env_statevec_options<T>(o));
363 dispatch_detail::env_take_statevec(out);
364 return out;
365 }
367 dispatch_detail::env_take_meanfield(out, o.method);
368 return out;
369}
370
371/**
372 * The same, with the stage solver supplied by the caller.
373 *
374 * WHAT THIS IS FOR. The reference's `SolverENV(renv, @(m) SolverX(m, opts))`
375 * takes a FACTORY and runs every stage with whatever it returns, and
376 * `mapEnvApprox` hands it `feval(class(self), ...)` so that the environment
377 * image is solved by the solver the user called. Without an injected callable
378 * this port could only ever run fluid stages, and "the stage solver is the
379 * calling solver" would simply be untrue here.
380 *
381 * WHY ONLY THE LIMITS TAKE IT, and why the other two refuse by name rather than
382 * ignoring it. The two couplings carry an object across an environment switch
383 * that only their own backend can produce -- the mean-field one the RMF cache
384 * transient and the marginal means `initFromMarginal` reads, the state-vector
385 * one a per-stage generator and the joint law over it -- so an arbitrary
386 * `getAvg` callable cannot drive either. Accepting the function and quietly
387 * solving with the built-in backend would answer a different question from the
388 * one asked, which is the silent substitution this port refuses everywhere.
389 *
390 * The limits have no such object: `solveEnvLimit` asks each stage for its
391 * steady state and blends, so any solver that can answer `getAvg` will do.
392 */
393template <class T>
395 EnvStageAvgFn<T> stage_fn) {
396 if (!stage_fn) return solver_env(e, o);
397 if (!dispatch_detail::env_is_limit(o.method))
398 throw UnsupportedError(ErrorKind{"Option"},
399 "SolverENV: the '" + o.method +
400 "' coupling cannot run an injected stage solver; it carries a per-stage object across "
401 "an environment switch that only its own backend produces (the mean-field coupling "
402 "the RMF transient and the marginal means, the state-vector one a generator and the "
403 "joint law over it). The closed-form limits 'avg' and 'dec' take one");
405 SolverEnvLimit<T> s(e, o, stage_fn);
406 out.limit = s.solve();
407 dispatch_detail::env_take_limit(out);
408 return out;
409}
410
411/**
412 * The same, on a COMPRESSED environment: aggregate the stages first, then run
413 * the coupling over the macro-states.
414 *
415 * The mean-field path delegates to `solver_env_meanfield`, which already owns
416 * the construct-then-apply-then-solve order that `env_apply_macro_probabilities`
417 * requires. The state-vector path repeats that order here rather than reaching
418 * for a wrapper of its own: `SolverEnvStatevec`'s constructor calls
419 * `Environment::init()`, which recomputes probEnv and probOrig from the macro
420 * arcs, so the macro probabilities have to be written back AFTER it and BEFORE
421 * `solve()`, exactly as on the mean-field side.
422 */
423template <class T>
425 const EnvCompressOptions& c) {
427 out.compressed = true;
428 // A limit reads probEnv and the stage models, both of which the aggregation
429 // rewrites, so it runs on the macro-states like the couplings do; the macro
430 // probabilities must still be written back after `SolverEnvLimit`'s own
431 // `Environment::init()` and before it reads them, which is why the construct
432 // and the solve are separated here.
433 if (dispatch_detail::env_is_limit(o.method)) {
434 out.compression = env_compress(e, c);
435 SolverEnvLimit<T> s(*out.compression.env, o);
437 out.limit = s.solve();
438 dispatch_detail::env_take_limit(out);
439 return out;
440 }
441 if (dispatch_detail::env_is_statevec(o.method)) {
442 out.compression = env_compress(e, c);
443 SolverEnvStatevec<T> s(*out.compression.env, dispatch_detail::env_statevec_options<T>(o));
445 out.statevec = s.solve();
446 dispatch_detail::env_take_statevec(out);
447 return out;
448 }
449 out.meanfield = solver_env_meanfield(e, o, c);
450 out.compression = out.meanfield.compression;
451 dispatch_detail::env_take_meanfield(out, o.method);
452 return out;
453}
454
455} // namespace env
456} // namespace line
457
458#endif // LINE_SOLVERS_ENV_ENV_DISPATCH_H
std::size_t cols() const
Definition matrix.h:90
std::size_t rows() const
Definition matrix.h:89
UnsupportedError(const std::string &what)
Definition error.h:119
The state-vector environment solver.
EnvStatevecSolution< T > solve()
A random environment: a port of matlab/src/lang/Environment.m, restricted to what SolverENV reads out...
Dense matrix and non-owning view.
The method names of each solver, in listing order.
EnvStatevecSolution< T > solver_env_statevec(Environment< T > &e, const EnvStatevecOptions< T > &o)
Solve in one call, for a caller with no use for the solver object.
EnvLimitSolution solver_env_limit(Environment< T > &e, const EnvOptions &o)
solveEnvLimit on the original stages.
std::function< EnvStageAvg< T >(const qn::NetworkStruct< T > &)> EnvStageAvgFn
The stage solver, as a callable: the C++ spelling of the MATLAB function handle SolverENV(renv,...
void env_check_method(const std::string &method)
Port of runAnalyzerChecks' method gate: an unlisted method is refused.
EnvMeanfieldSolution< T > solver_env_meanfield(Environment< T > &e, const EnvOptions &o)
The mean-field solve on the original stages, with no compression.
EnvCompression< T > env_compress(const Environment< T > &e0, const EnvCompressOptions &opt)
Port of applyCompression: pick a partition, decompose, and build the macro-state environment.
std::vector< std::string > env_list_valid_methods()
Port of SolverENV.listValidMethods.
void env_apply_macro_probabilities(Environment< T > &e, const EnvCompression< T > &c)
probEnv = pMacro and probOrig = newEmbweight, the two quantities applyCompression overwrites on the e...
EnvAnalyzerSolution< T > solver_env(Environment< T > &e, const EnvOptions &o)
SolverENV.init's analyzer selection: solve the environment with the coupling o.method names.
Conservation laws of a layered queueing network, enumerated from its structure.
Definition aoi_dist2ph.h:51
Number-type abstraction for the templated API port.
SolverENV: a queueing network in a random environment.
The two CLOSED-FORM environment limits: SolverENV.solveEnvLimit, reached by options....
SolverENV, the default mean-field path: ENVIRONMENT COMPRESSION.
SolverENV, method = "statevec": a port of matlab/src/solvers/ENV/solver_env_statevec_analyzer....
The <kind> part of a LINE:<category>:<kind> identifier (see _kb/17-error-vocabulary....
Definition error.h:37
What the ENV entry reports: the environment-blended metrics, and the whole result of whichever coupli...
EnvMeanfieldSolution< T > meanfield
Populated on the mean-field path.
std::string method
What ran: meanfield, statevec, or the limit avg / dec.
EnvLimitSolution limit
Populated on the closed-form limit path (avg, dec, occupation); limit.occupation / limit....
EnvStatevecSolution< T > statevec
Populated on the state-vector path.
bool converged
True on the limit path: a closed form has converged by construction.
Matrix< T > QN
Environment-averaged metrics, (nstations x nclasses).
EnvCompression< T > compression
The aggregation, when there was one; its eps against epsMAX says whether it was meaningful.
bool compressed
True when the environment was aggregated before the coupling ran.
solvers::CacheMetrics< T > cache
The environment-blended cache surface, whichever coupling produced it.
int iterations
ZERO ON THE LIMIT PATH, and that is the answer rather than a gap: a limit reads the environment once ...
The knobs applyCompression reads out of options.config.
Everything applyCompression computes, plus the compressed environment.
What a limit solve reports.
A mean-field solve, with the compression that produced it.
Options of SolverENV.
Definition solver_env.h:122
std::string method
The inter-stage coupling: meanfield is the reference's default.
Definition solver_env.h:145
What the state-vector coupling reports.
Every Cache node of the model, in node order; empty on a model with none.
std::vector< CacheNodeMetrics< T > > caches
One Cache node's measured behaviour.
std::vector< double > itemcap
(h) capacity of each list
std::vector< double > itemsize
(n) storage cost per item, EMPTY without setItemSizes
std::vector< T > hitprob
(K) TRUE hit fraction, EMPTY = not computed
std::vector< T > delayedprob
(K) delayed-hit fraction, EMPTY off a retrieval system
Matrix< T > hitproblist
(K x h) per-list hit fraction, EMPTY = not computed
std::size_t node
1-based node index of the Cache
std::vector< T > latency
(K) expected latency per read request (hits wait 0), EMPTY = not computed
std::vector< T > listcost
(h) mean storage cost held by each list
Matrix< T > itemprob
(n x h+1), column 0 = miss; EMPTY = not computed
std::string name
The Cache node's NAME, which is what a cross-language payload must key on.