56 "solver_mva_retrieval_analyzer: the delayed-hit retrieval fixed point needs "
57 "transcendental arithmetic; rerun with --arith double or --arith real");
62 const std::size_t n = in.lambda.size(), S = in.queue_nodes.size();
63 const std::size_t jobin = in.read_class;
82 for (std::size_t i = 0; i < n; ++i) lamsum = T(lamsum + in.lambda[i]);
83 std::vector<T> w(n, zero);
84 for (std::size_t i = 0; i < n; ++i) w[i] = lamsum > zero ? T(in.lambda[i] / lamsum) : zero;
85 T hitAgg = zero, missAgg = zero, delayedAgg = zero;
86 for (std::size_t i = 0; i < n; ++i) {
88 for (std::size_t l = 0; l < fp.
phit.rows(); ++l) pih = T(pih + fp.
phit(l, i));
89 missAgg = T(missAgg + w[i] * fp.
pmiss[i]);
90 hitAgg = T(hitAgg + w[i] * pih);
91 delayedAgg = T(delayedAgg + w[i] * lat.
phi[i]);
99 cache_out->hitprob.assign(K, nan);
100 cache_out->missprob.assign(K, nan);
101 cache_out->delayedprob.assign(K, nan);
102 cache_out->latency.assign(K, nan);
103 if (jobin >= 1 && jobin <= K) {
104 cache_out->hitprob[jobin - 1] = hitAgg;
105 cache_out->missprob[jobin - 1] = missAgg;
106 cache_out->delayedprob[jobin - 1] = delayedAgg;
107 cache_out->latency[jobin - 1] = lat.
Z;
111 const std::size_t h = fp.
phit.rows();
112 cache_out->hitproblist =
Matrix<T>(K, h, nan);
113 if (jobin >= 1 && jobin <= K)
114 for (std::size_t l = 0; l < h; ++l) {
116 for (std::size_t i = 0; i < n; ++i) acc = T(acc + fp.
phit(l, i) * w[i]);
117 cache_out->hitproblist(jobin - 1, l) = acc;
120 cache_out->itemprob =
Matrix<T>(n, h + 1, zero);
121 for (std::size_t i = 0; i < n; ++i) {
122 cache_out->itemprob(i, 0) = fp.
pmiss[i];
123 for (std::size_t l = 0; l < h; ++l) cache_out->itemprob(i, l + 1) = fp.
phit(l, i);
130 L.
disabled[src_st - 1][jobin - 1] ? zero : L.
rates(src_st - 1, jobin - 1);
131 s.
Tp(src_st - 1, jobin - 1) = sourceRate;
134 if (L.
nodes[kv.first - 1].nodetype == qn::NodeType::Cache)
return kv.second;
135 throw InputError(
"solver_mva_retrieval_analyzer: no cache");
137 const std::size_t hc = (jobin - 1) < ch.
hitclass.size() ? ch.
hitclass[jobin - 1] : 0;
139 if (hc > 0) s.
X[hc - 1] = T(sourceRate * (hitAgg + delayedAgg));
140 if (
mc > 0) s.
X[
mc - 1] = T(sourceRate * missAgg);
143 std::vector<std::size_t> psIdx;
144 for (std::size_t si = 0; si < S; ++si)
146 for (std::size_t si = 0; si < S; ++si) {
147 const std::size_t st = L.
nodes[in.queue_nodes[si] - 1].station;
148 std::size_t prow = 0;
150 for (std::size_t p = 0; p < psIdx.size(); ++p)
151 if (psIdx[p] == si) prow = 1 + p;
154 if (prow < fp.
pdh.rows())
155 for (std::size_t i = 0; i < n; ++i) phi_s = T(phi_s + fp.
pdh(prow, i));
157 T tput_s = zero, arvr_s = zero;
158 for (std::size_t i = 0; i < n; ++i) {
160 std::vector<T> a(S, zero);
161 for (std::size_t x = 0; x < S; ++x) {
162 a[x] = in.R[i](0, x + 1);
163 for (std::size_t y = 0; y < S; ++y)
165 in.R[i](x + 1, y + 1));
169 for (std::size_t y = 0; y < S; ++y) vis = T(vis + a[y] * F(y, si));
170 tput_s = T(tput_s + sourceRate * w[i] * fp.
pmiss[i] * vis);
173 for (std::size_t x = 0; x < S; ++x) {
175 for (std::size_t y = 0; y < S; ++y) vx = T(vx + a[y] * F(y, x));
176 inflow = T(inflow + vx * in.R[i](x + 1, si + 1));
178 arvr_s = T(arvr_s + sourceRate * w[i] * fp.
pmiss[i] * inflow);
180 s.
AN(st - 1, jobin - 1) = arvr_s;
181 s.
Q(st - 1, jobin - 1) = phi_s;
182 s.
U(st - 1, jobin - 1) = phi_s;
183 s.
Tp(st - 1, jobin - 1) = tput_s;
184 if (tput_s > zero) s.
R(st - 1, jobin - 1) = T(phi_s / tput_s);