LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
getAvgLossTable.m
1function LossTable = getAvgLossTable(self)
2% LOSSTABLE = GETAVGLOSSTABLE()
3%
4% Table of loss (drop) metrics for every station-class pair that receives
5% offered traffic. For each such pair it reports the offered arrival rate
6% (ArvR), the carried throughput (Tput), the loss rate (ArvR - Tput, i.e. the
7% rate of jobs dropped by finite capacity, blocking, or reneging) and the loss
8% ratio (LossRate / ArvR, the fraction of offered jobs that are lost).
9%
10% Only station-class pairs with ArvR > 0 are listed: the loss identity
11% LossRate = ArvR - Tput holds where a class is actually offered to a station,
12% and it excludes the Source, whose offered arrival rate is zero. A lossless
13% station has ArvR = Tput and therefore LossRate = LossRatio = 0.
14%
15% See also NetworkSolver.getAvgTable, NetworkSolver.getAvg
16%
17% Copyright (c) 2012-2026, Imperial College London
18% All rights reserved.
19
20[~,~,~,TN,AN] = self.getAvg();
21sn = self.model.getStruct();
22
23% Fork-Join quorum sibling-drop rate (LDES only), station-indexed. At a
24% synchronizing Join the identity LossRate = ArvR - Tput does not hold (Tput is
25% in parent units, discarded siblings in sibling units), so on Join rows the
26% explicit drop rate replaces ArvR - Tput. ArvR is already the offered sibling
27% rate (flow balance over all forked siblings), so LossRatio = drop / ArvR.
28DropRateJoin = [];
29if isprop(self, 'result') && isstruct(self.result) && isfield(self.result, 'DropRateJoin')
30 DropRateJoin = self.result.DropRateJoin;
31end
32
33Station = {};
34JobClass = {};
35ArvR = [];
36Tput = [];
37LossRate = [];
38LossRatio = [];
39for ist = 1:size(AN,1)
40 for r = 1:size(AN,2)
41 a = AN(ist,r);
42 if ~(isfinite(a) && a > 0)
43 continue
44 end
45 t = TN(ist,r);
46 d = 0;
47 if ~isempty(DropRateJoin) && ist <= size(DropRateJoin,1) && r <= size(DropRateJoin,2)
48 d = DropRateJoin(ist,r);
49 end
50 if isfinite(d) && d > 0
51 lr = d;
52 lc = d / a;
53 else
54 lr = a - t;
55 lc = (a - t) / a;
56 end
57 Station{end+1,1} = sn.nodenames{sn.stationToNode(ist)}; %#ok<AGROW>
58 JobClass{end+1,1} = sn.classnames{r}; %#ok<AGROW>
59 ArvR(end+1,1) = a; %#ok<AGROW>
60 Tput(end+1,1) = t; %#ok<AGROW>
61 LossRate(end+1,1) = lr; %#ok<AGROW>
62 LossRatio(end+1,1) = lc; %#ok<AGROW>
63 end
64end
65
66LossTable = Table(Station, JobClass, ArvR, Tput, LossRate, LossRatio);
67LossTable = IndexedTable(LossTable);
68end