LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
qsys_mmcc_retrial_fp.m
1function [blocProb, r, niter] = qsys_mmcc_retrial_fp(lambda, mu, c, tol, maxiter)
2% [blocProb, r, niter] = QSYS_MMCC_RETRIAL_FP(LAMBDA, MU, C, TOL, MAXITER)
3%
4% Fixed-point approximation for M/M/c/c retrial queues.
5%
6% Customers arrive at rate LAMBDA to a system with C servers, each with
7% service rate MU. Blocked customers join an orbit and retry. Under the
8% assumption that the retrial rate is small relative to the service rate,
9% the total arrival flow (fresh + retrial) is approximated by a Poisson
10% process with rate LAMBDA + r, where r satisfies the fixed-point equation:
11%
12% r = (lambda + r) * B(lambda/mu + r/mu, c)
13%
14% and B(a, c) is the Erlang-B blocking probability for offered load a and
15% c servers.
16%
17% INPUT:
18% lambda : arrival rate
19% mu : service rate per server
20% c : number of servers (= capacity, no waiting room)
21% tol : convergence tolerance (default: 1e-10)
22% maxiter : maximum iterations (default: 10000)
23%
24% OUTPUT:
25% blocProb : blocking probability (fraction of arrivals lost or retried)
26% r : additional arrival rate due to retrials
27% niter : number of iterations to converge
28%
29% REFERENCE:
30% Cohen (1957), fixed-point approximation for M/M/c/c retrial queues.
31% Phung-Duc, "Retrial Queueing Models: A Survey on Theory and
32% Applications", 2019, Eq. (1).
33
34if nargin < 4 || isempty(tol)
35 tol = 1e-10;
36end
37if nargin < 5 || isempty(maxiter)
38 maxiter = 10000;
39end
40
41r = 0;
42niter = 0;
43for iter = 1:maxiter
44 niter = iter;
45 a = (lambda + r) / mu; % offered load
46 b = ErlangB(a, c);
47 r_new = (lambda + r) * b;
48 if abs(r_new - r) < tol
49 r = r_new;
50 break;
51 end
52 r = r_new;
53end
54
55blocProb = ErlangB((lambda + r) / mu, c);
56end
57
58function B = ErlangB(a, c)
59% Erlang-B formula using the recursive method (numerically stable).
60% B(a, c) = blocking probability for offered load a and c servers.
61B = 1.0;
62for i = 1:c
63 B = a * B / (i + a * B);
64end
65end