LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
finalizeAvgResults.m
1function finalizeAvgResults(self, QN, UN, RN, TN, CN, XN, runtime, method, iter, actualmethod, lG, WN)
2% FINALIZEAVGRESULTS(QN,UN,RN,TN,CN,XN,RUNTIME,METHOD,ITER,ACTUALMETHOD,LG,WN)
3%
4% Common closing of every runAnalyzer: derive the arrival rates from the
5% throughputs, store the averages under the reported method name, record the
6% normalizing constant and flag a run that exhausted the wall-clock budget.
7%
8% ACTUALMETHOD is the analyzer-selected method appended to 'default/' when the
9% caller asked for 'default'; pass '' when the analyzer did not report one. LG
10% and WN are optional: pass [] when the solver has no normalizing constant or
11% does not report residence times (only MVA does today).
12%
13% Copyright (c) 2012-2026, Imperial College London
14% All rights reserved.
15
16if nargin < 11, actualmethod = ''; end
17if nargin < 12, lG = []; end
18if nargin < 13, WN = []; end
19
20sn = self.model.getStruct();
21AN = sn_get_arvr_from_tput(sn, TN, self.getAvgTputHandles());
22
23if strcmp(method,'default') && ~isempty(actualmethod) && ~strcmp(actualmethod,'default')
24 reported = ['default/' actualmethod];
25else
26 reported = method;
27end
28self.setAvgResults(QN,UN,RN,TN,AN,WN,CN,XN,runtime,reported,iter);
29
30if ~isempty(lG)
31 self.result.Prob.logNormConstAggr = real(lG);
32end
33
34options = self.getOptions;
35if lineTimeoutExceeded(options)
36 self.result.Avg.timedOut = true;
37 line_warning(mfilename,'Solver exceeded the wall-clock time budget (options.timeout=%gs); returning the interim solution.\n', options.timeout);
38end
39end