LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
estimator_gibbs.m
1function estVal = estimator_gibbs(self, nodes)
2node = nodes{1};
3% ESTIMATORGIBBS Gibbs Sampling estimation from trace-level data
4% Estimates service demands using Gibbs sampling on arrival timestamps,
5% response times, and throughput data. Requires trace-format
6% SampledMetric objects.
7%
8% Copyright (c) 2012-2026, Imperial College London
9% All rights reserved.
10% This code is released under the 3-Clause BSD License.
11
12sn = self.model.getStruct;
13R = sn.nclasses;
14nbCores = node.getNumberOfServers();
15
16% build legacy data cell array for infer_gibbs()
17% data format: data{3,k} = arrival timestamps (ms), data{4,k} = response
18% times (s), data{6,k} = throughput
19data = cell(6, R + 1);
20
21for r = 1:R
22 jc = self.model.classes{r};
23
24 % arrival timestamps (trace format)
25 arvData = self.getArvR(node, jc);
26 if isempty(arvData)
27 error('Arrival rate/timestamp data for node %s in class %d is missing.', node.name, r);
28 end
29 if arvData.isTrace()
30 data{3, r} = arvData.data * 1000; % convert to ms
31 else
32 error('Gibbs estimator requires trace-format arrival data. Use setTrace() on the SampledMetric.');
33 end
34
35 % response times (trace format)
36 rtData = self.getRespT(node, jc);
37 if isempty(rtData)
38 error('Response time data for node %s in class %d is missing.', node.name, r);
39 end
40 if rtData.isTrace()
41 data{4, r} = rtData.data;
42 else
43 error('Gibbs estimator requires trace-format response time data. Use setTrace() on the SampledMetric.');
44 end
45
46 % throughput
47 tputData = self.getTput(node, jc);
48 if isempty(tputData)
49 error('Throughput data for node %s in class %d is missing.', node.name, r);
50 end
51 data{6, r} = tputData.data;
52end
53
54tol = self.options.tol;
55estVal = infer_gibbs(data, nbCores, tol);
56estVal = estVal(:)';
57
58end
Definition mmt.m:124