LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
lineTimeoutExceeded.m
1function tf = lineTimeoutExceeded(options)
2% TF = LINETIMEOUTEXCEEDED(OPTIONS)
3% Cooperative wall-clock checkpoint for iterative solvers. Returns true if the
4% elapsed time since the solver launch (options.timeout_tic, a tic handle set at
5% the top of the per-solver runAnalyzer) exceeds options.timeout (seconds).
6% A missing/non-finite/non-positive budget, or a missing tic, means no budget.
7
8% Copyright (c) 2012-2026, Imperial College London
9% All rights reserved.
10
11tf = false;
12if nargin == 0
13 % Global-deadline form: deep utility functions (e.g. multichoose) that
14 % have no options argument consult the session-level deadline set by the
15 % per-solver runAnalyzer (see SolverCTMC). Empty appdata means no budget.
16 d = getappdata(0, 'LINEtimeoutDeadline');
17 if isempty(d)
18 return;
19 end
20 tf = toc(d.tic) > d.budget;
21 return;
22end
23if ~isstruct(options) || ~isfield(options, 'timeout') || ~isfield(options, 'timeout_tic')
24 return;
25end
26budget = options.timeout;
27if isempty(budget) || ~isfinite(budget) || budget <= 0
28 return;
29end
30tf = toc(options.timeout_tic) > budget;
31end
Definition Station.m:245