LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
runAnalyzer.m
1function [runtime, analyzer] = runAnalyzer(self, options)
2% RUNANALYZER Execute the bound-analysis solver.
3%
4% Dispatches noniterative bound families to the shared bound handler
5% solver_ba_analyzer, and hierarchical/iterative families to their
6% SolverBA-native analyzers. Each method returns a single (upper or lower)
7% bound; use getBounds() to obtain the {lower,upper} bracket for a family.
8%
9% Copyright (c) 2012-2026, Imperial College London
10% All rights reserved.
11
12if nargin < 2
13 options = self.getOptions;
14end
15
16sn = self.getStruct;
17
18if sn.nclosedjobs <= 0
19 line_error(mfilename, 'SolverBA supports closed queueing networks only.');
20end
21
22% 'default' selects the tightest available noniterative upper throughput
23% bound (geometric bound), matching the historical SolverMVA convention.
24% 'qr' is a friendly alias for the QRF quadratic reduction bound. 'lr' is the
25% LP-based Linear Reduction bound (mapqn_bnd_lr_pf, solved by linprog) and is
26% NOT an alias of 'qrf.mmi.linear': that method's name refers only to its
27% explicit Aeq/beq constraint representation, while its objective is the
28% nonlinear MEM entropy solved by fmincon. Bare 'lr' means 'lr.upper'.
29method = options.method;
30if strcmp(method,'default')
31 method = 'gb.upper';
32elseif strcmp(method,'lr')
33 method = 'lr.upper';
34elseif strcmp(method,'qr')
35 method = 'qrf.mmi';
36end
37
38% Show library attribution (QRF uses the Optimization Toolbox) once.
39if options.verbose ~= VerboseLevel.SILENT && ~GlobalConstants.isLibraryAttributionShown()
40 libs = SolverBA.getLibrariesUsed([], setfield(options,'method',method)); %#ok<SFLD>
41 if ~isempty(libs)
42 line_printf('The solver will leverage %s.\n', strjoin(libs, ', '));
43 GlobalConstants.setLibraryAttributionShown(true);
44 end
45end
46
47iter = 1;
48if startsWith(method,'qrf')
49 % QRF (Quadratic Reduction Framework) LP-based bounds for single-class
50 % closed networks with PH service. The adapter enforces its own gating.
51 analyzer = @(qn) solver_ba_qrf_analyzer(qn, setfield(options,'method',method)); %#ok<SFLD>
52 bopts = options; bopts.method = method;
53 [QN,UN,RN,TN,CN,XN,runtime] = solver_ba_qrf_analyzer(sn, bopts);
54elseif any(strcmp(method, self.listValidMethods()))
55 analyzer = @(qn) solver_ba_analyzer(qn, setfield(options,'method',method)); %#ok<SFLD>
56 bopts = options; bopts.method = method;
57 [QN,UN,RN,TN,CN,XN,lG,runtime,iter] = solver_ba_analyzer(sn, bopts);
58else
59 line_error(mfilename, ['Unknown bound method ''%s''. Valid methods: %s'], ...
60 method, strjoin(self.listValidMethods(), ', '));
61end
62
63M = sn.nstations;
64R = sn.nclasses;
65AN = zeros(M,R);
66WN = zeros(M,R);
67self.setAvgResults(QN,UN,RN,TN,AN,WN,CN,XN,runtime,method,iter);
68end
Definition Station.m:245