LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
lqns_qnsolver.h File Reference

The flat-Network path of @@SolverLQNS: its qns methods, served by qnsolver of the RADS/LQNS distribution, the way SolverJMT reaches JMVA. More...

#include "line/util/line_console.h"
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <fstream>
#include <limits>
#include <sstream>
#include <string>
#include <vector>
#include "line/io/jmva_writer.h"
#include "line/io/qn2lqn.h"
#include "line/lang/qn/feature_set.h"
#include "line/lang/qn/network_struct.h"
#include "line/solvers/mva/sn_chain.h"
#include "line/solvers/mva/solver_mva_runner.h"
#include "line/solvers/wrappers/lqns/solver_lqns.h"
#include "line/util/error.h"
#include "line/util/subprocess.h"
#include "line/util/tempdir.h"
Include dependency graph for lqns_qnsolver.h:

Go to the source code of this file.

Classes

struct  line::lqns::QnsOptions
 SolverLQNS.defaultOptions on a flat Network plus the knobs the JMVA document carries. More...

Namespaces

namespace  line
 Conservation laws of a layered queueing network, enumerated from its structure.
namespace  line::lqns

Functions

std::vector< std::string > line::lqns::qns_methods ()
 Port of SolverLQNS.listValidMethods on a flat Network.
bool line::lqns::is_qns_method (const std::string &method)
 True for qns and every qns.NAME.
std::string line::lqns::qns_multiserver (const std::string &method)
 The multiserver approximation a Network method selects: the part after qns.
bool line::lqns::is_qnsolver_multiserver (const std::string &m)
 The approximations qnsolver -m accepts; the rest reach it only via LQNS.
template<class T>
std::string line::lqns::qns_method_refusal (const qn::NetworkStruct< T > &L, const std::string &method)
 SolverLQNS.supportsModelMethod's structural rules on a Network, as the REASON they refuse, empty when the pair is served.
bool line::lqns::qnsolver_is_available ()
 Port of SolverLQNS.hasQnsolver: a native qnsolver binary on the PATH.
void line::lqns::check_qns_method (const std::string &method)
 Port of runAnalyzerNetwork's method gate.
std::string line::lqns::resolve_multiserver (const QnsOptions &opt)
 Port of the method -> options.config.multiserver map of runAnalyzerNetwork.m.
template<class T>
void line::lqns::check_qnsolver_supported (const qn::NetworkStruct< T > &L)
 The gate runAnalyzer.m reaches through runAnalyzerChecks, narrowed to what the JMVA document can actually carry.
template<class T>
mva::AvgResult< T > line::lqns::solve_network_run_analyzer (const qn::NetworkStruct< T > &L, const QnsOptions &opt)
 Port of @@SolverLQNS/runAnalyzerNetwork.m and solver_qns.m: SolverLQNS on a flat Network.

Detailed Description

The flat-Network path of @@SolverLQNS: its qns methods, served by qnsolver of the RADS/LQNS distribution, the way SolverJMT reaches JMVA.

MATLAB keeps it in @@SolverLQNS/runAnalyzerNetwork.m and solver_qns.m.

lqns::SolverLQNS<T> remains the LqnModel solver; a flat Network reaches the same solver name through the free functions here (solve_network_run_analyzer, qns_methods, qns_method_refusal).

WHY A WRAPPER IS PORTED AT ALL. Every other solver in cpp/ computes its own answer; this one marshals the model to an external binary and reads the numbers back. It earns its place for the same reason it does in the other three codebases: qnsolver is an INDEPENDENT implementation of the multiserver AMVA lineage that solver_mva also implements, so it is the cross-check that catches an error common to the port and its reference. It is the only external tool in cpp/: LINE ships no copy of it, and every path here refuses by name when the binary is absent rather than answering natively under the LQNS label.

WHAT THE PORT COVERS. The reference dispatches two ways (runAnalyzerNetwork.m):

  • product-form, or any model with open classes -> marshal to JMVA, run qnsolver, parse and de-aggregate. THIS IS PORTED, in full.
  • non-product-form closed -> convert with QN2LQN and delegate to SolverLQNS. This is the same layered path as MATLAB and the JAR; LINE still ships no LQNS binary, so its ordinary availability diagnostic is preserved when the external tool is absent.

METHODS. On a Network the method names are default and qns (the default approximation, rolia) and qns.NAME, which selects approximation NAME; the engine below speaks the bare NAME. conway, reiser, rolia and zhou are what qnsolver -m accepts, and they only take effect on a model that HAS a multiserver station – the reference passes no -m otherwise, and so does this. suri and schmidt reach the tool through the LQNS branch on a non-product-form closed model.

REFERENCES, per method:

  • conway: Conway (1989), extending the multinomial all-servers-busy probability of de Souza e Silva and Muntz (Perform. Eval. 7(3), 1987).
  • rolia: Rolia (PhD thesis, Toronto, 1992) as used in the method of layers (Rolia and Sevcik, IEEE TSE 21(8), 1995), in the per-class Rolia-Franks form of Franks (PhD thesis, Carleton, 1999).
  • zhou: arrival-theorem binomial (AB) approximation, S. Zhou (M.A.Sc. thesis, Carleton, 2021) and Zhou and Woodside (ICPE Companion 2022).
  • suri: Suri, Sahu and Vernon (IERC 2007).
  • reiser: Reiser and Lavenberg (J. ACM 27(2), 1980) load-dependent MVA, see also Reiser (Perform. Eval. 1, 1981).
  • schmidt: Schmidt (Perform. Eval. 29(4), 1997).

Definition in file lqns_qnsolver.h.