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
30 fcr = self.regions{f};
31 % Matrix with M rows (stations) and K+1 columns (K
classes + 1 global)
32 regionMatrix = -1 * ones(M, K + 1); % Initialize all to infinite (-1)
34 % Find which stations are in
this region and set their capacities
35 for n = 1:length(fcr.nodes)
38 if self.stations{i} == node
39 % Set per-
class max jobs for this station in this region
40 % fcr.classMaxJobs
is an array indexed by
class index
42 regionMatrix(i, r) = fcr.classMaxJobs(r);
44 % Set global max jobs
for this station in
this region (column K+1)
45 regionMatrix(i, K + 1) = fcr.globalMaxJobs;
51 % Extract drop rule for each class in this region
53 % fcr.dropRule
is a DropStrategy array indexed by class index
54 sn.regionrule(f, r) = fcr.dropRule(r);
57 % Extract class weights and sizes for this region
59 sn.regionweight(f, r) = fcr.classWeight(r);
60 sn.regionsz(f, r) = fcr.classSize(r);
63 sn.region{f} = regionMatrix;