2function [runtime, tranSysState, tranSync] = runAnalyzer(self, options)
3% [RUNTIME, TRANSYSSTATE] = RUN()
6if nargin<2 %~exist('options','var')
7 options = self.getOptions;
9self.runAnalyzerChecks(options);
10Solver.resetRandomGeneratorSeed(options.seed);
12% Show library attribution if verbose and not yet shown
13if options.verbose ~= VerboseLevel.SILENT && ~GlobalConstants.isLibraryAttributionShown()
14 sn_temp = self.getStruct();
15 libs = SolverSSA.getLibrariesUsed(sn_temp, options);
17 line_printf('The solver will leverage %s.\n', strjoin(libs, ', '));
18 GlobalConstants.setLibraryAttributionShown(true);
22% Check if confidence intervals are requested
23[confintEnabled, confintLevel] = Solver.parseConfInt(options.confint);
25%options.lang = 'java';
32 case {
'default',
'serial',
'parallel'}
35 options.verbose = VerboseLevel.SILENT;
36 actualmethod =
'parallel';
38 jmodel = LINE2JLINE(self.model);
39 M = jmodel.getNumberOfStations;
40 R = jmodel.getNumberOfClasses;
42 jsolver = JLINE.SolverSSA(jmodel, options);
43 [QN,UN,RN,WN,AN,TN] = JLINE.arrayListToResults(jsolver.getAvgTable);
44 CN = JLINE.from_jline_matrix(jsolver.getAvgSysRespT());
45 XN = JLINE.from_jline_matrix(jsolver.getAvgSysTput());
46 runtime = jsolver.result.runtime;
47 QN = reshape(QN
',R,M)';
48 UN = reshape(UN
',R,M)';
49 RN = reshape(RN
',R,M)';
50 TN = reshape(TN
',R,M)';
51 WN = reshape(WN
',R,M)';
52 AN = reshape(AN
',R,M)';
53 self.setAvgResults(QN,UN,RN,TN,AN,WN,CN,XN,runtime);
55 % Extract confidence intervals from Java solver results
57 result = jsolver.result;
58 % Helper to check
for non-null Java objects
59 isValidMatrix = @(x) ~isempty(x) && isa(x,
'jline.util.matrix.Matrix');
60 if isValidMatrix(result.QNCI)
61 QNCI = JLINE.from_jline_matrix(result.QNCI);
62 QNCI = reshape(QNCI', R, M)';
66 if isValidMatrix(result.UNCI)
67 UNCI = JLINE.from_jline_matrix(result.UNCI);
68 UNCI = reshape(UNCI', R, M)';
72 if isValidMatrix(result.RNCI)
73 RNCI = JLINE.from_jline_matrix(result.RNCI);
74 RNCI = reshape(RNCI', R, M)';
78 if isValidMatrix(result.TNCI)
79 TNCI = JLINE.from_jline_matrix(result.TNCI);
80 TNCI = reshape(TNCI', R, M)';
84 if isValidMatrix(result.ANCI)
85 ANCI = JLINE.from_jline_matrix(result.ANCI);
86 ANCI = reshape(ANCI', R, M)';
90 if isValidMatrix(result.WNCI)
91 WNCI = JLINE.from_jline_matrix(result.WNCI);
92 WNCI = reshape(WNCI', R, M)';
97 self.setAvgResultsCI(QNCI, UNCI, RNCI, TNCI, ANCI, WNCI, [], []);
100 line_error(mfilename, ['the ',options.method',' method
is not available.']);
103 [QN,UN,RN,TN,CN,XN,~,actualmethod,tranSysState, tranSync, sn, QNCI, UNCI, RNCI, TNCI, ANCI, WNCI] = solver_ssa_analyzer(sn, options);
105 for isf=1:sn.nstateful
106 ind = sn.statefulToNode(isf);
107 switch sn.nodetype(sn.statefulToNode(isf))
109 self.model.
nodes{sn.statefulToNode(isf)}.setResultHitProb(sn.nodeparam{ind}.actualhitprob);
110 self.model.nodes{sn.statefulToNode(isf)}.setResultMissProb(sn.nodeparam{ind}.actualmissprob);
111 self.model.refreshChains();
115 T = getAvgTputHandles(self);
116 AN = sn_get_arvr_from_tput(sn, TN, T);
117 if strcmp(options.method,
'default') && exist(
'actualmethod',
'var')
118 self.setAvgResults(QN,UN,RN,TN,AN,[],CN,XN,runtime,['default/' actualmethod]);
120 self.setAvgResults(QN,UN,RN,TN,AN,[],CN,XN,runtime,options.method);
122 self.result.space = sn.space;
124 % Store CI data if computed
125 if confintEnabled && ~isempty(QNCI)
126 self.setAvgResultsCI(QNCI, UNCI, RNCI, TNCI, ANCI, WNCI, [], []);