api.dqsys
- dqsys_geoxgeo1(a, beta, s, convention)
QSYS_GEOXGEO1 Exact analysis of a discrete-time Geo^X/Geo/1 batch queue.
RESULT = QSYS_GEOXGEO1(A, BETA, S) analyzes a slotted single-server queue with batch arrivals:
A - per-slot probability that a batch arrives (0 < A <= 1) BETA - batch-size geometric parameter; the batch is supported on
{1,2,…} with mean 1/BETA (0 < BETA <= 1)
S - per-slot service completion probability (0 < S <= 1)
Stability requires LAMBDA = A/BETA < S.
RESULT = QSYS_GEOXGEO1(A, BETA, S, CONVENTION) selects the observation epoch, ‘LAS_DA’ (default) or ‘EAS’; see QSYS_GEOGEO1 for what they mean.
With A(z) = 1-A+A*X(z) the pgf of the number of jobs arriving in one slot, the slot-boundary content obeys X(t+1) = X(t) - D(t) + A(t) with the departure resolved first, giving
P(z) = p_0 S (z-1) A(z) / ( z - A(z)(S+(1-S)z) ), p_0 = 1 - LAMBDA/S
- and, on differentiating at z = 1,
E[N] = LAMBDA + ( A E[X(X-1)]/2 + LAMBDA(1-S) ) / (S - LAMBDA)
The batch enters only through its first two factorial moments. For the geometric batch, E[X] = 1/BETA and E[X(X-1)] = 2(1-BETA)/BETA^2. At BETA = 1 the batch is always a single job and the result equals QSYS_GEOGEO1.
- Returns a struct with fields:
convention - Observation epoch used, ‘LAS_DA’ or ‘EAS’ batchArrivalProb - Per-slot probability that a batch arrives, A batchMean - Mean batch size E[X] batchSecondFactorialMoment - E[X(X-1)] serviceProb - Per-slot service completion probability S arrivalRate - Jobs arriving per slot, LAMBDA = A E[X] throughput - Departures per slot, LAMBDA utilization - Fraction of slots with the server serving, LAMBDA/S boundaryEmptyProb - Empty probability AT THE SLOT BOUNDARY, 1 - LAMBDA/S meanQueueLength - Mean number of jobs in the system meanWaitingQueue - Mean number of jobs waiting, i.e. not in service meanSojournTime - Mean sojourn time in slots, per job (not per batch) meanWaitingTime - Mean waiting time in slots, per job meanServiceTime - Mean service time, 1/S under LAS_DA, (1-S)/S under EAS pgf - Function handle P(z, Az) taking the slot-arrival pgf
value A(z) at the same z; defined for 0 < z <= 1
analyzer - Identifier string
No pmf is returned: for a general batch law the stationary distribution has no elementary closed form, so only the generating function is exact. Likewise BOUNDARYEMPTYPROB is deliberately epoch independent; the empty probability at the EAS epoch is p_0 + S p_1 and has no elementary form.
Examples
r = dqsys_geoxgeo1(0.1, 0.5, 0.9); % lambda = 0.2 r.arrivalRate % 0.2 r.meanQueueLength % 0.5143
Reference: H. Daduna, Queueing Networks with Discrete Time Scale, LNCS 2046, Springer 2001, chapter 6 for the discrete-time batch framework; the single-node pgf above is the standard discrete-time M/G/1-type derivation.
See also
QSYS_GEOGEO1,QSYS_MXM1Copyright (c) 2012-2026, Imperial College London All rights reserved.
- dqsys_geogeo1(a, s, convention)
QSYS_GEOGEO1 Exact closed-form analysis of a discrete-time Geo/Geo/1 queue.
- RESULT = QSYS_GEOGEO1(A, S) analyzes a slotted single-server queue with:
A - per-slot arrival probability (0 < A < S) S - per-slot service completion probability (0 < S <= 1)
RESULT = QSYS_GEOGEO1(A, S, CONVENTION) selects the observation epoch, ‘LAS_DA’ (default) or ‘EAS’. Time advances in slots of unit length. In each slot an arrival occurs with probability A and, if the server is engaged, a service completion occurs with probability S, independently of everything else. The system content at slot boundaries is a discrete birth-death chain whose stationary distribution is geometric.
The two conventions are not two systems. They are one system, Daduna’s LA-rule (events at the end of their slot) with the D/A-rule (departure resolved before arrival), observed at two instants. With X(t+1) = X(t) - D(t) + A(t), ‘LAS_DA’ is the law of X, taken after both events, and ‘EAS’ is the law of Y(t) = X(t) - D(t), taken after the departure and before the arrival. They are one departure apart, so the mean contents differ by exactly A and, by Little’s law, the sojourn times by one slot. The queueing delay is the same under both.
- With rho = A/S and r = A(1-S)/(S(1-A)):
- LAS_DA: p_0 = 1-rho, p_n = (1-rho) rho/(1-A) r^(n-1), n >= 1
E[N] = A(1-A)/(S-A), E[T] = (1-A)/(S-A)
- EAS: p_n = (1-r) r^n, n >= 0
E[N] = A(1-S)/(S-A), E[T] = (1-S)/(S-A)
Both give U = rho, X = A and E[W] = A(1-S)/(S(S-A)).
- Returns a struct with fields:
convention - Observation epoch used, ‘LAS_DA’ or ‘EAS’ arrivalProb - Per-slot arrival probability A serviceProb - Per-slot service completion probability S utilization - Fraction of slots with the server serving, A/S throughput - Departures per slot, A emptyProb - Probability the system is empty at the epoch ratio - Geometric decay ratio of the queue-length tail, r meanQueueLength - Mean number of jobs in the system meanWaitingQueue - Mean number of jobs waiting, i.e. not in service meanSojournTime - Mean sojourn time in slots meanWaitingTime - Mean waiting time in slots (epoch independent) meanServiceTime - Mean service time, 1/S under LAS_DA, (1-S)/S under EAS pmf - Function handle p(n) for the stationary queue length analyzer - Identifier string
Examples
r = dqsys_geogeo1(0.2, 0.5); r.meanQueueLength % 0.5333 r.meanSojournTime % 2.6667 r.pmf(0) % 0.6
Reference: H. Daduna, Queueing Networks with Discrete Time Scale, LNCS 2046, Springer 2001, corollary 2.7 (the LAS_DA branch reproduces it term for term with b = A, p = S, c = 1-A, q = 1-S).
See also
QSYS_GEOXGEO1,QSYS_MM1Copyright (c) 2012-2026, Imperial College London All rights reserved.
- dqsys_bernoulli1(b, p, L)
DQSYS_BERNOULLI1 Exact analysis of a state dependent Bernoulli server.
RESULT = DQSYS_BERNOULLI1(B, P) analyzes the discrete-time single-server queue of Daduna (2001), chapter 2, with an unbounded buffer:
B - per-slot arrival probability, scalar b, or vector with B(n+1)=b(n) P - per-slot service completion probability, scalar p, or vector with
P(n)=p(n) for n = 1,2,…
RESULT = DQSYS_BERNOULLI1(B, P, L) caps the buffer at L jobs. Arrivals in a slot that finds L jobs present are lost, which is the loss system of corollary 2.8. An unbounded buffer requires scalar B and P with B < P.
Time advances in slots. In the slot starting at t with n jobs present, the job in service departs with probability p(n) and an arrival occurs with probability b(n), independently; both are recorded at the end of the slot with the departure resolved first (Daduna’s LA rule and D/A rule). The queue length at slot boundaries is a discrete birth-death chain with
- pi(n) = [prod_{m=0}^{n-1} b(m) / prod_{m=0}^{n} c(m)]
[prod_{m=1}^{n-1} q(m) / prod_{m=1}^{n} p(m)] / H,
c = 1-b and q = 1-p, which is theorem 2.3 (and corollary 2.8 once b(n)=0 above the capacity). For constant b and p it collapses to the Geo/Geo/1 law of DQSYS_GEOGEO1 under the LAS_DA convention.
The distribution seen by an arriving customer, with himself not counted, is theorem 2.11,
- pi_1(n) = [prod_{m=0}^{n} b(m) / prod_{m=0}^{n+1} c(m)]
[prod_{m=1}^{n} q(m) / prod_{m=1}^{n} p(m)] / H_1,
and is returned in ARRIVALPMF. It is not the time-stationary law: discrete time has no PASTA analogue, and the two laws differ even when the arrival stream is a state independent Bernoulli process. For that state independent case pi_1 is exactly the EAS-convention queue length law of DQSYS_GEOGEO1, geometric with ratio r = b(1-p)/(p(1-b)).
- Returns a struct with fields:
capacity - Buffer capacity, Inf when unbounded arrivalProb - Offered per-slot arrival probability, b(n) serviceProb - Per-slot service completion probability, p(n) pmf - Time-stationary queue length law, index n+1 holds pi(n) arrivalPmf - Arrival queue length law of theorem 2.11 emptyProb - pi(0) utilization - Fraction of slots with the server busy, 1 - pi(0) throughput - Carried departures per slot lossProb - Fraction of offered arrivals lost, 0 when unbounded meanQueueLength - Mean number of jobs in the system meanWaitingQueue - Mean number of jobs waiting, i.e. not in service meanSojournTime - Mean sojourn time in slots, by Little’s law meanWaitingTime - Mean waiting time in slots normConst - Normalizing constant H of theorem 2.3 analyzer - Identifier string
Examples
r = dqsys_bernoulli1(0.2, 0.5); % Geo/Geo/1 r.meanQueueLength % 0.5333 r = dqsys_bernoulli1(0.2, 0.5, 4); % Geo/Geo/1/4 loss system r.lossProb r = dqsys_bernoulli1(0.6, 0.3*min(1:20,3), 20); % example 2.10, s = 3
Reference: H. Daduna, Queueing Networks with Discrete Time Scale, LNCS 2046, Springer 2001, theorem 2.3, corollaries 2.7 and 2.8, example 2.10 and theorem 2.11.
See also
DQSYS_GEOGEO1,DQSYS_GEOXGEO1,DPFQN_NCCopyright (c) 2012-2026, Imperial College London All rights reserved.