![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
The state-probability half of the SolverNC class surface: ports of solver_nc_marg.m, solver_nc_margaggr.m, solver_nc_joint.m, solver_nc_jointaggr.m and solver_nc_jointaggr_ld.m, with the five @@SolverNC/getProb* entry points on top of them. More...
#include <algorithm>#include <cmath>#include <cstddef>#include <functional>#include <limits>#include <string>#include <vector>#include "line/api/pfqn/pfqn_ca.h"#include "line/api/pfqn/pfqn_jointmarg.h"#include "line/api/pfqn/pfqn_ncld.h"#include "line/api/pfqn/pfqn_procomom.h"#include "line/lang/distribution.h"#include "line/lang/qn/network_struct.h"#include "line/solvers/mva/sn_chain.h"#include "line/solvers/nc/nc_types.h"#include "line/solvers/nc/solver_nc.h"#include "line/solvers/nc/solver_ncld.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::nc::NcMargResult< T > |
| What the marginal analyzers return: one probability per station. More... | |
| struct | line::nc::NcQueueLengthDist< T > |
| The marginal queue-length distribution and its logarithm. More... | |
Namespaces | |
| namespace | line |
| namespace | line::nc |
Typedefs | |
| using | line::nc::MarginalState = std::vector<std::vector<int>> |
| A state, as this port expresses it: nir[i][r] jobs of class r at station i. | |
Functions | |
| template<class T> | |
| NcMargResult< T > | line::nc::solver_nc_margaggr (const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt, const MarginalState &nir, double lG) |
| Port of solver_nc_margaggr.m. | |
| template<class T> | |
| NcMargResult< T > | line::nc::solver_nc_marg (const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt, const MarginalState &nir, double lG) |
| Port of solver_nc_marg.m: the DETAILED marginal, which weighs the station's internal arrangement and therefore depends on its discipline. | |
| template<class T> | |
| T | line::nc::solver_nc_joint (const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt, const MarginalState &nir, double *lG_out) |
| Port of solver_nc_joint.m: the probability of the WHOLE system state. | |
| template<class T> | |
| T | line::nc::solver_nc_jointaggr (const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt, const MarginalState &nir, double *lG_out) |
| Port of solver_nc_jointaggr.m: the aggregate joint. | |
| template<class T> | |
| T | line::nc::solver_nc_jointaggr_ld (const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt, const MarginalState &nir, double *lG_out) |
| Port of solver_nc_jointaggr_ld.m: the load-dependent joint. | |
| template<class T> | |
| T | line::nc::solver_nc_getprob (const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt, std::size_t ist, const std::vector< int > &nir) |
| Port of @@SolverNC/getProb.m: the DETAILED state probability at one station. | |
| template<class T> | |
| T | line::nc::solver_nc_getprob_aggr (const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt, std::size_t ist, const std::vector< int > &nir, double lG) |
| Port of @@SolverNC/getProbAggr.m: the AGGREGATE probability at one station. | |
| template<class T> | |
| NcQueueLengthDist< T > | line::nc::solver_nc_getprob_marg (const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt, std::size_t ist) |
| Port of @@SolverNC/getProbMarg.m: the TOTAL queue-length distribution. | |
| template<class T> | |
| T | line::nc::solver_nc_getprob_sys (const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt, const MarginalState &nir) |
| Port of @@SolverNC/getProbSys.m. | |
| template<class T> | |
| T | line::nc::solver_nc_getprob_sys_aggr (const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt, const MarginalState &nir) |
| Port of @@SolverNC/getProbSysAggr.m. | |
| template<class T> | |
| T | line::nc::solver_nc_jointmarg (const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt, const std::vector< int > &nvec, const std::string &engine="exact", double *lG_out=nullptr) |
| Joint probability that station i holds nvec[i] jobs IN TOTAL, all classes summed out. | |
| template<class T> | |
| T | line::nc::solver_nc_getprob_sys_marg (const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt, const std::vector< int > &nvec, const std::string &engine="exact") |
| Port of @@SolverNC/getProbSysMarg.m. | |
The state-probability half of the SolverNC class surface: ports of solver_nc_marg.m, solver_nc_margaggr.m, solver_nc_joint.m, solver_nc_jointaggr.m and solver_nc_jointaggr_ld.m, with the five @@SolverNC/getProb* entry points on top of them.
WHAT THIS ADDS THAT NOTHING ELSE IN THE TREE HAS. These are EXACT product-form state probabilities. solver_mva_prob.h also answers getProbAggr, but by its own account it fits a binomial to the means (Schmidt 1997); here the probability is a ratio of normalizing constants and is the model's own, to the last bit.
THE IDENTITY THEY ALL USE. For a station i holding the per-class vector n_i,
Pr[n_i] = F_i(n_i) G_{-i}(N - n_i) / G(N)
where F_i is the station's own balance function evaluated at n_i, G_{-i} is the constant of the network with station i deleted, and G is the constant of the whole model. Each factor is another pfqn_ncld call on a load-dependent lattice, so the whole family is three or four constants per station and nothing else.
NO STATE PACKAGE: THE INPUT IS THE MARGINAL VECTOR. The reference reaches the per-class counts through State.toMarginal(sn, ist, state{isf}), and getProbAggr gets there by encoding the user's per-class vector with State.fromMarginal first – a round trip whose only product is the vector the user already supplied. This port takes that vector directly. The consequence is precise and is enforced rather than hidden: two branches of solver_nc_marg read state a marginal does not carry, and both are refused by name (see solver_nc_prob).
ARITHMETIC. Every probability is a difference of logarithms of normalizing constants, exponentiated once; a non-transcendental backend is refused by name, as in solver_nc.h.
Definition in file solver_nc_prob.h.