LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
lqn_act_thinktime.m
1function zt = lqn_act_thinktime(lqn, aidx)
2% ZT = LQN_ACT_THINKTIME(LQN, AIDX)
3%
4% Think time of activity AIDX, zero when it has none.
5%
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.
11%
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.
17%
18% Copyright (c) 2012-2026, Imperial College London
19% All rights reserved.
20
21zt = 0;
22if ~isfield(lqn, 'actthink_mean') && ~isprop(lqn, 'actthink_mean')
23 return;
24end
25if aidx < 1 || aidx > numel(lqn.actthink_mean)
26 return;
27end
28v = lqn.actthink_mean(aidx);
29if ~isnan(v) && v > GlobalConstants.FineTol
30 zt = v;
31end
32end
Definition Station.m:245