LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
solver_ncld_analyzer.m
1function [Q,U,R,T,C,X,lG,runtime,iter,method] = solver_ncld_analyzer(sn, options)
2% [Q,U,R,T,C,X,LG,RUNTIME,ITER,METHOD] = SOLVER_NCLD_ANALYZER(QN, OPTIONS)
3
4% Copyright (c) 2012-2026, Imperial College London
5% All rights reserved.
6Tstart = tic;
7method = options.method;
8
9line_debug('NC load-dependent analyzer starting: method=%s, nstations=%d, nclasses=%d, njobs=%s', method, sn.nstations, sn.nclasses, mat2str(sn.njobs));
10
11nservers = sn.nservers;
12if max(nservers(nservers<Inf))>1 & any(isinf(sn.njobs)) & strcmpi(options.method,'exact') %#ok<AND2>
13 line_error(mfilename,'NC solver cannot provide exact solutions for open or mixed queueing networks. Remove the ''exact'' option.');
14end
15
16eta = abs(sn.njobs - floor(sn.njobs));
17if any(eta>GlobalConstants.FineTol)
18 line_debug('Fractional populations detected, using interpolation');
19 if strcmpi(options.method,'exact')
20 line_error(mfilename,'NC load-dependent solver cannot provide exact solutions for fractional populations.');
21 end
22
23 sn_floor = sn; sn_floor.njobs = floor(sn.njobs);
24 [Qf,Uf,Rf,Tf,Cf,Xf,lGf,~,iterf] = solver_ncld(sn_floor, options);
25 sn_ceil = sn; sn_ceil.njobs = ceil(sn.njobs);
26 [Qc,Uc,Rc,Tc,Cc,Xc,lGc,~,iterc,method] = solver_ncld(sn_ceil, options);
27 Q = Qf + eta .* (Qc-Qf);
28 U = Uf + eta .* (Uc-Uf);
29 R = Rf + eta .* (Rc-Rf);
30 T = Tf + eta .* (Tc-Tf);
31 C = Cf + eta .* (Cc-Cf);
32 X = Xf + eta .* (Xc-Xf);
33 lG = lGf + eta .* (lGf-lGc);
34 iter = iterc + iterf;
35 line_debug('NC interpolation complete: used %d + %d iterations', iterf, iterc);
36else % if integers or open model
37 if any(isinf(sn.njobs))
38 line_debug('Open/mixed model detected, calling solver_ncld');
39 else
40 line_debug('Using exact integer populations, calling solver_ncld');
41 end
42 [Q,U,R,T,C,X,lG,~,iter,method] = solver_ncld(sn, options);
43end
44runtime = toc(Tstart);
45end