5#ifndef LINE_SOLVERS_NC_NC_DISPATCH_H
6#define LINE_SOLVERS_NC_NC_DISPATCH_H
72 for (std::size_t i = 0; i <
sn.nstations; ++i) {
73 if (!
sn.stations[i].svc_rate_fun)
continue;
134 if (
opt.method ==
"morrison")
136 "solver_nc_analyzer: method 'morrison' requires a CLOSED network of exactly two "
137 "stations, one infinite-server (think) station and one single-server DPS station with "
138 "exponential service, which this model is not.");
148 (
opt.method ==
"default" ||
opt.method ==
"is" ||
opt.method ==
"sampling"))
152 if (detail::has_svc_rate_fun(
sn, pas))
154 "solver_nc_analyzer: a station with a service rate function (OI / PAS) has no "
155 "product-form demand and cannot be solved by the ordinary normalizing-constant path");
157 bool anyOpen =
false;
161 if (
opt.method ==
"is" && anyOpen)
163 "solver_nc_analyzer: the 'is' importance-sampling method requires a closed queueing "
164 "network. Use 'sampling' for an open or mixed model");
170 bool multiserver =
false;
173 if (multiserver && anyOpen &&
opt.method ==
"exact")
175 "solver_nc_analyzer: the NC solver cannot provide exact solutions for open or mixed "
176 "multiserver queueing networks. Remove the 'exact' option");
181 double eta_max = 0.0;
185 if (e > eta_max) eta_max = e;
189 for (std::size_t k = 0; k <
sn.nclasses; ++k) {
190 const double p =
sn.classes[k].population;
191 if (!std::isfinite(p))
continue;
192 lo.
classes[k].population = std::floor(p);
193 hi.classes[k].population = std::ceil(p);
201 for (std::size_t i = 0; i < A.
rows(); ++i)
202 for (std::size_t j = 0; j < A.
cols(); ++j)
203 A(i, j) = T(Af(i, j) + e * (Ac(i, j) - Af(i, j)));
209 for (std::size_t k = 0; k < out.
sol.X.size(); ++k) {
210 out.
sol.X[k] = T(f.
sol.X[k] + e * (c.
sol.X[k] - f.
sol.X[k]));
211 out.
sol.C[k] = T(f.
sol.C[k] + e * (c.
sol.C[k] - f.
sol.C[k]));
218 out.
sol.lG = f.
sol.lG + eta_max * (f.
sol.lG - c.
sol.lG);
235 if (std::isfinite(lg))
UnsupportedError(const std::string &what)
A network plus its refreshed NetworkStruct.
std::vector< JobClass > classes
static void step(const char *fmt,...)
Write one progress line.
The exception types the port throws.
Running progress log of a LINE solver run (the "solver console").
bool nc_is_oi_model(const qn::NetworkStruct< T > &sn)
Port of nc_is_oi_model.m: a closed network with at least one OI station and nothing but BCMP product-...
NcSolution< T > solver_nc_pas_is_analyzer(const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt)
Port of solver_nc_pas_is_analyzer.m.
NcSolution< T > solver_nc_dt(const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt)
Exact discrete-time analysis of sn.
NcSolution< T > solver_nc_dps_analyzer(const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt)
Analyzes the closed think+DPS network.
NcSolution< T > solver_ncld(const qn::NetworkStruct< T > &sn_in, const NcSolverOptions &opt)
Port of solver_ncld.m.
NcSolution< T > solver_nc_mem(const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt)
Port of solver_nc_mem.m.
NcSolution< T > solver_nc(const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt)
Port of solver_nc.m.
bool nc_is_pas_model(const qn::NetworkStruct< T > &sn)
Port of nc_is_pas_model.m: a closed two-station OI / P&S tandem.
NcSolution< T > solver_nc_oi_analyzer(const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt)
Port of solver_nc_oi_analyzer.m.
NcSolution< T > solver_nc_analyzer(const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt)
Port of solver_nc_analyzer.m.
NcSolution< T > solver_ncld_analyzer(const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt)
Port of solver_ncld_analyzer.m: the load-dependent analyzer, which is solver_ncld plus the same fract...
bool nc_is_dps_model(const qn::NetworkStruct< T > &sn)
True when the model is the closed two-station network Morrison's expansion is derived for: one infini...
NcSolution< T > nc_dispatch(const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt)
Port of @@SolverNC/ncDispatch.m: the inner solve of the fork-join fixed point, which is the load-depe...
bool station_swap_graph_is_zero(const NetworkStruct< T > &sn, std::size_t ist)
True when the station's materialized swap graph is entirely zero.
Conservation laws of a layered queueing network, enumerated from its structure.
Controls and result shape shared by the normalizing-constant analyzers.
A queueing network and its refreshed NetworkStruct.
Port of solver_nc.m: the load-INDEPENDENT normalizing-constant analyzer.
Heavy-usage asymptotic analysis of the closed two-station network with one think (infinite-server) st...
Exact normalizing-constant analysis of a discrete-time (slotted) model.
Port of solver_nc_mem.m and solver_nc_mem_supports.m: the Maximum Entropy Method of Kouvatsos (1994).
Order-independent (OI) and pass-and-swap (P&S) normalizing-constant analysis.
Port of solver_ncld.m: the LOAD-DEPENDENT normalizing-constant analyzer.
static constexpr double FineTol
The [Q,U,R,T,C,X,lG] of the reference, plus the algorithm that ran.
mva::MvaSolution< T > sol
Controls, defaulting to SolverOptions('NC') in the reference.
One job class of the network.
double population
infinite for an open class
One station of the network.
double nservers
may be infinite (a Delay, or an inf-scheduled task)
CdScaling< T > jdscaling
sn.jdscaling for this station: MATLAB's Station.ljdScaling, the JOINT dependence map eta_i(n),...
std::vector< T > lldscaling
sn.lldscaling for this station: the multiplier at population 1, 2, ... Empty when the station is not ...
CdScaling< T > cdscaling
sn.cdscaling for this station: the class-dependence map, empty when unset.