1function [Q,U,R,T,C,X,lG,runtime,iter,method] = solver_nc_lossn_analyzer(sn, options)
2% SOLVER_NC_LOSSN_ANALYZER Analyzes open loss networks with FCR
using Erlang FP
4% This analyzer handles open queueing networks with a single multiclass
5% Delay node inside a Finite Capacity Region (FCR) with DROP policy.
6% It uses the Erlang fixed-point approximation
for loss networks.
9K = sn.nclasses; % number of
classes
12line_debug(
'NC loss network analyzer starting: method=%s, nstations=%d, nclasses=%d', options.method, M, K);
14% 1. Extract arrival rates from Source
17 sourceIdx = sn.refstat(r);
18 nu(r) = sn.rates(sourceIdx, r); % arrival rate
21% 2. Find delay station in FCR and extract constraints
22regionMatrix = sn.region{1};
23stationsInFCR = find(any(regionMatrix(:,1:end-1) >= 0, 2) | regionMatrix(:,end) >= 0);
24delayIdx = stationsInFCR(1);
26globalMax = regionMatrix(delayIdx, K+1);
27classMax = regionMatrix(delayIdx, 1:K);
29% Handle unbounded constraints (replace -1 with large value
for Erlang)
33classMax(classMax < 0) = 1e6;
35% 3. Build A matrix (J x K) where J = K+1 links
36% Link 1: global constraint (all
classes contribute)
37% Links 2..K+1: per-
class constraints (only class r contributes to link r+1)
40A(1, :) = 1; % global link: all
classes contribute
42 A(r+1, r) = 1; % per-
class link: only class r contributes
45% 4. Build C vector (J x 1)
48C_vec(2:end) = classMax(:);
50% 5. Call lossn_erlangfp
51[QLen, Loss, E, niter] = lossn_erlangfp(nu, A, C_vec);
53% 6. Convert to standard outputs
59% At delay node: QLen
is effective throughput (after loss)
61 T(delayIdx, r) = QLen(r); % effective throughput = arrival rate * (1-loss)
62 mu_r = sn.rates(delayIdx, r); % service rate at delay
63 Q(delayIdx, r) = QLen(r) / mu_r; % Little's law: Q = X * S
64 R(delayIdx, r) = 1 / mu_r; % response time = service time (infinite server)
65 U(delayIdx, r) = T(delayIdx, r) / mu_r; % "utilization" for delay
68X = QLen(:)'; % system throughput per class (row vector)
69C = zeros(1, K); % cycle time not applicable
70lG = NaN; % no normalizing constant for loss networks