1function [rates, scv, hasRateChanged, hasSCVChanged] = refreshRates(self, statSet, classSet)
2% [RATES, SCV] = REFRESHRATES()
4% Copyright (c) 2012-2026, Imperial College London
9M = getNumberOfStations(self);
10K = getNumberOfClasses(self);
16 hasRateChanged =
true;
20 if isempty(self.sn) || isempty(self.sn.rates)
23 hasRateChanged = true;
26 rates = self.sn.rates;
28 rates_orig = self.sn.rates;
29 scv_orig = self.sn.scv;
31elseif nargin==3 % this
is used only to update self.sn
32 % we are only updating selected stations and
classes so use the
33 % existing ones for the others
34 rates = self.sn.rates;
36 rates_orig = self.sn.rates;
37 scv_orig = self.sn.scv;
39hasOpenClasses = self.hasOpenClasses;
41stations = self.stations;
44 station_i = stations{i};
46 switch station_i.server.className
49 switch class(station_i)
51 if isempty(station_i.input.sourceClasses{r})
55 distr = station_i.input.sourceClasses{r}{end};
56 rates(i,r) = distr.getRate();
57 scv(i,r) = distr.getSCV();
70 if ~hasOpenClasses || i ~= self.getIndexSourceStation
71 if isempty(station_i.server.serviceProcess{r})
75 distr = station_i.server.serviceProcess{r}{end};
76 rates(i,r) = distr.getRate();
77 scv(i,r) = distr.getSCV();
85 if any((abs(rates-rates_orig)>0))
86 hasRateChanged = true;
91 if any((abs(scv-scv_orig)>0))
98 self.sn.rates = rates;