1function z = infer_lqn_getobs(names, metrics, obsSpec)
2% INFER_LQN_GETOBS Extract an observation vector from solved LQN metrics.
4% Z = INFER_LQN_GETOBS(NAMES, METRICS, OBSSPEC) returns
the column vector Z
5% of performance measures selected by OBSSPEC from
the per-element numeric
6% metric vectors in METRICS. This
is the measurement-model half of
the LQN
7% parameter identification method (see INFER_LQN): it maps a solved model to
8%
the observation vector z = h(a).
10% NAMES : cell array of element names, as in LayeredNetworkStruct.names.
11% METRICS : struct with fields QLen, Util, RespT, Tput (each a vector indexed
12% by element, aligned with NAMES, as returned by getEnsembleAvg).
13% OBSSPEC : struct array; OBSSPEC(i) has fields:
14% .metric :
'RespT' |
'Util' |
'Tput' |
'QLen'
15% .name : element name (processor
for utilization; entry or reference
16% task
for response time; entry/task
for throughput)
18% Copyright (c) 2012-2026, Imperial College London
24 idx = find(strcmp(names, obsSpec(i).name), 1);
26 line_error(mfilename, sprintf(
'Element ''%s'' not found in the LQN.', obsSpec(i).name));
28 switch lower(obsSpec(i).metric)
30 z(i) = metrics.RespT(idx);
32 z(i) = metrics.Util(idx);
34 z(i) = metrics.Tput(idx);
36 z(i) = metrics.QLen(idx);
38 line_error(mfilename, sprintf(
'Unknown metric ''%s''.', obsSpec(i).metric));