1function [handled, options, runtime] = runAnalyzerPreamble(self, options, tag)
2% [HANDLED, OPTIONS, RUNTIME] = RUNANALYZERPREAMBLE(OPTIONS, TAG)
4% Common opening of every runAnalyzer: stamp the wall-clock budget marker,
5% delegate to native python when options.lang says so and seed the RNG.
7% The library attribution
is NOT printed here: it
is pull-based, like Sage
's
8% sage.misc.citation.get_systems. Call solver.getLibrariesUsed() to obtain the
9% list, or solver.showLibraryAttribution() to print it; lineStart reminds the
10% user that it exists. The wrapper acknowledgement (line_ack) follows the same
11% rule: it prints only at VerboseLevel.DEBUG.
13% HANDLED is true when the call was served by the python delegation, in which
14% case the results are already set and the caller must return RUNTIME
15% immediately. TAG is the short solver name used in the debug line (e.g. 'MVA
').
17% Every solver carried its own copy of this block: six copies of the
18% lang='python
' guard and seven of the attribution print. The RNG seed
19% inside the python branch is load-bearing and must stay BEFORE the early
20% return: MATLAB-side samplers invoked after the delegated call (sampleSysAggr,
21% sample, the getCdfRespT Monte Carlo) draw from MATLAB's stream, so skipping
22% it made a seeded example reproducible under lang=
'matlab' but not under
25% Copyright (c) 2012-2026, Imperial College London
30if nargin < 3 || isempty(tag)
34% Wall-clock time-budget launch marker (see options.timeout / lineTimeoutExceeded)
35if ~isfield(options,
'timeout_tic') || isempty(options.timeout_tic)
36 options.timeout_tic = tic;
39if strcmp(options.lang,'python')
40 line_debug(options, '%s: using lang=python, delegating to native line_solver', tag);
41 Solver.resetRandomGeneratorSeed(options.seed);
42 [QN,UN,RN,TN,AN,WN,runtime] = PYLINE.getAvg(self.name, self.model, options);
43 self.setAvgResults(QN,UN,RN,TN,AN,WN,[],[],runtime,options.method,NaN);
48Solver.resetRandomGeneratorSeed(options.seed);