LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
citations.m
1function entries = citations(self)
2% ENTRIES = CITATIONS()
3%
4% Bibliographic references for the algorithms this solver used, as a struct
5% array with fields .ref (the reference) and .covers (which part of the
6% solution process it covers), plus .key, the internal bibliography key of
7% doc/latex/biblio.bib, kept for programmatic lookup and never displayed.
8% Printed as a list when called without an output argument.
9%
10% The references follow what the run actually did: the method the analyzer
11% resolved to (not merely the one requested), the fork-join transformation if
12% the model has forks, and the percentile method of the last getPerctRespT
13% call. Running an AMVA model with method 'bs' and then asking for a fork-join
14% tail with 'forktail' therefore returns both papers.
15%
16% Attribution in LINE is pull-based: nothing is printed during a solve.
17% See also libraries, which reports the bundled third-party dependencies.
18%
19% Example:
20% solver = SolverMVA(model,'method','bs');
21% solver.getAvg();
22% solver.getPerctRespT([95 99], [], 'forktail');
23% solver.citations()
24%
25% Copyright (c) 2012-2026, Imperial College London
26% All rights reserved.
27
28tokens = {};
29
30% the solver family, both as a token of its own (for the paradigms whose
31% reference IS the paradigm) and as a qualifier on the method names, since the
32% same name means different algorithms in different solvers ('mva' is
33% Reiser-Lavenberg under MVA and Reiser's convolution under NC)
34family = '';
35switch class(self)
36 case 'SolverCTMC'
37 family = 'ctmc'; tokens{end+1} = 'ctmc';
38 case 'SolverSSA'
39 family = 'ssa'; tokens{end+1} = 'ssa';
40 case {'SolverFLD','SolverFluid'}
41 family = 'fld'; tokens{end+1} = 'fld';
42 case 'SolverLN'
43 family = 'ln'; tokens{end+1} = 'ln';
44 case 'SolverJMT'
45 family = 'jmt'; tokens{end+1} = 'jmt';
46 case 'SolverLQNS'
47 family = 'lqns'; tokens{end+1} = 'lqns';
48 case 'SolverENV'
49 family = 'env'; tokens{end+1} = 'env';
50 case 'SolverMVA'
51 family = 'mva';
52 case 'SolverNC'
53 family = 'nc';
54 case 'SolverMAM'
55 family = 'mam';
56 case 'SolverBA'
57 family = 'ba';
58end
59
60 function addMethodToken(m)
61 m = lower(strtrim(char(m)));
62 if isempty(m) || strcmp(m,'default')
63 return
64 end
65 if ~isempty(family)
66 tokens{end+1} = [family '.' m];
67 else
68 tokens{end+1} = m;
69 end
70 end
71
72% the requested method, and the one the analyzer actually resolved to: the
73% reported name is 'default/<actual>' when dispatch chose for the user
74options = self.getOptions;
75if isfield(options,'method') && ~isempty(options.method)
76 addMethodToken(options.method);
77end
78if self.hasAvgResults() && isfield(self.result,'Avg') && isfield(self.result.Avg,'method') ...
79 && ~isempty(self.result.Avg.method)
80 % the reported name is 'default/<actual>' when dispatch chose for the user
81 parts = strsplit(char(self.result.Avg.method), '/');
82 for pi = 1:numel(parts)
83 addMethodToken(parts{pi});
84 end
85end
86
87% the fork-join transformation, when the model has one
88if isa(self.model,'Network') && self.model.hasFork
89 fjm = 'mmt';
90 if isfield(options,'config') && isfield(options.config,'fork_join') && ~isempty(options.config.fork_join)
91 fjm = options.config.fork_join;
92 if any(strcmpi(fjm, {'default','fjt'}))
93 fjm = 'mmt';
94 elseif strcmpi(fjm, 'heidelberger-trivedi')
95 fjm = 'ht';
96 end
97 end
98 tokens{end+1} = fjm;
99end
100
101% the percentile method of the last getPerctRespT call, if any
102if ~isempty(self.lastPerctMethod)
103 tokens{end+1} = self.lastPerctMethod;
104end
105
106entries = line_citations(tokens);
107
108if nargout == 0
109 if isempty(entries)
110 line_printf('No algorithm references recorded for this run.\n');
111 else
112 % The bibliography key (.key) is kept on the struct for programmatic
113 % lookup in doc/latex/biblio.bib, but it is internal shorthand and is
114 % not shown: a user reads the reference, not 'Sch79'.
115 for i = 1:numel(entries)
116 line_printf('%s\n covers: %s\n', entries(i).ref, entries(i).covers);
117 end
118 end
119 clear entries
120end
121end