![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Port of matlab/src/api/sn/sn_is_discrete_time.m. More...
#include <cmath>#include <cstddef>#include <cstdio>#include <string>#include "line/lang/lang_types.h"#include "line/lang/qn/network_struct.h"#include "line/num/number.h"#include "line/solvers/slotted_request.h"#include "line/util/error.h"Go to the source code of this file.
Classes | |
| struct | line::api::DiscreteTimeInfo |
| Which laws the model carries, and why it was refused when it was. More... | |
| struct | line::api::DiscreteTimeOptions |
| How the caller may override the automatic decision. More... | |
Namespaces | |
| namespace | line |
| Conservation laws of a layered queueing network, enumerated from its structure. | |
| namespace | line::api |
Functions | |
| template<class T> | |
| bool | line::api::sn_is_discrete_time (const qn::NetworkStruct< T > &sn, const DiscreteTimeOptions &options, double *slot_length, DiscreteTimeInfo *info) |
| True when every law of sn is lattice-valued on slot_length. | |
Port of matlab/src/api/sn/sn_is_discrete_time.m.
Decides whether every interarrival and service law of a model lives on the slot lattice {slotLength, 2*slotLength, ...}, which is what lets SolverMAM take the discrete-time (Q-MAM) path instead of the continuous one.
The slot length is the LATTICE UNIT: a law keeps the meaning it has in every other solver, and is admitted when each of its samples is a positive multiple of d, which is the rule the LDES slotted engine enforces. Geometric (support {1,2,...}), DMAP and DiscreteUniform (integral bounds) step in whole time units, so they are on the lattice exactly when 1/d is an integer; Det(v) is on it when v/d is a positive integer. Immediate is deliberately not a lattice law: a zero interval is not a point of {d,2d,...}.
Under timescale "auto" a model whose laws are all Det is NOT discrete-time, even when every value is a whole number of slots: D/D/c is a continuous-time model with a continuous-time answer, and only a Geometric, DiscreteUniform or DMAP says that the model was written per slot. An explicit "discrete" (or slotted=true) still admits it. The request itself is read through solvers::slotted_request, the resolver NC, MAM and LDES share.
The test reads procid, rates and scv and NOT the fitted proc matrices: by the time a solver sees the struct a Geometric has already been converted to a CONTINUOUS MAP, so the lattice is no longer visible there. A DMAP is the exception, its (D0,D1) having MAP shape it survives verbatim. For the same reason this test must run BEFORE any phase-type conversion.
ARITHMETIC: field, with one square root in the DiscreteUniform width. Every other test is a comparison, so the family instantiates under Rational apart from that branch, which needs a real square root.
Definition in file sn_is_discrete_time.h.