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

Port of solver_ssa_analyzer_tstep.m and ssa_tstep_refusal.m: SolverSSA method tstep, the fixed-increment (time-stepped) approximate simulation of a Markovian queueing network. More...

#include <algorithm>
#include <cmath>
#include <cstdint>
#include <random>
#include <string>
#include <vector>
#include "line/api/sn/sn_rt_stations.h"
#include "line/lang/qn/feature_set.h"
#include "line/lang/qn/network_struct.h"
#include "line/lang/qn/solver_feature_sets.h"
#include "line/lang/qn/state_events.h"
#include "line/solvers/ctmc/solver_ctmc_analyzer.h"
#include "line/solvers/ssa/ssa_types.h"
#include "line/util/error.h"
Include dependency graph for ssa_tstep.h:

Go to the source code of this file.

Classes

struct  line::ssa::TstepInfo
 What the engine reports beside the metric table: the step it used and the step count. More...

Namespaces

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

Functions

std::string line::ssa::ssa_tstep_refusal (const qn::NetworkStruct< double > &sn)
 ssa_tstep_refusal.m: the structural rules of tstep that qn::ssa_tstep_feature_set cannot express.
void line::ssa::ssa_tstep_check (const qn::NetworkStruct< double > &sn)
 The two gates of SolverSSA.supportsModelMethod for 'tstep': the feature set, then the refusal.
double line::ssa::ssa_tstep_default_step (const std::vector< double > &active_rates, const std::vector< double > &queue_servers)
 ssa_tstep_default_step: min(0.1, 1/sqrt(cmax ln cmax)) / mumax, with mumax the largest per-server rate over the active non-Source pairs and cmax the largest finite server count of a non-Delay station (the paper's h = 1/sqrt(m log m) in units of the mean service time, capped at a tenth of the fastest service time).
SsaSolution line::ssa::solver_ssa_analyzer_tstep (const qn::NetworkStruct< double > &sn, const SsaOptions &opt, TstepInfo *info=nullptr)
 solver_ssa_analyzer_tstep.m.

Detailed Description

Port of solver_ssa_analyzer_tstep.m and ssa_tstep_refusal.m: SolverSSA method tstep, the fixed-increment (time-stepped) approximate simulation of a Markovian queueing network.

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, ignoring their order. Arrivals (external and routed) are pushed to the END of the step, so a job that arrives in a step is not served before the next one:

  • Delay (INF): d ~ Bin(n, 1-exp(-mu h)).
  • single-class FCFS/SIRO/PS station with c servers: b = min(n,c), m1 ~ Bin(b, p1), m2 ~ Bin(min(m1, n-b), p2), d = m1 + m2, with p1 = 1-exp(-x), p2 = (1-exp(-x)(1+x))/(1-exp(-x)), x = mu h.
  • multiclass PS (extension, not in the paper): the PS share is frozen over the step, d_r ~ Bin(n_r, 1-exp(-mu_r min(n,c)/n h)).
  • Source: a_r ~ Poisson(lambda_r h).

Departures and arrivals are routed by one multinomial draw per (station, class) over sn_rt_stations (Router/ClassSwitch nodes and class switching folded in), drawn as a sequence of conditional binomials; mass routed to the Source column leaves the network. Counts never go negative and closed populations are conserved exactly.

Estimators: QN is the mean of the counts at the step starts after warmup, TN departures per unit time, UN = QN at a Delay and TN/(mu c) elsewhere, RN = QN/TN, XN = TN at the reference station, CN = N/XN. The method is an APPROXIMATION with an O(h) bias (Theorem 1 of the paper); it records no sample path, so solver_ssa serves only the steady-state averages and the sample/transient entries refuse it.

Definition in file ssa_tstep.h.