![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
#include <line/lang/lang_types.h>
Public Member Functions | |
| bool | is_prior () const |
| bool | has_schedule () const |
| bool | has_marked_schedule () const |
| bool | has_batch_schedule () const |
| std::size_t | max_batch_size () const |
| Largest batch size the schedule declares, or 1 when it carries no batch axis. | |
| bool | is_immediate () const |
| bool | has_map () const |
| True when the type carries a (D0,D1) pair of its own. | |
| std::vector< T > | mu_vec () const |
| Phase rates, MATLAB's getMu: the total outgoing rate of each phase. | |
| std::vector< T > | phi_vec () const |
| Completion probabilities, MATLAB's getPhi: (D1 e) . | |
| std::size_t | phases () const |
| The order of the representation, MATLAB's sn.phases. | |
| T | rate () const |
| The rate MATLAB's refreshRates would store: 1/mean, with the Immediate singleton short-circuited to its declared rate so that the reciprocal of 1e-8 is exactly 1e8 in every arithmetic rather than 1e8 plus rounding. | |
Static Public Member Functions | |
| static Distrib | exp_mean (const T &m) |
| static Distrib | exp_rate (const T &r) |
| static Distrib | immediate () |
| The Immediate singleton. | |
| static Distrib | disabled_dist () |
| static Distrib | det (const T &m) |
| static Distrib | erlang (const T &phase_rate, std::size_t r) |
| Erlang(alpha, r): r phases of rate alpha, as MATLAB's Erlang(phaseRate, nphases). | |
| static Distrib | erlang_fit (const T &m, const T &c2) |
| Erlang fitted to a mean and an SCV, as MATLAB's Erlang.fitMeanAndSCV. | |
| static Distrib | hyperexp_n (const std::vector< T > &p, const std::vector< T > &lambda) |
| HyperExp(p, lambda1, lambda2): phase i chosen with probability p_i. | |
| static Distrib | hyperexp (const T &p, const T &lambda1, const T &lambda2) |
| static Distrib | coxian (const std::vector< T > &mu, const std::vector< T > &phi) |
| Coxian(mu, phi): phase i completes with probability phi(i) and otherwise moves to phase i+1. | |
| static Distrib | cox2 (const T &mu1, const T &mu2, const T &phi1) |
| Cox2(mu1, mu2, phi1), MATLAB's two-phase Coxian constructor. | |
| static Distrib | phase_type (const std::vector< T > &alpha, const Matrix< T > &A, bool acyclic) |
| PH / APH given by (alpha, A): D0 = A and D1 = (-A e) alpha. | |
| static Distrib | map_dist (const Matrix< T > &D0, const Matrix< T > &D1, ProcessType tag) |
| A MAP given by its two matrices; the moments are those of its stationary phase. | |
| static void | check_sched_generator (const std::string &who, const std::vector< Matrix< T > > &D0segs, const std::vector< std::vector< Matrix< T > > > &blocks) |
| Reject a schedule segment that is not a generator, the check MATLAB, the JAR and Python all apply and this port used to skip. | |
| static void | check_common_support (const std::string &who, const std::string &label, const std::vector< Matrix< T > > &mats, bool ignore_diagonal) |
| Reject a schedule whose matrices do not share one sparsity pattern, the twin of MATLAB's MAPt.checkCommonSupport. | |
| static Distrib | sched_dist (const std::vector< T > &breakpoints, const std::vector< Matrix< T > > &D0segs, const std::vector< Matrix< T > > &D1segs, bool cyclic, ProcessType tag) |
| The shared constructor of the three schedule families. | |
| static Distrib | mapt (const std::vector< T > &breakpoints, const std::vector< Matrix< T > > &D0segs, const std::vector< Matrix< T > > &D1segs, bool cyclic) |
| MAPt(breakpoints, {D0_k}, {D1_k}, cyclic): a piecewise-constant (D0(t), D1(t)). | |
| static Distrib | pht (const std::vector< T > &breakpoints, const std::vector< std::vector< T > > &alphas, const std::vector< Matrix< T > > &Ssegs, bool cyclic) |
| PHt(breakpoints, {alpha_k}, {S_k}, cyclic), stored as its equivalent MAP schedule: D0 = S and D1 = (-S e) alpha, the pair sn_schedule_nominal builds from a PHt slot. | |
| static Distrib | mmapt (const std::vector< T > &breakpoints, const std::vector< Matrix< T > > &D0segs, const std::vector< std::vector< Matrix< T > > > &Dmarksegs, bool cyclic) |
| MMAPt(breakpoints, {D0_k}, {{D1^(c)_k}}, cyclic): the marked schedule. | |
| static Distrib | bmmapt (const std::vector< T > &breakpoints, const std::vector< Matrix< T > > &D0segs, const std::vector< std::vector< std::vector< Matrix< T > > > > &Dbatchsegs, bool cyclic) |
| BMMAPt(breakpoints, {D0_k}, {{{D^(c,b)_k}}}, cyclic): the BATCH marked schedule. | |
| static Distrib | mpht (const std::vector< T > &breakpoints, const std::vector< std::vector< T > > &alphas, const std::vector< Matrix< T > > &Ssegs, const std::vector< std::vector< std::vector< T > > > &exits, bool cyclic) |
| MPHt(breakpoints, {alpha_k}, {S_k}, {{s^(c)_k}}, cyclic), stored LOWERED to MMAPt form segment by segment: D0_k = S_k and D1^(c)_k = s^(c)_k alpha_k. | |
| static Distrib | nhpp (const std::vector< T > &breakpoints, const std::vector< T > &rates, bool cyclic) |
| NHPP(breakpoints, rates, cyclic): a MAPt of ORDER ONE, which is what an inhomogeneous Poisson process is. | |
| static Distrib | uniform (const T &a, const T &b) |
| Uniform(a, b). | |
| static Distrib | pareto (const T &shape, const T &scale) |
| Pareto(shape, scale), with the MATLAB parameter order (alpha, k). | |
| static Distrib | gamma_dist (const T &shape, const T &scale) |
| Gamma(shape, scale), Weibull(scale, shape) and Lognormal(mu, sigma). | |
| static Distrib | weibull (const T &scale, const T &shape) |
| static Distrib | lognormal (const T &logmean, const T &logsigma) |
| static Distrib | normal (const T &mu, const T &sigma) |
| Normal(mu, sigma): the Gaussian, for use as a continuous Prior's parameter density. | |
| static Distrib | replayer_from (const std::vector< T > &samples, const std::string &path) |
| Replayer / Trace read FROM A FILE, which keeps the path beside the samples. | |
| static Distrib | replayer (const std::vector< T > &samples) |
| Replayer / Trace: the samples, with their empirical first two moments. | |
| static Distrib | discrete_uniform (const T &a, const T &b) |
| DiscreteUniform(a, b) over the integers a..b inclusive. | |
| static Distrib | bernoulli (const T &p) |
| Bernoulli(p): one trial, mean p and variance p(1-p). | |
| static Distrib | binomial (const T &n, const T &p) |
| Binomial(n, p). | |
| static Distrib | poisson (const T &lambda) |
| Poisson(lambda), whose SCV is 1/lambda – the count's variance is lambda and its mean is lambda, so this is NOT the exponential's SCV of 1. | |
| static Distrib | geometric (const T &p) |
| Geometric(p) on the MATLAB convention: the NUMBER OF TRIALS to the first success, support {1, 2, ...}, so the mean is 1/p and the SCV is 1-p. | |
| static Distrib | zipf (const T &s, std::size_t n) |
| Zipf(s, n) over the ranks 1..n, with the generalized harmonic moments H(s-1,n)/H(s,n) and H(s-2,n)/H(s,n) MATLAB Zipf.m uses. | |
| static Distrib | discrete_sampler (const std::vector< T > &p, const std::vector< T > &x) |
| DiscreteSampler(p, x): the pmf p over the points x. | |
| static Distrib | empirical_cdf (const std::vector< T > &x, const std::vector< T > &F) |
| EmpiricalCDF(x, F): the moments of the MIDPOINT rule over the CDF bins, which is what MATLAB EmpiricalCDF.getMoments integrates – each bin contributes its midpoint raised to the moment order, weighted by the CDF increment. | |
| static Distrib | me (const std::vector< T > &alpha, const Matrix< T > &A) |
| ME(alpha, A): the matrix-exponential distribution, whose moments are the phase-type ones – k! | |
| static Distrib | rap (const Matrix< T > &H0, const Matrix< T > &H1) |
| RAP(H0, H1): a rational arrival process, whose moments are the MAP ones. | |
| static Distrib | dmap (const Matrix< T > &D0, const Matrix< T > &D1) |
| DMAP(D0, D1): a DISCRETE-time MAP, where D0 + D1 is stochastic rather than a generator. | |
| static Distrib | mmap (const Matrix< T > &D0, const std::vector< Matrix< T > > &D1k) |
| MMAP: D0 plus one D1 block per mark. | |
| static Distrib | bmap (const std::vector< Matrix< T > > &D) |
| BMAP: the batch-size blocks D0, D1, ..., Dk, where Dj carries an arrival of batch size j. | |
| static T | ph_moment (const std::vector< T > &alpha, const Matrix< T > &A, unsigned k) |
| The k-th raw moment of a phase-type (alpha, A): k! | |
| static T | ph_moment_from (const Matrix< T > &A, std::size_t start, unsigned k) |
| The same, for a representation entered in a single phase (1-based). | |
Public Attributes | |
| ProcessType | type = ProcessType::DISABLED |
| std::shared_ptr< Distrib< T > > | declared |
| The law as DECLARED, when this one is a surrogate fitted over it. | |
| T | mean = num_traits<T>::from_int(0) |
| T | scv = num_traits<T>::from_int(1) |
| bool | disabled = true |
| std::vector< T > | params |
| Constructor arguments, in MATLAB getParam order. | |
| std::vector< T > | trace |
| Replayer / Trace samples; empty for every other type. | |
| std::string | trace_file |
| The trace FILE a Replayer was read from, when there was one. | |
| bool | cox_scalar_form = false |
| Built by cox2(mu1, mu2, phi1), MATLAB's 3-argument Coxian(mu1, mu2, phi1); read only by the code generators. | |
| Matrix< T > | D0 |
| The (D0,D1) pair when the type carries one directly. | |
| Matrix< T > | D1 |
| std::vector< Matrix< T > > | Dmark |
| MMAP per-class D1 blocks / BMAP per-batch-size blocks; empty otherwise. | |
| std::shared_ptr< PriorSpec< T > > | prior |
| The alternatives of a Prior, set only when type == PRIOR. | |
| std::vector< T > | sched_bp |
| sn.proc{i}{r} = {breakpoints, A, B, cyclic} of a MAPt / PHt / NHPP. | |
| std::vector< Matrix< T > > | sched_D0 |
| std::vector< Matrix< T > > | sched_D1 |
| std::vector< std::vector< Matrix< T > > > | sched_Dmark |
| The MARKED schedule, sched_Dmark[c][k] being the block of mark c+1 in segment k. | |
| std::vector< std::vector< std::vector< Matrix< T > > > > | sched_Dbatch |
| The BATCH marked schedule, sched_Dbatch[c][b][k] being the block that, in segment k, releases a batch of b+1 jobs all carrying mark c+1. | |
| bool | sched_cyclic = false |
Definition at line 808 of file lang_types.h.
|
inlinestatic |
Bernoulli(p): one trial, mean p and variance p(1-p).
Definition at line 1764 of file lang_types.h.
|
inlinestatic |
Binomial(n, p).
Definition at line 1776 of file lang_types.h.
|
inlinestatic |
BMAP: the batch-size blocks D0, D1, ..., Dk, where Dj carries an arrival of batch size j.
The wire form is the whole list including D0, so the head is split off here.
Definition at line 1971 of file lang_types.h.
|
inlinestatic |
BMMAPt(breakpoints, {D0_k}, {{{D^(c,b)_k}}}, cyclic): the BATCH marked schedule.
Dbatchsegs is MARK-MAJOR, then BATCH, then segment: Dbatchsegs[c][b][k] is the block that, in segment k, releases a batch of b+1 jobs all carrying mark c+1. The batch axis is DENSE, as BMAP's blocks are, so an unused batch size is declared as a zero block rather than omitted.
Two derived levels are built here and are what makes the family cheap: the batch-aggregated per-mark blocks become sched_Dmark, so every MMAPt consumer reads the marked schedule unchanged, and their sum becomes sched_D1, so every MAPt consumer reads the unmarked one. A B = 1 BMMAPt therefore IS the MMAPt with the same blocks, and with K = 1 as well it IS the MAPt.
The support rule binds the per-mark AGGREGATES and the total, not the individual (mark, batch) blocks: requiring one pattern there too would forbid a batch composition that changes with the segment, which is the one thing this family exists to express and which neither reduction needs.
Definition at line 1460 of file lang_types.h.
|
inlinestatic |
Reject a schedule whose matrices do not share one sparsity pattern, the twin of MATLAB's MAPt.checkCommonSupport.
The fluid solver expresses a segment as a per-entry multiplier on a nominal matrix, and that multiplier is undefined where the nominal entry is zero.
Definition at line 1253 of file lang_types.h.
|
inlinestatic |
Reject a schedule segment that is not a generator, the check MATLAB, the JAR and Python all apply and this port used to skip.
D0's off-diagonal and every arrival block must be non-negative, and D0 + sum(blocks) must have zero row sums in every segment. Without it a negative rate or a leaking row reaches the sampler, where it surfaces as a negative holding time or a walk that never fires – a wrong answer rather than a refusal.
Definition at line 1212 of file lang_types.h.
|
inlinestatic |
Cox2(mu1, mu2, phi1), MATLAB's two-phase Coxian constructor.
Definition at line 1144 of file lang_types.h.
|
inlinestatic |
Coxian(mu, phi): phase i completes with probability phi(i) and otherwise moves to phase i+1.
The last phase always completes.
Definition at line 1118 of file lang_types.h.
|
inlinestatic |
Definition at line 989 of file lang_types.h.
|
inlinestatic |
Definition at line 988 of file lang_types.h.
Referenced by line::mva::fj_fixed_point(), and line::mva::fj_mmt().
|
inlinestatic |
DiscreteSampler(p, x): the pmf p over the points x.
THE MOMENTS ARE TAKEN OVER x. This port, and MATLAB DiscreteSampler.getMean with it, used to weight by the RANKS 1..n instead; the two agree on the default x = 1:n, which is the form the cache popularity vectors are written in, so the rank form survived unnoticed until a fork's jobs-per-link distribution arrived on a shifted support. The JAR and native Python already weighted by x.
Definition at line 1863 of file lang_types.h.
|
inlinestatic |
DiscreteUniform(a, b) over the integers a..b inclusive.
Definition at line 1748 of file lang_types.h.
|
inlinestatic |
DMAP(D0, D1): a DISCRETE-time MAP, where D0 + D1 is stochastic rather than a generator.
Its moments cannot come from dist_refresh_moments's continuous formulas; dmap_moments in lang/distribution.h fills them.
Definition at line 1943 of file lang_types.h.
|
inlinestatic |
EmpiricalCDF(x, F): the moments of the MIDPOINT rule over the CDF bins, which is what MATLAB EmpiricalCDF.getMoments integrates – each bin contributes its midpoint raised to the moment order, weighted by the CDF increment.
The rows are the (F, x) pairs in the order they arrive.
Definition at line 1894 of file lang_types.h.
|
inlinestatic |
Erlang(alpha, r): r phases of rate alpha, as MATLAB's Erlang(phaseRate, nphases).
Definition at line 1004 of file lang_types.h.
|
inlinestatic |
Erlang fitted to a mean and an SCV, as MATLAB's Erlang.fitMeanAndSCV.
AN SCV ABOVE ONE IS REFUSED, not answered. An Erlang of order r has SCV = 1/r, so the family reaches 1 and no higher; ceil(1/c2) is 1 for every c2 > 1, and returning that means handing back an EXPONENTIAL under the name of the distribution the caller asked for. MATLAB errors here and this port now does too, so a mis-specified SCV is a diagnostic rather than a silently different service process.
Definition at line 1035 of file lang_types.h.
|
inlinestatic |
Definition at line 930 of file lang_types.h.
|
inlinestatic |
Definition at line 945 of file lang_types.h.
Referenced by line::mva::fj_exp_fit_mean(), line::mva::fj_fixed_point(), line::mva::fj_ht_sync_delays(), and line::mva::fj_mmt().
|
inlinestatic |
Gamma(shape, scale), Weibull(scale, shape) and Lognormal(mu, sigma).
Their moments are values of the gamma function or of exp, so they exist only where the arithmetic has transcendentals. Under exact arithmetic the factory REFUSES rather than storing a rounded rational: a rational that came out of tgamma is not the exact moment of the distribution, and every downstream claim of exactness would be false.
Definition at line 1626 of file lang_types.h.
|
inlinestatic |
Geometric(p) on the MATLAB convention: the NUMBER OF TRIALS to the first success, support {1, 2, ...}, so the mean is 1/p and the SCV is 1-p.
Definition at line 1807 of file lang_types.h.
|
inline |
Definition at line 924 of file lang_types.h.
|
inline |
True when the type carries a (D0,D1) pair of its own.
Definition at line 1982 of file lang_types.h.
|
inline |
Definition at line 923 of file lang_types.h.
|
inline |
Definition at line 922 of file lang_types.h.
|
inlinestatic |
Definition at line 1087 of file lang_types.h.
|
inlinestatic |
HyperExp(p, lambda1, lambda2): phase i chosen with probability p_i.
D1(i,j) = mu(i) p(j) – the OUTER product. Associating the other way gives D1(i,j) = mu(i) p(i) replicated across the row, whose rows no longer sum with D0 to zero; _kb records that trap in the MATLAB class. The same for any number of branches, which is what MATLAB HyperExp accepts and what the writers emit as vector p and lambda. The two-branch entry point stays because it carries MATLAB's getParam order (p, lambda1, lambda2), which a parameter-by-parameter dump compares against.
Definition at line 1062 of file lang_types.h.
|
inlinestatic |
The Immediate singleton.
Its MEAN is zero and its RATE is 1e8, and the two are deliberately not reciprocal: MATLAB's Immediate.getMean() returns 0 while Immediate.getRate() returns GlobalConstants.Immediate, and both are read, by different callers. SolverLN reads the mean (a task with an Immediate think time contributes no think time); Network.refreshRates reads the rate (the station serves the class in 1e-8 time units, not in zero, which would be an infinite service rate the MVA recursion cannot carry). Collapsing them onto 1/mean or 1/rate breaks one caller or the other, so the type tag decides. The point mass at zero.
Its SCV is 1, NOT the 0 of a degenerate distribution. The reference makes this explicit – Immediate.getSCV returns 1 in MATLAB, in the JAR and in Python – because Immediate is realised downstream as an exponential of rate GlobalConstants.Immediate rather than as a Dirac: rate() below returns 1e8, and the SCV has to be the one that goes with it. Declaring 0 here is invisible on a layer of PS or infinite-server stations, where the AMVA correction does not read the SCV at all, and shows up only once a layer holds an FCFS or multiserver station – so it survives a model like lqn_ofbiz and breaks a model like lqn_basic.
Definition at line 977 of file lang_types.h.
Referenced by line::mva::fj_fixed_point(), line::mva::fj_ht(), and line::mva::fj_mmt().
|
inline |
Definition at line 1979 of file lang_types.h.
|
inline |
Definition at line 878 of file lang_types.h.
|
inlinestatic |
Definition at line 1661 of file lang_types.h.
|
inlinestatic |
A MAP given by its two matrices; the moments are those of its stationary phase.
Definition at line 1184 of file lang_types.h.
|
inlinestatic |
MAPt(breakpoints, {D0_k}, {D1_k}, cyclic): a piecewise-constant (D0(t), D1(t)).
breakpoints is the boundary vector, so it holds one more entry than there are segments and must be strictly increasing. Every segment must have the SAME ORDER: the schedule modulates one phase structure, it does not switch between structures, and a solver that integrated across a change of order would have no way to map the phase occupancy across the boundary. That is the reference's own constructor requirement.
D0 / D1 are set to the WIDTH-WEIGHTED TIME AVERAGE of the segments, which is sn_schedule_nominal's nominal pair: it is the stationary carrier of the phase structure the schedule modulates, so the phase count and the mean rate a time-blind consumer reads are the ones the model actually has.
Definition at line 1352 of file lang_types.h.
|
inline |
Largest batch size the schedule declares, or 1 when it carries no batch axis.
Definition at line 926 of file lang_types.h.
|
inlinestatic |
ME(alpha, A): the matrix-exponential distribution, whose moments are the phase-type ones – k!
alpha (-A)^-k e – evaluated by DEFINITION rather than through the stationary vector of A + (-Ae)alpha. MATLAB ME.getMean makes the same choice and says why: the stationary solve is a probabilistic object that a non-Markovian A degrades badly (a CME of order 101 lost 2.6e-4 in the SCV that way, against 1e-13 by definition).
Definition at line 1927 of file lang_types.h.
|
inlinestatic |
MMAP: D0 plus one D1 block per mark.
D1 is their sum, the aggregate arrival matrix every unmarked consumer reads, and the blocks stay in Dmark for the ones that distinguish marks.
Definition at line 1952 of file lang_types.h.
|
inlinestatic |
MMAPt(breakpoints, {D0_k}, {{D1^(c)_k}}, cyclic): the marked schedule.
Dmarksegs is MARK-MAJOR, Dmarksegs[c][k] being the block of mark c+1 in segment k, matching the wire order of the D1k key. The aggregate per segment becomes sched_D1, so the unmarked schedule this lowers to is exactly the MAPt with the same matrices and a K = 1 MMAPt IS that MAPt.
Definition at line 1396 of file lang_types.h.
|
inlinestatic |
MPHt(breakpoints, {alpha_k}, {S_k}, {{s^(c)_k}}, cyclic), stored LOWERED to MMAPt form segment by segment: D0_k = S_k and D1^(c)_k = s^(c)_k alpha_k.
Same treatment a PHt gets, for the same reason: one representation means one walk. The exit vectors must partition the absorption rate, sum_c s^(c)_k = -S_k e, which is what makes D0 plus the blocks a generator in every segment.
Definition at line 1519 of file lang_types.h.
|
inline |
Phase rates, MATLAB's getMu: the total outgoing rate of each phase.
Empty when the type carries no representation, which is what refreshProcessPhases writes as NaN for a Fork or a Join.
Definition at line 1990 of file lang_types.h.
|
inlinestatic |
NHPP(breakpoints, rates, cyclic): a MAPt of ORDER ONE, which is what an inhomogeneous Poisson process is.
Building it through the same path is what makes every schedule consumer see one representation.
Definition at line 1572 of file lang_types.h.
|
inlinestatic |
Normal(mu, sigma): the Gaussian, for use as a continuous Prior's parameter density.
scv is Inf at mu = 0, which is Normal.m:52-63's own answer and not a degradation: the SCV of a zero-mean law is not defined, and the reference says so rather than dividing.
Definition at line 1689 of file lang_types.h.
|
inlinestatic |
Pareto(shape, scale), with the MATLAB parameter order (alpha, k).
Definition at line 1602 of file lang_types.h.
|
inlinestatic |
The k-th raw moment of a phase-type (alpha, A): k!
alpha (-A)^-k e.
The inverse is never formed: the powers are accumulated by repeated solves of (-A) x = b, which is exact in rational arithmetic and stable in floating point.
Definition at line 2032 of file lang_types.h.
|
inlinestatic |
The same, for a representation entered in a single phase (1-based).
Definition at line 2044 of file lang_types.h.
|
inlinestatic |
PH / APH given by (alpha, A): D0 = A and D1 = (-A e) alpha.
acyclic selects the type tag only; the representation is the same, and no consumer of sn.proc distinguishes them.
Definition at line 1161 of file lang_types.h.
|
inline |
The order of the representation, MATLAB's sn.phases.
Definition at line 2020 of file lang_types.h.
|
inline |
Completion probabilities, MATLAB's getPhi: (D1 e) .
/ (-diag(D0)).
Definition at line 2002 of file lang_types.h.
|
inlinestatic |
PHt(breakpoints, {alpha_k}, {S_k}, cyclic), stored as its equivalent MAP schedule: D0 = S and D1 = (-S e) alpha, the pair sn_schedule_nominal builds from a PHt slot.
Definition at line 1364 of file lang_types.h.
|
inlinestatic |
Poisson(lambda), whose SCV is 1/lambda – the count's variance is lambda and its mean is lambda, so this is NOT the exponential's SCV of 1.
Definition at line 1792 of file lang_types.h.
|
inlinestatic |
RAP(H0, H1): a rational arrival process, whose moments are the MAP ones.
Definition at line 1934 of file lang_types.h.
|
inline |
The rate MATLAB's refreshRates would store: 1/mean, with the Immediate singleton short-circuited to its declared rate so that the reciprocal of 1e-8 is exactly 1e8 in every arithmetic rather than 1e8 plus rounding.
Definition at line 2097 of file lang_types.h.
|
inlinestatic |
Replayer / Trace: the samples, with their empirical first two moments.
Definition at line 1720 of file lang_types.h.
|
inlinestatic |
Replayer / Trace read FROM A FILE, which keeps the path beside the samples.
Every solver in this port replays trace; the path is what the EXPORTERS need. JMT is handed a ReplayerPar naming a file and has no way to take samples inline, so a Replayer exported without it is a JMT model that reads nothing – oqn_trace_driven was refused outright for exactly that.
Definition at line 1713 of file lang_types.h.
|
inlinestatic |
The shared constructor of the three schedule families.
Definition at line 1276 of file lang_types.h.
|
inlinestatic |
Uniform(a, b).
Definition at line 1588 of file lang_types.h.
|
inlinestatic |
Definition at line 1638 of file lang_types.h.
|
inlinestatic |
Zipf(s, n) over the ranks 1..n, with the generalized harmonic moments H(s-1,n)/H(s,n) and H(s-2,n)/H(s,n) MATLAB Zipf.m uses.
The harmonic sums call pow for a non-integer shape, so the factory is gated on transcendental arithmetic exactly as Weibull and Lognormal are.
Definition at line 1825 of file lang_types.h.
| bool line::lang::Distrib< T >::cox_scalar_form = false |
Built by cox2(mu1, mu2, phi1), MATLAB's 3-argument Coxian(mu1, mu2, phi1); read only by the code generators.
Definition at line 842 of file lang_types.h.
| Matrix<T> line::lang::Distrib< T >::D0 |
The (D0,D1) pair when the type carries one directly.
EMPTY for Det, Uniform, Pareto, Gamma, Weibull, Lognormal and Replayer: MATLAB's getProcess returns their raw PARAMETERS there, and refreshProcessRepresentations replaces them with an Erlang approximation (convertToMAP) on the way into sn.proc. That conversion is a property of the refresh, not of the distribution, so it is not done here; see dist_to_map() in lang/distribution.h.
Definition at line 853 of file lang_types.h.
| Matrix<T> line::lang::Distrib< T >::D1 |
Definition at line 853 of file lang_types.h.
| std::shared_ptr<Distrib<T> > line::lang::Distrib< T >::declared |
The law as DECLARED, when this one is a surrogate fitted over it.
sn_nonmarkov_toph installs a fitted (D0,D1) over a Gamma or a Lognormal and retags type PH or ME, after which nothing names or evaluates the law the user wrote. MMAP[K]/G[K]/1 reads that law's TRANSFORM rather than the fit, so it needs the original; every other consumer wants the surrogate and reads this struct as before. Null when no substitution has happened. A POINTER, and shared, for the reason prior below is one: an inline member would make the type self-embedding.
Definition at line 821 of file lang_types.h.
| bool line::lang::Distrib< T >::disabled = true |
Definition at line 824 of file lang_types.h.
| std::vector<Matrix<T> > line::lang::Distrib< T >::Dmark |
MMAP per-class D1 blocks / BMAP per-batch-size blocks; empty otherwise.
OVERLOADED, and the type says which reading applies. For a BMMAPt it carries the MARK reading – the width-weighted, BATCH-AGGREGATED per-mark averages – because that is what mam::mmap_lambda is asked for when the engine reports per-mark source throughputs. Its batch nominal is derived from sched_Dbatch instead, so the two axes never contend for this one field.
Definition at line 863 of file lang_types.h.
| T line::lang::Distrib< T >::mean = num_traits<T>::from_int(0) |
Definition at line 822 of file lang_types.h.
| std::vector<T> line::lang::Distrib< T >::params |
Constructor arguments, in MATLAB getParam order.
Definition at line 826 of file lang_types.h.
| std::shared_ptr<PriorSpec<T> > line::lang::Distrib< T >::prior |
The alternatives of a Prior, set only when type == PRIOR.
A POINTER, and shared: PriorSpec holds Distrib<T> values, so an inline member would make the type self-embedding, and the spec is immutable once built, so copying a service table copies a pointer rather than a design. mean and scv beside it are the MIXTURE moments, as MATLAB's Prior.getMean/getSCV return: a Prior that reaches refresh_rates therefore lowers to a rate rather than to a NaN. That is for honesty of the struct dump only – the featset gate refuses the model before any solver reads those rates, and dist_to_map, dist_lst and dist_moment refuse a Prior by name.
Definition at line 877 of file lang_types.h.
| std::vector<T> line::lang::Distrib< T >::sched_bp |
sn.proc{i}{r} = {breakpoints, A, B, cyclic} of a MAPt / PHt / NHPP.
sched_bp has one more entry than there are segments – it is the BOUNDARY vector, so segment k is in force on [bp(k), bp(k+1)) – and sched_D0[k], sched_D1[k] are the pair of segment k, ALREADY in MAP form. A PHt is stored converted, D0 = S and D1 = (-S e) alpha, because sn_schedule_nominal converts it on every read and keeping the raw (alpha, S) here would make every consumer repeat that conversion and one of them eventually forget. The raw form is not needed: the conversion is lossless and nothing downstream asks for alpha again.
EMPTY FOR EVERY OTHER TYPE. has_schedule() is the test, and a solver with no notion of time simply never calls it – the nominal pair in D0/D1 is a complete, time-averaged answer for such a solver.
Definition at line 896 of file lang_types.h.
| bool line::lang::Distrib< T >::sched_cyclic = false |
Definition at line 921 of file lang_types.h.
| std::vector<Matrix<T> > line::lang::Distrib< T >::sched_D0 |
Definition at line 897 of file lang_types.h.
| std::vector<Matrix<T> > line::lang::Distrib< T >::sched_D1 |
Definition at line 897 of file lang_types.h.
| std::vector<std::vector<std::vector<Matrix<T> > > > line::lang::Distrib< T >::sched_Dbatch |
The BATCH marked schedule, sched_Dbatch[c][b][k] being the block that, in segment k, releases a batch of b+1 jobs all carrying mark c+1.
Empty for every family but BMMAPt.
The two derived levels stay populated beside it and are what keeps every existing consumer working: sched_Dmark[c][k] is the batch-aggregated sum_b sched_Dbatch[c][b][k], and sched_D1[k] the aggregate over marks as well. So a consumer that ignores batches reads the MMAPt this hides down to, and one that ignores marks too reads the MAPt. Only a consumer that actually RELEASES jobs has to look here; has_batch_schedule() is the test.
The batch axis is DENSE in b = 1..B, as BMAP's blocks are, so an unused batch size is a zero block rather than a gap.
Definition at line 920 of file lang_types.h.
| std::vector<std::vector<Matrix<T> > > line::lang::Distrib< T >::sched_Dmark |
The MARKED schedule, sched_Dmark[c][k] being the block of mark c+1 in segment k.
Empty for an unmarked schedule. sched_D1[k] stays the per-segment AGGREGATE sum_c sched_Dmark[c][k], so every consumer that ignores marks reads the same unmarked schedule it always did; this is the schedule twin of Dmark beside D1.
Definition at line 904 of file lang_types.h.
| T line::lang::Distrib< T >::scv = num_traits<T>::from_int(1) |
Definition at line 823 of file lang_types.h.
| std::vector<T> line::lang::Distrib< T >::trace |
Replayer / Trace samples; empty for every other type.
Definition at line 828 of file lang_types.h.
| std::string line::lang::Distrib< T >::trace_file |
The trace FILE a Replayer was read from, when there was one.
The samples above are what every solver in this port uses, so the path is carried only for the exporters: saveServiceStrategy hands JMT a ReplayerPar naming a file, and a Replayer exported without it is a JMT model that reads nothing. Empty when the samples were supplied directly. network_writer.h emits it for the same reason: the samples have no wire form, so without the path a Replayer is written back as the moments and reloads as a different law.
Definition at line 840 of file lang_types.h.
| ProcessType line::lang::Distrib< T >::type = ProcessType::DISABLED |
Definition at line 809 of file lang_types.h.