LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
estimator_erps.m
1function estVal = estimator_erps(self, nodes)
2node = nodes{1};
3% (rt,class,ql,nCores)
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
13%
14% Copyright (c) 2012-2024, Imperial College London
15% All rights reserved.
16
17%%
18sn = self.model.getStruct;
19
20if node.schedStrategy ~= SchedStrategy.PS
21 error('The ERPS method is available only for processor sharing stations.');
22end
23
24nodeId = self.model.getNodeIndex(node);
25
26% obtain per class metrics
27R = sn.nclasses;
28for r=1:R
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
32
33 if isempty(avgRespT{r})
34 error('Response time data for node %d in class %d is missing.', self.model.getNodeIndex(node), r);
35 else
36 avgRespT{r} = avgRespT{r}.data;
37 end
38 if isempty(avgAQLen{r})
39 error('Arrival queue-length data for node %d in class %d is missing.', self.model.getNodeIndex(node), r);
40 else
41 avgAQLen{r} = avgAQLen{r}.data;
42 end
43 if min(avgAQLen{r})<1
44 error('Arrival queue-length cannot be less than 1 as it must include the arriving job.');
45 end
46end
47
48% estimate average number of busy cores
49busyCores = sum(avgAQLen{1,1},2);
50for r = 2:R
51 busyCores = [busyCores;sum(avgAQLen{1,r},2)];
52end
53avgBusyCores = min(mean(busyCores), node.getNumberOfServers);
54
55estVal = zeros(1,R);
56% regression analysis to estimate mean demands
57for r=1:R
58 respTimes = avgRespT{1,r};
59 totalQL = sum(avgAQLen{1,r},2)/avgBusyCores;
60 estVal(r) = lsqnonneg(totalQL, respTimes)';
61end
62estVal = estVal(:)';
63end
Definition mmt.m:124