1function estVal = estimator_erps(self,
nodes)
4% DES_ERPS implements the ERPS demand estimation method
5%
RT: response times samples.
6% column vector with all response time samples
7% CLASS: class of the request samples
8% column vector with the class of each sample
9% QL: queue length samples
10% matrix with R columns containing the number of jobs
11% of each class observed by each sample
12% NCORES: number of cores
14% Copyright (c) 2012-2024, Imperial College London
18sn = self.model.getStruct;
20if node.schedStrategy ~= SchedStrategy.PS
21 error(
'The ERPS method is available only for processor sharing stations.');
24nodeId = self.model.getNodeIndex(node);
26% obtain per
class metrics
29 avgRespT{r} = self.getRespT(node, self.model.classes{r});
30 arvlEvent = Event(EventType.ARV, node, self.model.classes{r}); %
class-r arrival at node
31 avgAQLen{r} = self.getAggrQLen(node, arvlEvent); % aggregate queue-length
33 if isempty(avgRespT{r})
34 error(
'Response time data for node %d in class %d is missing.', self.model.getNodeIndex(node), r);
36 avgRespT{r} = avgRespT{r}.data;
38 if isempty(avgAQLen{r})
39 error(
'Arrival queue-length data for node %d in class %d is missing.', self.model.getNodeIndex(node), r);
41 avgAQLen{r} = avgAQLen{r}.data;
44 error(
'Arrival queue-length cannot be less than 1 as it must include the arriving job.');
48% estimate average number of busy cores
49busyCores = sum(avgAQLen{1,1},2);
51 busyCores = [busyCores;sum(avgAQLen{1,r},2)];
53avgBusyCores = min(mean(busyCores), node.getNumberOfServers);
56% regression analysis to estimate mean demands
58 respTimes = avgRespT{1,r};
59 totalQL = sum(avgAQLen{1,r},2)/avgBusyCores;
60 estVal(r) = lsqnonneg(totalQL, respTimes)
';