Class Solver_ssa_analyzer_tstep
tstep. Port of MATLAB
solver_ssa_analyzer_tstep, ssa_tstep_feature_set and
ssa_tstep_refusal.
Reference: T. Wang, Y. Song and L. J. Hong, "Fast approximation to discrete-event simulation of Markovian queueing networks", Proc. 2023 Winter Simulation Conference, pp. 3613-3624 (WanSH23), Algorithm 1.
The horizon is cut into steps of length h and the per-(station, class) job counts are advanced once per step from the events of that step; arrivals (external and routed) are applied at the END of the step:
- Delay: d ~ Bin(n, 1-exp(-mu h));
- single-class FCFS/SIRO/PS with c servers: b = min(n,c), m1 ~ Bin(b, p1), m2 ~ Bin(min(m1, n-b), p2), d = m1 + m2, with x = mu h, p1 = 1-e^-x, p2 = (1-e^-x (1+x))/(1-e^-x);
- multiclass PS (extension): d_r ~ Bin(n_r, 1-exp(-mu_r min(n,c)/n h));
- Source: a_r ~ Poisson(lambda_r h).
Departures are routed by one multinomial per (station, class) row over the
station routing matrix (SnRtStations), drawn as conditional binomials;
mass routed to the Source exits. QN averages the counts at the step starts
after warmup, TN counts departures per unit time, UN = QN at Delays and
TN/(mu c) elsewhere, RN = QN/TN, XN = TN at the reference station, CN = N/XN.
The method is an APPROXIMATION with O(h) bias; it records no sample path.
Random numbers come from Maths.rand(), the generator every SSA engine
of the JAR draws from and that SolverSSA.runAnalyzer reseeds from
options.seed. Binomial variates use inversion when n*min(p,1-p) < 10 and
Hormann's BTRS otherwise; Poisson variates inversion below a mean of 10 and
Hormann's PTRS otherwise, so a step costs O(1) per row whatever the counts.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic longbinomial(long n, double p) Binomial(n, p) variate: inversion when n*min(p,1-p) < 10, else BTRS (Hormann 1993, "The generation of binomial random variates").static FeatureSetstatic longpoisson(double lambda) Poisson(lambda) variate: inversion when lambda < 10, else PTRS (Hormann 1993, "The transformed rejection method for generating Poisson random variables").static Stringrefusal(NetworkStruct sn) Structural rules the feature set cannot state (MATLAB ssa_tstep_refusal): one class per FCFS/SIRO station, finite positive rates at every visited (station, class), finite server counts at FCFS/SIRO/PS stations.static SSAResultsolver_ssa_analyzer_tstep(NetworkStruct sn, SolverOptions options) Runs the time-stepped approximation.
-
Field Details
-
ALLOWED
Feature envelope of the tstep method (MATLAB ssa_tstep_feature_set).
-
-
Method Details
-
featureSet
- Returns:
- the tstep feature set
-
refusal
Structural rules the feature set cannot state (MATLAB ssa_tstep_refusal): one class per FCFS/SIRO station, finite positive rates at every visited (station, class), finite server counts at FCFS/SIRO/PS stations.- Parameters:
sn- network structure- Returns:
- empty string if accepted, else the reason
-
solver_ssa_analyzer_tstep
Runs the time-stepped approximation.- Parameters:
sn- network structure (after the SSA analyzer's PH/MAP preprocessing)options- solver options;config.warmupfracmust already be resolved- Returns:
- SSAResult with QN, UN, RN, TN, CN, XN (no sample path)
-
binomial
public static long binomial(long n, double p) Binomial(n, p) variate: inversion when n*min(p,1-p) < 10, else BTRS (Hormann 1993, "The generation of binomial random variates"). -
poisson
public static long poisson(double lambda) Poisson(lambda) variate: inversion when lambda < 10, else PTRS (Hormann 1993, "The transformed rejection method for generating Poisson random variables").
-