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 if isa(distr,
'MarkedMAP') && ~isempty(station_i.markedClasses) && ismember(r, station_i.markedClasses)
57 % Marked arrival:
class r receives only
the
58 % mark-k stream; its marginal MAP moves
the
59 % other marks
' transitions into the hidden part
61 k = find(station_i.markedClasses == r, 1);
62 marginals = distr.toMAPs(k);
63 rates(i,r) = marginals{1}.getRate();
64 scv(i,r) = marginals{1}.getSCV();
66 rates(i,r) = distr.getRate();
67 scv(i,r) = distr.getSCV();
81 if ~hasOpenClasses || i ~= self.getIndexSourceStation
82 if isempty(station_i.server.serviceProcess{r})
86 distr = station_i.server.serviceProcess{r}{end};
87 rates(i,r) = distr.getRate();
88 scv(i,r) = distr.getSCV();
96 if any((abs(rates-rates_orig)>0))
97 hasRateChanged = true;
102 if any((abs(scv-scv_orig)>0))
103 hasSCVChanged = true;
109 self.sn.rates = rates;