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;
124 if (
opt.method ==
"morrison")
126 "solver_nc_analyzer: method 'morrison' requires a CLOSED network of exactly two "
127 "stations, one infinite-server (think) station and one single-server DPS station with "
128 "exponential service, which this model is not.");
138 (
opt.method ==
"default" ||
opt.method ==
"is" ||
opt.method ==
"sampling"))
142 if (detail::has_svc_rate_fun(
sn, pas))
144 "solver_nc_analyzer: a station with a service rate function (OI / PAS) has no "
145 "product-form demand and cannot be solved by the ordinary normalizing-constant path");
147 bool anyOpen =
false;
151 if (
opt.method ==
"is" && anyOpen)
153 "solver_nc_analyzer: the 'is' importance-sampling method requires a closed queueing "
154 "network. Use 'sampling' for an open or mixed model");
160 bool multiserver =
false;
163 if (multiserver && anyOpen &&
opt.method ==
"exact")
165 "solver_nc_analyzer: the NC solver cannot provide exact solutions for open or mixed "
166 "multiserver queueing networks. Remove the 'exact' option");
171 double eta_max = 0.0;
175 if (e > eta_max) eta_max = e;
179 for (std::size_t k = 0; k <
sn.nclasses; ++k) {
180 const double p =
sn.classes[k].population;
181 if (!std::isfinite(p))
continue;
182 lo.
classes[k].population = std::floor(p);
183 hi.classes[k].population = std::ceil(p);
191 for (std::size_t i = 0; i < A.
rows(); ++i)
192 for (std::size_t j = 0; j < A.
cols(); ++j)
193 A(i, j) = T(Af(i, j) + e * (Ac(i, j) - Af(i, j)));
199 for (std::size_t k = 0; k < out.
sol.X.size(); ++k) {
200 out.
sol.X[k] = T(f.
sol.X[k] + e * (c.
sol.X[k] - f.
sol.X[k]));
201 out.
sol.C[k] = T(f.
sol.C[k] + e * (c.
sol.C[k] - f.
sol.C[k]));
208 out.
sol.lG = f.
sol.lG + eta_max * (f.
sol.lG - c.
sol.lG);
225 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.
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)
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.