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, r) = DropStrategy for class r in region f
23 sn.regionrule = DropStrategy.DROP * ones(F, K); % Default to drop
24 % regionweight(f, r) = class weight for class r in region f
25 sn.regionweight = ones(F, K); % Default weight = 1.0
26 % regionsz(f, r) = class size/memory for class r in region f
27 sn.regionsz = ones(F, K); % Default size = 1
28 % regionLinConA{f}/regionLinConb{f} = linear constraint matrices
for region f
29 sn.regionLinConA = cell(F, 1);
30 sn.regionLinConb = cell(F, 1);
33 fcr = self.regions{f};
34 % Matrix with M rows (stations) and K+1 columns (K
classes + 1 global)
35 regionMatrix = -1 * ones(M, K + 1); % Initialize all to infinite (-1)
37 % Find which stations are in
this region and set their capacities
38 for n = 1:length(fcr.nodes)
41 if self.stations{i} == node
42 % Set per-
class max jobs for this station in this region
43 % fcr.classMaxJobs
is an
array indexed by
class index
45 regionMatrix(i, r) = fcr.classMaxJobs(r);
47 % Set global max jobs
for this station in
this region (column K+1)
48 regionMatrix(i, K + 1) = fcr.globalMaxJobs;
54 % Extract drop rule for each class in this region
56 % fcr.dropRule
is a DropStrategy
array indexed by class index
57 sn.regionrule(f, r) = fcr.dropRule(r);
60 % Extract class weights and sizes for this region
62 sn.regionweight(f, r) = fcr.classWeight(r);
63 sn.regionsz(f, r) = fcr.classSize(r);
66 sn.region{f} = regionMatrix;
68 % Capture linear-constraint matrices
if the region defines them
69 if ismethod(fcr,
'hasLinearConstraints') && fcr.hasLinearConstraints()
70 sn.regionLinConA{f} = fcr.getConstraintA();
71 sn.regionLinConb{f} = fcr.getConstraintB();
80 sn.regionLinConA = {};
81 sn.regionLinConb = {};