5#ifndef LINE_SOLVERS_MVA_SOLVER_RQT_H
6#define LINE_SOLVERS_MVA_SOLVER_RQT_H
62 "solver_rqt: robust queueing theory needs transcendental arithmetic (real exponents); "
63 "rerun with --arith double or --arith real");
76 for (std::size_t r = 0; r < L.
nclasses; ++r)
77 if (std::isfinite(L.
classes[r].population))
78 throw UnsupportedError(
"solver_rqt: RQT supports open networks only (no closed classes)");
81 "solver_rqt: the reference indexes the stateful-indexed sn.rt with station indices, "
82 "which is only correct when every stateful node is a station");
95 std::string regime =
opt.rqt_regime.empty() ? std::string(
"independent") :
opt.rqt_regime;
96 const bool useExact =
opt.rqt_exact;
102 std::vector<bool> isSource(M,
false), schedInf(M,
false);
103 for (std::size_t i = 0; i < M; ++i) {
104 isSource[i] = (L.
stations[i].nodetype == qn::NodeType::Source);
105 schedInf[i] = (L.
stations[i].sched == qn::SchedStrategy::INF);
106 if (isSource[i] && src == M) src = i;
109 throw UnsupportedError(
"solver_rqt: RQT requires an open network with a Source station");
110 std::vector<std::size_t> qstat;
111 for (std::size_t i = 0; i < M; ++i)
112 if (!isSource[i]) qstat.push_back(i);
113 const std::size_t nq = qstat.size();
115 auto rtS = [&](std::size_t i, std::size_t j) -> T {
return L.
rt(i, j); };
120 const T sigma_a_src = qsys::detail::num_sqrt(
mam::map_scv(arvMAP)) / lambda_src;
123 std::vector<T> mu(nq, zero), sigma_s(nq, zero), lambda0(nq, zero), Gamma0(nq, zero);
124 std::vector<T> alpha0(nq, alpha_a_src), alpha_s(nq, alpha_s_cfg);
125 std::vector<std::size_t> nserv(nq, 1);
127 for (std::size_t a = 0; a < nq; ++a) {
128 const std::size_t ia = qstat[a];
129 mu[a] = L.
rates(ia, 0);
130 sigma_s[a] = qsys::detail::num_sqrt(L.
scv(ia, 0)) / mu[a];
132 if (std::isfinite(ns) && ns > 0) nserv[a] =
static_cast<std::size_t
>(ns);
134 const T q = rtS(src, ia);
135 lambda0[a] = T(lambda_src * q);
137 Gamma0[a] = sigma_a_src * qsys::detail::num_pow(T(one / q), T(one / alpha_a_src));
138 for (std::size_t b = 0; b < nq; ++b) F(a, b) = rtS(ia, qstat[b]);
145 for (std::size_t a = 0; a < nq; ++a) {
146 const std::size_t ia = qstat[a];
147 const T lam = eff.
lambda[a];
149 if (lam <= zero)
continue;
151 s.
U(ia, 0) = T(lam / mu[a]);
152 s.
Q(ia, 0) = T(lam / mu[a]);
153 s.
R(ia, 0) = T(one / mu[a]);
157 const T rho = lam / (kk * mu[a]);
159 eff.
alpha[a], regime);
162 const T Ra = useExact ? w.
Sworst : w.
W;
165 s.
Q(ia, 0) = T(lam * Ra);
168 s.
Tp(src, 0) = lambda_src;
170 for (std::size_t i = 0; i < M; ++i) csum = T(csum + s.
R(i, 0));
UnsupportedError(const std::string &what)
A network plus its refreshed NetworkStruct.
std::size_t nof_stateful() const
std::vector< std::vector< Distrib< T > > > service
service[i][r], 0-based station and class; a disabled entry marks a pair never visited.
Matrix< T > rt
sn.rt and sn.rtnodes: the class-expanded routing.
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 ...
What refreshProcessRepresentations and refreshLST compute FROM a distribution: the (D0,...
The exception types the port throws.
Markovian arrival process descriptors: stationary vectors, rate, moments, autocorrelation and the ind...
Dense matrix and non-owning view.
The option and result types every MVA analyzer shares.
mam::Map< T > dist_to_map(const Distrib< T > &d)
T map_scv(const Map< T > &m)
Squared coefficient of variation.
T map_lambda(const Map< T > &m)
Stationary arrival rate, lambda = pi D1 e.
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 ...
MvaSolution< T > solver_rqt(const qn::NetworkStruct< T > &L, const MvaOptions &opt)
TrafficRqt< T > npfqn_traffic_rqt(const std::vector< T > &lambda0, const std::vector< T > &Gamma0, const std::vector< T > &alpha0, const Matrix< T > &F)
Effective arrival processes of a network under the Robust Queueing calculus.
GigkRqtResult< T > qsys_gigk_rqt(const T &lambda, const T &mu, const T &Gamma_a, const T &Gamma_s, std::size_t k, const T &alpha_a, const T &alpha_s)
Robust Queueing Theory (RQT) worst-case system time of a G/G/k FCFS queue.
T qsys_gigk_rqt_gamma(const T &rho, const T &mu, const T &Gamma_a, const T &sigma_s, std::size_t k, const T &alpha_a, const std::string ®ime="independent")
Service variability parameter of the Robust Queueing Theory (RQT) framework.
A queueing network and its refreshed NetworkStruct.
Effective arrival processes of a network under the Robust Queueing calculus.
Robust Queueing Theory (RQT) worst-case system time of a G/G/k FCFS queue.
Service variability parameter of the Robust Queueing Theory (RQT) framework.
A MAP as the pair of matrices (D0, D1).
The options SolverMVA reads.
Class-level results, the [Q,U,R,T,C,X] of the MATLAB analyzers.
std::vector< T > Gamma
effective variability parameter at each node
std::vector< T > lambda
effective arrival rate at each node
std::vector< T > alpha
effective tail coefficient at each node
T W
closed-form bound on the system time (Theorem 3 / Theorem 8)
T Sworst
exact worst-case system time over the uncertainty sets