1function model = infer_lqn_setparams(model, paramSpec, a)
2% INFER_LQN_SETPARAMS Apply a parameter vector to a LayeredNetwork.
4% MODEL = INFER_LQN_SETPARAMS(MODEL, PARAMSPEC, A) sets
the LQN parameters
5% named in PARAMSPEC to
the values in
the vector A, in place, and returns
6%
the (same handle) MODEL. This
is the parameter-injection half of
the LQN
7% parameter identification method (see INFER_LQN).
9% PARAMSPEC
is a
struct array; PARAMSPEC(i) has fields:
10% .type :
'hostdem' (activity mean host demand) or
11%
'think' (task mean think time)
12% .name : name of
the activity (
'hostdem') or task ('think')
14% Mean values are injected as exponential distributions (SCV = 1), which
is
15%
the assumption of
the CASCON 2005 tracking method. The cached layered
16% struct (MODEL.lsn)
is invalidated so
the next getStruct/solve re-reads
the
17% mutated model objects.
19% Copyright (c) 2012-2026, Imperial College London
24 line_error(mfilename, 'Length of parameter vector does not match paramSpec.');
29 switch lower(paramSpec(i).type)
31 act = infer_lqn_findbyname(model.activities, paramSpec(i).name);
33 line_error(mfilename, sprintf('Activity ''%s'' not found.', paramSpec(i).name));
35 act.setHostDemand(val);
37 tsk = infer_lqn_findbyname(model.tasks, paramSpec(i).name);
39 line_error(mfilename, sprintf('Task ''%s'' not found.', paramSpec(i).name));
41 tsk.setThinkTime(val);
43 line_error(mfilename, sprintf('Unknown parameter type ''%s''.', paramSpec(i).type));
47% invalidate
the cached layered struct so
the next solve re-reads
the objects