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

SolverSSA, the nrm method: a port of solver_ssa_nrm.m and its analyzer solver_ssa_analyzer_nrm.m. More...

#include "line/util/line_console.h"
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <limits>
#include <string>
#include <vector>
#include "line/lang/distribution.h"
#include "line/lang/qn/network_struct.h"
#include "line/solvers/ssa/ssa_types.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for solver_ssa_nrm.h:

Go to the source code of this file.

Classes

class  line::ssa::NrmEngine< T >
 The NRM engine: the reaction network built from sn, and the sample path. More...

Namespaces

namespace  line
namespace  line::ssa

Detailed Description

SolverSSA, the nrm method: a port of solver_ssa_nrm.m and its analyzer solver_ssa_analyzer_nrm.m.

WHAT THE METHOD IS. The queueing network is rewritten as a REACTION NETWORK over a state vector counting jobs per (node, class, service phase), and the sample path is generated by Gibson and Bruck's Next Reaction Method: every reaction carries an absolute exponential clock Pk, the elapsed integrated propensity Tk, and fires at tau = (Pk - Tk)/Ak; only the reactions in the fired reaction's dependency set have their propensity recomputed. Metrics are accumulated as time integrals along the path rather than from a stored trajectory, so the memory cost is independent of the sample count.

NRM IS NOT THE SERIAL SIMULATOR. method='serial' is a different engine with a different random stream and a different event granularity. A seed-fixed result from one cannot be reproduced by the other, and a mismatch between them is not evidence of a defect in either.

DOUBLE ONLY. A sample path is generated from exponential clocks, which are -log(u) of a uniform; there is no exact rational value to compute and no additional information a wider float could carry, since the answer's error is the Monte Carlo error and not the rounding. A non-double backend is therefore refused BY NAME rather than silently narrowed, exactly as solver_fluid refuses one.

WHAT IS PORTED AND WHAT REFUSES lives in ssa_dispatch.h, which holds the eligibility gate. This file assumes the gate has already passed and refuses again, by name, for anything it meets that the gate should have caught – a second gate is cheap and a silently wrong sample path is not.

ONE DELIBERATE DIVERGENCE, and it is a reference defect. In solver_ssa_nrm.m lines 1511-1521 the finite-capacity loss test is applied to the destination of EVERY single-destination firing, with only the renege and retry columns excluded – isPhaseRx is not in the exclusion list. A PHASE CHANGE is a single-destination firing whose "destination" is another phase slot of the same job at the same station, so at a station that is at its physical capacity with an open class the reference declares the phase change a loss and DESTROYS the job. The condition is reachable (an M/PH/1/K queue under PS, which phaseNrmOK admits). This port excludes phase changes from the loss test. The divergence is stated rather than hidden because reproducing it would silently violate job conservation, and it is not fixed in the reference from here because that file is outside this port's scope.

Definition in file solver_ssa_nrm.h.