1function sn = refreshRegions(self)
2% SN = REFRESHREGIONS() Populate finite capacity region information in sn struct
4% Copyright (c) 2012-2026, Imperial College London
7% Extract finite capacity region information
8% region
is a cell array of size F (number of regions)
9% region{f}
is Matrix(M, K+1) where:
10% entry (i,r) = max jobs of class r at station i in region f
11% entry (i,K+1) = global max jobs at station i in region f
12% -1 = infinite capacity
14if ~isempty(self.regions)
15 F = length(self.regions);
17 sn.region = cell(F, 1);
22 % regionrule(f) = DropStrategy for region f
23 sn.regionrule = DropStrategy.DROP * ones(F, 1); % Default to drop
26 fcr = self.regions{f};
27 % Matrix with M rows (stations) and K+1 columns (K
classes + 1 global)
28 regionMatrix = -1 * ones(M, K + 1); % Initialize all to infinite (-1)
30 % Find which stations are in
this region and set their capacities
31 for n = 1:length(fcr.nodes)
34 if self.stations{i} == node
35 % Set per-
class max jobs for this station in this region
36 % fcr.classMaxJobs
is an array indexed by
class index
38 regionMatrix(i, r) = fcr.classMaxJobs(r);
40 % Set global max jobs
for this station in
this region (column K+1)
41 regionMatrix(i, K + 1) = fcr.globalMaxJobs;
47 % Extract drop rule for this region (must be same for all
classes)
49 % fcr.dropRule
is a
boolean array indexed by class index
50 % true = DROP, false = WAITQ
51 firstDropRule = fcr.dropRule(1);
52 % Verify all
classes have the same drop rule
54 if fcr.dropRule(r) ~= firstDropRule
55 line_error(mfilename, 'Finite capacity region has different drop rules for different
classes. All
classes must have the same drop rule in a region.');
59 sn.regionrule(f) = DropStrategy.DROP;
61 sn.regionrule(f) = DropStrategy.WAITQ;
65 sn.region{f} = regionMatrix;