1classdef SolverMAM < NetworkSolver
2 % Matrix-Analytic and RCAT methods solver
4 % Implements matrix-analytic methods and RCAT
for structured Markov chain analysis.
6 % Copyright (c) 2012-2026, Imperial College London
10 function self = SolverMAM(model,varargin)
11 % SOLVERMAM Create a Matrix-Analytic Methods solver instance
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
18 self@NetworkSolver(model, mfilename);
19 self.setOptions(Solver.parseOptions(varargin, self.defaultOptions));
23 function sn = getStruct(self)
26 % Get data structure summarizing the model
27 sn = self.model.getStruct(
true);
30 runtime = runAnalyzer(self, options);
31 RD = getCdfRespT(self, R);
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'};
47 function featSupported = getFeatureSet()
48 % FEATSUPPORTED = GETFEATURESET()
50 featSupported = SolverFeatureSet;
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',...
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',...
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', ...
80 % Add BMAP/PH/N/N retrial queue features
81 featSupported.setTrue({
'Retrial',
'BMAP',
'PH'});
84 function [bool, featSupported] = supports(model)
85 % [BOOL, FEATSUPPORTED] = SUPPORTS(MODEL)
87 featUsed = model.getUsedLangFeatures();
88 featSupported = SolverMAM.getFeatureSet();
89 bool = SolverFeatureSet.supports(featSupported, featUsed);
92 function options = defaultOptions()
93 % OPTIONS = DEFAULTOPTIONS()
94 options = SolverOptions('MAM');
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
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';
108 % Q-MAM used
for specific RCAT-based methods
109 if ismember(options.method, {
'mna',
'inap',
'inapplus'})
110 libs{end+1} =
'Q-MAM';
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';
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';
126 % Remove duplicates and maintain order
127 libs = unique(libs,
'stable');