1%{ @file lossn_erlangfp.m
2 % @brief Erlang fixed point approximation
for loss networks
4 % @author LINE Development Team
8 % @brief Computes performance metrics
for loss networks
using Erlang FP
11 % This function uses
the Erlang fixed point approximation to compute
12 % performance metrics
for loss networks. Calls on route r arrive according
13 % to Poisson rate nu_r with unit mean service times. Link capacity
14 % requirements are: sum_r A(j,r) n(j,r) <= C(j)
for all links j.
18 % [QLen, Loss, E, niter] = lossn_erlangfp(nu, A, C)
23 % <tr><th>Name<th>Description
24 % <tr><td>nu<td>Arrival rate of route (
class) r (1xR vector)
25 % <tr><td>A<td>Capacity requirement of link j for route r (JxR matrix)
26 % <tr><td>C<td>Available capacity of link j (Jx1 vector)
31 % <tr><th>Name<th>Description
32 % <tr><td>QLen<td>Mean queue-length for route r
33 % <tr><td>Loss<td>Loss probability for route r
34 % <tr><td>E<td>Blocking probability for link j
35 % <tr><td>niter<td>Number of iterations required for convergence
38function [QLen,Loss,E,niter] = lossn_erlangfp(nu,A,C)
39% [QLen,Loss,E] = LOSS_ERLANGFP(rho,A,C)
40% Erlang fixed point approximation for loss networks
42% Calls (i.e., jobs) on route (i.e., class) r arrive according to Poisson
43% rate nu_r, r=1..R. Call service times on route r have unit mean.
45% Link capacity requirements are:
46% \sum_r A(j,r) n(j,r) <= C(j)
47% for all links j=1..J, where n(j,r) counts
the calls on route r on link j.
50% nu (1xR): arv. rate of route (class) r = 1..R
51% A (J,R): capacity requirement of link j for route r = 1..R
52% C (J,1): available capacity of link j
55% Q (1xR): mean queue-length for route r = 1..R calls
56% L (1xR): loss probability for route r = 1..R calls
57% E (Jx1): blocking probability of for link j = 1..J
59% NOTE: nu_r may be replaced by a utilization rho_r=nu_r/mu_r, where mu_r
60%
is the service rate for route r.
65% Erlang fixed point on
the link blocking probabilities, driven by
the
66% generic DA successive-substitution driver
67fpopts = struct('iter_max', 10000, 'iter_tol', 1e-8);
68fpopts.config.da_norm = @(d) norm(d,1);
69fpopts.config.da_nanstop = true; % legacy while-loop exited on NaN measure
70[E, niter] = da_fpi(@efp_sweep, 0.5*ones(J,1), fpopts);
72 function [Enew, Eref] = efp_sweep(E_1, ~)
81 termj=termj*(1-E_1(i))^A(i,r);
84 rhoj_1 = rhoj_1 + termj;
87 rhoj_1 = rhoj_1 / (1-E_1(j));
88 Enew(j) = ErlangB(rhoj_1,C(j));
95 QLen(r) = QLen(r)*(1-E(j))^A(j,r);
99Loss = 1 - QLen./nu; % blocking probability = 1 - carried/offered
102function blockProb = ErlangB(nu,C)
104% blockProb = E(nu,C) = (nu^C/C!) / (sum_{i=1}^C nu^i/i!)
107 d = i*log(nu)-factln(i);
110blockProb = C*log(nu) -factln(C) -log(den);
111blockProb = exp(blockProb);