1function runtime = runAnalyzer(self, options)
7 options = self.getOptions;
10[pyHandled, options, pyRuntime] = self.runAnalyzerPreamble(options,
'MAM');
16% runAnalyzerChecks subsumes the coarse supports() test; see _kb/06-solver-catalog.md for rationale
17self.runAnalyzerChecks(options);
20% Finite Capacity Region: MAM does not enforce the aggregate per-region job
21% limit and would silently return the unconstrained answer.
22if isfield(sn,'nregions') && sn.nregions > 0
23 line_error(mfilename,'This model uses a Finite Capacity Region (addRegion), which
is not supported by SolverMAM. Use SolverCTMC, SolverJMT, SolverSSA or SolverLDES, or setCapacity for a single-station limit.');
26Solver.resetRandomGeneratorSeed(options.seed);
29%options.lang = 'java';
33 line_debug(options, 'MAM: using lang=java, delegating to JLINE');
34 jmodel = LINE2JLINE(self.model);
35 %M = jmodel.getNumberOfStatefulNodes;
36 M = jmodel.getNumberOfStations;
37 R = jmodel.getNumberOfClasses;
38 jsolver = JLINE.SolverMAM(jmodel, options);
39 [QN,UN,RN,WN,AN,TN] = JLINE.arrayListToResults(jsolver.getAvgTable);
43 QN = reshape(QN',R,M)';
44 UN = reshape(UN',R,M)';
45 RN = reshape(RN',R,M)';
46 WN = reshape(WN',R,M)';
47 AN = reshape(AN',R,M)';
48 TN = reshape(TN',R,M)';
51 self.setAvgResults(QN,UN,RN,TN,AN,WN,CN,XN,runtime,options.method,lastiter);
52 self.result.Prob.logNormConstAggr = lG;
55 line_debug(options, 'MAM: using lang=matlab');
58 % Check if transient analysis
is requested
59 isTran = length(options.timespan) >= 2 && ~isinf(options.timespan(2));
61 if isTran && strcmp(options.method, 'ldqbd')
62 if mam_transient_qbd_applicable(sn)
63 % Correlated MAP arrival/service or non-Poisson arrival: use the
64 % Laplace-domain transient QBD solver on the true MAP blocks.
65 line_debug(options, 'MAM: transient analysis via Laplace transient QBD');
66 [Qt, Ut, Tt] = solver_mam_transient_qbd(sn, options);
68 line_debug(options, 'MAM: transient analysis via standard QBD');
69 sn = sn_nonmarkov_toph(sn, options);
70 [Qt, Ut, Tt] = solver_mam_ldqbd_transient(sn, options);
73 Xt = cell(1, sn.nclasses);
74 Ct = cell(1, sn.nclasses);
76 self.setTranAvgResults(Qt, Ut, Rt, Tt, Ct, Xt, runtime);
77 elseif true%~snHasMultipleClosedClasses(sn)
78 line_debug(options, 'MAM: calling solver_mam_analyzer (method=%s)', options.method);
79 % Call solver_mam_analyzer - percResults
is optional 10th output
80 [QN,UN,RN,TN,CN,XN,~,actualmethod,iter,percResults] = solver_mam_analyzer(sn, options);
81 T = getAvgTputHandles(self);
82 AN=sn_get_arvr_from_tput(sn, TN, T);
85 if strcmp(options.method,'default')
86 self.setAvgResults(QN,UN,RN,TN,AN,[],CN,XN,runtime,['default/' actualmethod],iter);
88 self.setAvgResults(QN,UN,RN,TN,AN,[],CN,XN,runtime,options.method,iter);
91 % Store percentile results if FJ_codes was used
92 if ~isempty(percResults)
93 self.result.Percentile = percResults;
96 line_warning(mfilename,'SolverMAM supports at most a single closed class.\n');
98 self.setAvgResults([],[],[],[],[],[],[],[],runtime,options.method,0);