api.polling
- polling_pcl(arvMAPs, svcMAPs, switchMAPs, disc)
[LHSW,RHS,PCL]=POLLING_PCL(ARVMAPS,SVCMAPS,SWITCHMAPS,DISC)
Pseudo-conservation law of a cyclic polling system with Poisson arrivals (Boxma and Groenendijk 1987; Takagi, ACM Computing Surveys, Vol. 20, No. 1, March 1988, eq (10)). The law is exact for any mix of exhaustive, gated, 1-limited and decrementing queues and reads
SUM_i LHSW(i) * E[W_i] = RHS
where E[W_i] is the mean waiting time (excluding service) of queue i.
DISC is a cell array (or a single PollingType id applied to all queues) of per-queue disciplines: PollingType.EXHAUSTIVE, PollingType.GATED, PollingType.KLIMITED with K=1 (1-limited), PollingType.GLIMITED with K=1 (identical to 1-limited) and PollingType.DECREMENTING. Limited service with K>1 has no pseudo-conservation law of this form and is refused. A disc entry may also be the character ‘E’,’G’,’L’ or ‘D’.
- Weights LHSW(i): E,G: rho_i; L: rho_i*(1-lambda_i*R/(1-rho));
D: rho_i*(1-lambda_i*(1-rho_i)*R/(1-rho)).
PCL is RHS/SUM(LHSW), the workload-weighted mean waiting time when all weights are rho_i. A candidate solution W can be checked by abs(LHSW*W(:)-RHS).
Each entry of arvMAPs, svcMAPs and switchMAPs may also be a numeric moment vector instead of a MAP: lambda_i, [E[S_i] E[S_i^2]] and [E[R_i] Var[R_i]] respectively (see private/polling_moments.m).
Example: [w,r]=polling_pcl({0.2,0.3},{[1 2],[0.5 0.5]},{[0.3 0.09],[0.5 0.25]},PollingType.EXHAUSTIVE)
- polling_qsys_klimited(arvMAPs, svcMAPs, switchMAPs, K)
W=polling_qsys_klimited(arvMAPs,svcMAPs,switchMAPs,K)
Approximate mean waiting time of a cyclic polling system with open arrivals in which queue i is served K_i-limited: a visit ends after K_i services or when the queue empties, whichever comes first (arrivals during the visit are eligible, as in SolverCTMC’s KLIMITED discipline).
K is a scalar (the same limit at every queue) or a vector with one positive integer per queue. The approximation is Fuhrmann’s bound for symmetric k-limited systems (Haverkort, eq. 9.27; Takagi 1988, eq. 27),
E[W_i] + b_i = (1-rho) / (1 - rho - lambda_i*R/K_i) * (E[W_i^E] + b_i),
applied queue by queue, where E[W_i^E] is the EXACT exhaustive mean waiting time of the same system (polling_qsys_exhaustive) and R the mean total switchover time per cycle. In the symmetric case it is exact for K=1 (Takagi eq. 25) and as K grows to infinity (Takagi eq. 14), and so tight in between that Haverkort recommends it as an approximation. For an asymmetric system it is the same queue-by-queue scaling; polling_qsys_1limited (Boxma-Meister) remains the dedicated approximation for K=1.
Stability requires rho + lambda_i*R/K_i < 1 at every queue.
Each entry of arvMAPs, svcMAPs and switchMAPs may also be a numeric moment vector instead of a MAP: lambda_i, [E[S_i] E[S_i^2]] and [E[R_i] Var[R_i]] respectively (see private/polling_moments.m).
Example: W=polling_qsys_klimited({map_exponential(1/0.3),map_exponential(1/0.3)},{map_exponential(1),map_exponential(1)},{map_exponential(1),map_exponential(1)},2)
- polling_qsys_gated(arvMAPs, svcMAPs, switchMAPs)
W=polling_qsys_gated(arvMAPs,svcMAPs,switchMAPs)
Exact mean waiting time solution of a polling system with open arrivals. All queues use gated service.
Takagi, ACM Computing Surveys, Vol. 20, No. 1, March 1988, eq (20)
Each entry of arvMAPs, svcMAPs and switchMAPs may also be a numeric moment vector instead of a MAP: lambda_i, [E[S_i] E[S_i^2]] and [E[R_i] Var[R_i]] respectively (see private/polling_moments.m).
Example: W=polling_qsys_gated({map_exponential(1/0.6),map_exponential(1/0.2)},{map_exponential(1),map_exponential(1)},{map_exponential(1),map_exponential(1)})
- polling_qsys_exhaustive(arvMAPs, svcMAPs, switchMAPs)
W=polling_qsys_exhaustive(arvMAPs,svcMAPs,switchMAPs)
Exact mean waiting time solution of a polling system with open arrivals. All queues use exhaustive service.
Takagi, ACM Computing Surveys, Vol. 20, No. 1, March 1988, eq (15)
Each entry of arvMAPs, svcMAPs and switchMAPs may also be a numeric moment vector instead of a MAP: lambda_i, [E[S_i] E[S_i^2]] and [E[R_i] Var[R_i]] respectively (see private/polling_moments.m).
Example: W=polling_qsys_exhaustive({map_exponential(1/0.6),map_exponential(1/0.2)},{map_exponential(1),map_exponential(1)},{map_exponential(1),map_exponential(1)})
- polling_qsys_decrementing(arvMAPs, svcMAPs, switchMAPs)
W=polling_qsys_decrementing(arvMAPs,svcMAPs,switchMAPs)
Mean waiting time solution of a polling system with open (Poisson) arrivals and decrementing (semiexhaustive) service. The server serves a queue until the number of jobs present drops to one less than the number found at the polling instant.
Pittel (1973); Takagi (1984). See Takagi, ACM Computing Surveys, Vol. 20, No. 1, March 1988, eq (28). No exact closed form for the individual E[W_i] is known for asymmetric decrementing systems. There an approximation is returned: E[W_i] = c*f_i with f_i = (1-rho_i)/(1-rho-lambda_i*(1-rho_i)*R), R the total switchover time, and c chosen so that the W satisfy the exact pseudo-conservation law (Takagi 1988, eq (10); see polling_pcl). The approximation is exact for symmetric systems; against the exact CTMC of two- and three-queue exponential systems its error was within about 15%.
Each entry of arvMAPs, svcMAPs and switchMAPs may also be a numeric moment vector instead of a MAP: lambda_i, [E[S_i] E[S_i^2]] and [E[R_i] Var[R_i]] respectively (see private/polling_moments.m).
Example: W=polling_qsys_decrementing({map_exponential(1/0.4),map_exponential(1/0.4)},{map_exponential(1),map_exponential(1)},{map_exponential(0.1),map_exponential(0.1)})
- polling_qsys_table(arvMAPs, svcMAPs, switchMAPs, table, discipline)
[W, EX, EX2] = polling_qsys_table(arvMAPs,svcMAPs,switchMAPs,table,discipline)
Exact mean waiting time of a polling system with open Poisson arrivals and a general POLLING TABLE (Haverkort section 9.1.2): the server visits the queues in the order table(1), table(2), …, table(M), table(1), …, every queue appearing at least once and possibly several times. All queues are served exhaustively or all gated.
table row of queue indices, e.g. [1 2 1 3]. discipline ‘exhaustive’ or ‘gated’ (or a PollingType id). switchMAPs one entry PER TABLE POSITION: the switchover of the leg from
position m to position m+1 (the last one closing the cycle).
Method (buffer occupancy, Eisenberg 1972): the first and second moments of the queue lengths at the polling instants obey an affine recursion over the table positions. At the polling instant of position m (queue q) the visit lasts the sum of X_q independent periods Y (a busy period of queue q under exhaustive service, a service time under gated), the other queues receive Poisson arrivals during it, and the switchover that follows adds Poisson arrivals at every queue. Composing the M steps gives a linear system of dimension n+n^2 whose solution is the cycle-stationary moment vector; it is then propagated to every position. The waiting time follows from the intervisit (exhaustive) or cycle (gated) moments E[I^2] = E[X(X-1)]/lambda^2 pooled over the visits of the queue, by length biasing:
exhaustive W_i = lambda_i b2_i/(2(1-rho_i)) + sum_m E[X_i(X_i-1)]_m / (2 lambda_i sum_m E[X_i]_m) gated W_i = (1+rho_i) sum_m E[X_i(X_i-1)]_m / (2 lambda_i sum_m E[X_i]_m)
the sums running over the positions m of queue i. For table = 1:n this is the classical cyclic system (Takagi 1988, eqs. 15 and 21).
EX(m,:) and EX2{m} return E[X] and E[X X’] at the polling instant of position m.
Each entry of arvMAPs, svcMAPs and switchMAPs may also be a numeric moment vector instead of a MAP: lambda_i, [E[S_i] E[S_i^2]] and [E[R_i] Var[R_i]] respectively (see private/polling_moments.m). Arrivals must be Poisson (a MAP is reduced to its rate).
Example: W=polling_qsys_table({0.2,0.1,0.1},{[1 2],[1 2],[1 2]},{[0.1 0.01],[0.1 0.01],[0.1 0.01],[0.1 0.01]},[1 2 1 3],’exhaustive’)
- mexify_polling
@brief MATLAB Coder script to generate MEX functions for polling_ module.
This script generates MEX (MATLAB Executable) versions of polling-system functions for improved performance.
- Skipped functions (Coder-incompatible):
- polling_qsys_1limited - Cell-array-of-MAPs arguments (each MAP is a
cell of two matrices), unsupported by Coder.
polling_qsys_exhaustive - Same: cell-array-of-MAPs arguments. polling_qsys_gated - Same: cell-array-of-MAPs arguments.
See also
CODER,CODER.CONFIG,CODER.TYPEOF,CODEGEN.
- polling_qsys_1limited(arvMAPs, svcMAPs, switchMAPs)
W=polling_qsys_1limited(arvMAPs,svcMAPs,switchMAPs)
Approximate mean waiting time solution of a polling system with open arrivals. All queues use 1-limited service.
Unlike the exhaustive and gated formulas of this package, no exact closed form is available for 1-limited service, so the result below is an approximation and can deviate by more than 10% from the exact solution (SolverCTMC, which supports arbitrary K).
O. J. Boxma and B. Meister. Waiting-time approximations for cyclic-service systems with switch-over times. SIGMETRICS /PERFORMANCE ‘86, page 254-262, New York, NY, USA, 1986.
Each entry of arvMAPs, svcMAPs and switchMAPs may also be a numeric moment vector instead of a MAP: lambda_i, [E[S_i] E[S_i^2]] and [E[R_i] Var[R_i]] respectively (see private/polling_moments.m).
Example: W=polling_qsys_1limited({map_exponential(1/0.6),map_exponential(1/0.2)},{map_exponential(1),map_exponential(1)},{map_exponential(1),map_exponential(1)})