1function zt = lqn_act_thinktime(lqn, aidx)
2% ZT = LQN_ACT_THINKTIME(LQN, AIDX)
4% Think time of activity AIDX, zero when it has none.
6% An activity think time
is a delay in series with that activity
's host demand,
7% held at the activity's own task:
the task keeps its thread
for the whole
8% hostdem+thinktime interval, so it serializes against
the task multiplicity,
9% but
the host processor
is released
for it. This mirrors lqns, whose
10% think-time attribute LINE already writes out in writeXML.
12% lqn.actthink_mean
is preallocated as NaN by LayeredNetwork/getStruct and stays
13% NaN
for an activity that was never given a think time, so
the value
is
14% filtered here rather than added by
the callers: a NaN reaching servt or residt
15% propagates into
the layer
solvers, and
the NaN-ignoring fallbacks there then
16% launder it into a plausible-looking bare-service figure instead of failing.
18% Copyright (c) 2012-2026, Imperial College London
22if ~isfield(lqn,
'actthink_mean') && ~isprop(lqn,
'actthink_mean')
25if aidx < 1 || aidx > numel(lqn.actthink_mean)
28v = lqn.actthink_mean(aidx);
29if ~isnan(v) && v > GlobalConstants.FineTol