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

Tail quantile of the sojourn time in a non-preemptive priority M/M/1 queue. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <cstdio>
#include <limits>
#include <numeric>
#include <string>
#include <vector>
#include "line/api/sim/sim_dist.h"
#include "line/util/error.h"
#include "line/util/rng_ssj.h"
Include dependency graph for sim_prio_tailquantile.h:

Go to the source code of this file.

Classes

struct  line::sim::PrioTailQuantileOptions
 Options of sim_prio_tailquantile; defaults as in the MATLAB reference. More...
struct  line::sim::PrioTailQuantileResult
 Estimate for one target class. More...
struct  line::sim::detail_prio_tq::Cycle
 One regenerative cycle; buffers are reused across cycles. More...

Namespaces

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

Functions

void line::sim::detail_prio_tq::seed_stream (rng::Mrg32k3a &g, long long seed)
double line::sim::detail_prio_tq::sample_var (const std::vector< double > &x)
std::pair< double, double > line::sim::detail_prio_tq::quantile (const std::vector< double > &R, const std::vector< double > &L, std::size_t from, std::size_t to, double p, int m1, int m2, double sumAlpha)
 Eq.
std::vector< PrioTailQuantileResult > line::sim::sim_prio_tailquantile (const std::vector< double > &lambda, const std::vector< double > &mu, double p, const PrioTailQuantileOptions &opt=PrioTailQuantileOptions())
 Tail quantile of the steady-state response time per class in a non-preemptive priority M/M/1 queue, with its batching confidence interval.

Detailed Description

Tail quantile of the sojourn time in a non-preemptive priority M/M/1 queue.

Port of matlab/src/api/sim/sim_prio_tailquantile.m, cross-checked against jar/src/main/java/jline/api/sim/Sim_prio_tailquantile.java and python/line_solver/api/sim/prio_tailquantile.py.

K classes, Poisson arrivals lambda[k], exponential service mu[k], one server, NON-PREEMPTIVE priority (class index 0 highest), FCFS within a class. For p close to 1 the p-quantile Q_k(p) of each class's steady-state response time is estimated with Algorithm 1 of Guang et al.:

  1. m2 plain regenerative cycles estimate E[alpha_k];
  2. adaptive cross-entropy learns exponential importance rates, raising the level gamma_t ((1-rho) sample quantile of the per-cycle maximum class-k response time) until it passes Q_k(p) (Remark 1) or reaches gammaMax; without gammaMax the CE cycles stay under the importance rates for their whole length while those are stable (sum lambda~/mu~ < 0.95), and the switching level of step 3 is the eq. (8) pilot quantile of the last CE batch;
  3. m1 cycles under a SWITCHING change of measure: importance rates until the first class-k arrival whose lower bound R' (own service + queued class <= k work + residual service) exceeds gammaMax, original rates after; each class-k job carries L at its enter-service epoch;
  4. Q^ = R_(n_p), n_p = min{n : sum_{i>=n} L_(i) <= (1-p)(m1/m2) sum alpha_k} (eq. 8), with the batching interval of Section 4 built on the Student-t quantile with r - 1 degrees of freedom (the printed 1.96 is the r -> inf limit and covers only 92% at r = 10).

RANDOM NUMBERS. One MRG32k3a stream (line::rng::Mrg32k3a, L'Ecuyer's double-precision form), seeded by the same affine map and consumed in the same order as the other three codebases, so a seed gives the same estimate everywhere up to last-ulp differences of log().

WARNINGS BECOME FIELDS. Where MATLAB line_warning()s that the CE loop hit maxIter, the result carries ceConverged = false and the message in warnings.

Reference: J. Guang, G. Hong, X. Chen, X. Peng, L. Chen, B. Bai, G. Zhang, "Tail quantile estimation for non-preemptive priority queues", Proc. Winter Simulation Conference 2022, 85-96.

Definition in file sim_prio_tailquantile.h.