5#ifndef LINE_SOLVERS_SOLVER_NODE_TABLES_H
6#define LINE_SOLVERS_SOLVER_NODE_TABLES_H
68 const std::vector<double>& CN,
69 const std::vector<double>& XN,
70 const std::string& method) {
71 const std::size_t M =
sn.nstations, R =
sn.nclasses;
80 std::vector<std::vector<bool>> srcmask(M, std::vector<bool>(R,
false));
81 for (std::size_t i = 0; i < M; ++i) {
83 for (std::size_t c = 0; c < R; ++c) srcmask[i][c] =
true;
84 for (std::size_t c = 0; c < R; ++c) {
102 for (std::size_t c = 0; c < CN.size(); ++c)
104 for (std::size_t c = 0; c < XN.size(); ++c)
127 const std::size_t I =
sn.nodes.size(), R =
sn.nclasses;
134 for (std::size_t ist = 0; ist <
sn.nstations; ++ist) {
135 const std::size_t ind =
sn.station_to_node[ist];
137 for (std::size_t c = 0; c < R; ++c) {
138 m.
QN(ind - 1, c) = r.
QN(ist, c);
139 m.
UN(ind - 1, c) = r.
UN(ist, c);
140 m.
RN(ind - 1, c) = r.
RN(ist, c);
141 m.
WN(ind - 1, c) = r.
WN(ist, c);
165 std::map<std::size_t, line::api::CacheActualProb<T>> cacheprob;
166 for (std::size_t ci = 0; ci < r.
cache.caches.size(); ++ci) {
173 cacheprob[cm.
node] = p;
184 for (std::size_t cind = 1; cind <= I; ++cind) {
185 if (refsn.
nodes[cind - 1].nodetype != line::qn::NodeType::Cache)
continue;
186 typename std::map<std::size_t, line::qn::CacheParam<T>>::const_iterator np =
188 if (np == refsn.
nodeparam.end())
continue;
189 for (std::size_t ind = 1; ind <= I; ++ind) {
191 if (nt != line::qn::NodeType::ClassSwitch && nt != line::qn::NodeType::Sink)
continue;
192 for (std::size_t rr = 1; rr <= R; ++rr)
193 if (line::api::detail::sn_is_cache_class(np->second.hitclass,
194 np->second.missclass, rr))
195 m.
AN(ind - 1, rr - 1) = m.
TN(cind - 1, rr - 1);
What a solver observed about the Cache nodes of a model.
A network plus its refreshed NetworkStruct.
std::map< std::size_t, CacheParam< T > > nodeparam
Cache parameters by 1-based NODE index; only Cache nodes have an entry.
std::vector< NodeDef > nodes
every node, in creation order
Dense matrix and non-owning view.
Matrix< T > sn_get_node_tput_from_tput(const qn::NetworkStruct< T > &sn, const Matrix< T > &TN, const Matrix< T > &ANn, const std::map< std::size_t, CacheActualProb< T > > &cache_prob=std::map< std::size_t, CacheActualProb< T > >())
Port of sn_get_node_tput_from_tput.
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.
NodeType
Node kinds, with the values of MATLAB NodeType.
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.
Matrix< T > sn_get_arvr_from_tput(const qn::NetworkStruct< T > &L, const Matrix< T > &TN)
line::mva::AvgResult< T > avg_result_from_sim(const line::qn::NetworkStruct< T > &sn, const line::Matrix< double > &QN, const line::Matrix< double > &UN, const line::Matrix< double > &RN, const line::Matrix< double > &TN, const std::vector< double > &CN, const std::vector< double > &XN, const std::string &method)
The station AvgResult of a solver whose runner returns its own solution type, i.e.
NodeMetrics< T > node_metrics(const line::qn::NetworkStruct< T > &sn, const line::mva::AvgResult< T > &r)
A queueing network and its refreshed NetworkStruct.
Number-type abstraction for the templated API port.
Ports of matlab/src/api/sn/sn_get_node_arvr_from_tput.m and sn_get_node_tput_from_tput....
The SolverMVA class surface: @@SolverMVA/runAnalyzer.m and the gates around it.
The converged cache split, per ORIGINAL class of one Cache node.
std::vector< T > delayed_hit
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...
Matrix< T > RN
response time, per visit
Matrix< T > UN
utilization
Matrix< T > WN
residence time, per job
std::string method
the method asked for
std::string actualmethod
the algorithm that ran
Matrix< T > QN
queue length
std::vector< T > CN
system response time per class
std::vector< T > XN
system throughput per class
solvers::CacheMetrics< T > cache
What the cache branches observed, EMPTY on a model with no Cache node and on every solver that does n...
Matrix< T > AN
arrival rate
One Cache node's measured behaviour.
std::vector< T > hitprob
(K) TRUE hit fraction, EMPTY = not computed
std::vector< T > delayedprob
(K) delayed-hit fraction, EMPTY off a retrieval system
std::size_t node
1-based node index of the Cache
std::vector< T > missprob
(K)
The station table scattered to the NODE index space, plus the two flow columns the reference recomput...
line::Matrix< T > TN
(nnodes x nclasses)