LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
SolverMAM.m
1classdef SolverMAM < NetworkSolver
2 % Matrix-Analytic and RCAT methods solver
3 %
4 % Implements matrix-analytic methods and RCAT for structured Markov chain analysis.
5 %
6 % Copyright (c) 2012-2026, Imperial College London
7 % All rights reserved.
8
9 methods
10 function self = SolverMAM(model,varargin)
11 % SOLVERMAM Create a Matrix-Analytic Methods solver instance
12 %
13 % @brief Creates a MAM solver for structured Markov chain analysis
14 % @param model Network model to be analyzed via matrix-analytic methods
15 % @param varargin Optional parameters (method, tolerance, etc.)
16 % @return self SolverMAM instance configured for MAM analysis
17
18 self@NetworkSolver(model, mfilename);
19 self.setOptions(Solver.parseOptions(varargin, self.defaultOptions));
20 self.setLang();
21 end
22
23 function sn = getStruct(self)
24 % QN = GETSTRUCT()
25
26 % Get data structure summarizing the model
27 sn = self.model.getStruct(true);
28 end
29
30 runtime = runAnalyzer(self, options);
31 RD = getCdfRespT(self, R);
32
33 function [allMethods] = listValidMethods(self)
34 % allMethods = LISTVALIDMETHODS()
35 % List valid methods for this solver
36 sn = self.model.getStruct();
37 % Note: Method order must match expected values in test files.
38 % New methods should be added at the end to preserve index alignment.
39 % 'exact' method removed - autocat moved to line-legacy.git
40 allMethods = {'default','dec.source','dec.mmap','dec.poisson','mna','inap','ldqbd','inapplus'};
41 end
42end
43
44 methods (Static)
45
46
47 function featSupported = getFeatureSet()
48 % FEATSUPPORTED = GETFEATURESET()
49
50 featSupported = SolverFeatureSet;
51 % MAM features
52 featSupported.setTrue({'Sink','Source',...
53 'Fork','Join','Forker','Joiner',... % Fork-Join support (via FJ_codes)
54 'Delay','DelayStation','Queue',...
55 'APH','Coxian','Erlang','Exp','HyperExp','MMPP2','MAP',...
56 'Det','Gamma','Lognormal','Pareto','Uniform','Weibull',...
57 'StatelessClassSwitcher','InfiniteServer',...
58 'ClassSwitch', ...
59 'SharedServer','Buffer','Dispatcher',...
60 'Server','JobSink','RandomSource','ServiceTunnel',...
61 'SchedStrategy_INF','SchedStrategy_PS','SchedStrategy_HOL',...
62 'SchedStrategy_FCFS',...
63 'RoutingStrategy_PROB','RoutingStrategy_RAND',...
64 'ClosedClass','SelfLoopingClass',...
65 'OpenClass'});
66 % Add RCAT (AG) features
67 featSupported.setTrue({'Sink', 'Source', ...
68 'Fork','Join','Forker','Joiner',... % Fork-Join support (via FJ_codes)
69 'Delay', 'DelayStation', 'Queue', ...
70 'APH', 'Coxian', 'Erlang', 'Exp', 'HyperExp', ...
71 'Det','Gamma','Lognormal','Pareto','Uniform','Weibull',...
72 'StatelessClassSwitcher', 'InfiniteServer', ...
73 'SharedServer', 'Buffer', 'Dispatcher', ...
74 'Server', 'JobSink', 'RandomSource', 'ServiceTunnel', ...
75 'SchedStrategy_INF', 'SchedStrategy_PS', ...
76 'SchedStrategy_FCFS', ...
77 'RoutingStrategy_PROB', 'RoutingStrategy_RAND', ...
78 'ClosedClass', ...
79 'OpenClass'});
80 % Add BMAP/PH/N/N retrial queue features
81 featSupported.setTrue({'Retrial', 'BMAP', 'PH'});
82 end
83
84 function [bool, featSupported] = supports(model)
85 % [BOOL, FEATSUPPORTED] = SUPPORTS(MODEL)
86
87 featUsed = model.getUsedLangFeatures();
88 featSupported = SolverMAM.getFeatureSet();
89 bool = SolverFeatureSet.supports(featSupported, featUsed);
90 end
91
92 function options = defaultOptions()
93 % OPTIONS = DEFAULTOPTIONS()
94 options = SolverOptions('MAM');
95 end
96
97 function libs = getLibrariesUsed(sn, options)
98 % GETLIBRARIESUSED Get list of external libraries used by MAM solver
99 % Detect libraries used by MAM solver based on topology and method
100 libs = {};
101
102 % MAMSolver used for matrix-analytic methods (M/G/1, GI/M/1 types)
103 % This includes default and decomposition methods
104 if ismember(options.method, {'default', 'dec.source', 'dec.mmap', 'dec.poisson'})
105 libs{end+1} = 'MAMSolver';
106 end
107
108 % Q-MAM used for specific RCAT-based methods
109 if ismember(options.method, {'mna', 'inap', 'inapplus'})
110 libs{end+1} = 'Q-MAM';
111 end
112
113 % SMCSolver used for QBD (Quasi-Birth-Death) analysis
114 % Currently available but not actively used in default paths
115 % Uncomment when QBD methods are activated:
116 % if ismember(options.method, {'qbd'})
117 % libs{end+1} = 'SMCSolver';
118 % end
119
120 % BUTools usage detection (via KPCToolbox MAP functions)
121 % BUTools is used when analyzing MAP/PH distributions
122 if ~isempty(sn) && isfield(sn, 'proc') && ~isempty(sn.proc) && any(~cellfun(@isempty, sn.proc(:)))
123 libs{end+1} = 'BUTools';
124 end
125
126 % Remove duplicates and maintain order
127 libs = unique(libs, 'stable');
128 end
129 end
130end