LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
getMAMResult.m
1function result = getMAMResult(self)
2% RESULT = GETMAMRESULT()
3%
4% Intermediate quantities of the matrix-analytic analysis of a single-queue
5% model, in addition to the mean performance measures returned by getAvg.
6%
7% Mean values alone hide the objects the method is actually built on, so a
8% matrix-analytic result cannot be inspected, taught, or checked against a
9% published derivation. This accessor returns them.
10%
11% For a BMAP (or MAP) arrival stream feeding an exponential single server the
12% result is that of qsys_bmapm1 and carries the M/G/1-type quantities: the
13% phase-process stationary vectors theta and alpha, the randomized blocks A0,
14% A1, B0 and Bk, the matrix G, the drift, the measured decay rate and the level
15% probabilities.
16%
17% For a retrial station the result is that of qsys_bmapphnn_retrial and carries
18% the orbit-level stationary distribution together with the truncation level and
19% its residual.
20%
21% See also qsys_bmapm1, qsys_bmapphnn_retrial, SolverMAM.getAvg
22%
23% Copyright (c) 2012-2026, Imperial College London
24% All rights reserved.
25
26sn = self.model.getStruct();
27
28% A retrial station carries its own engine, whose result object already exposes
29% the orbit-level internals.
30[isRetrial, retInfo] = qsys_is_retrial(sn);
31if isRetrial
32 options = self.getOptions();
33 options.verbose = false;
34 [~,~,~,~,~,~,~,result] = solver_mam_retrial(sn, options);
35 return
36end
37
38% Otherwise: BMAP/MAP arrivals into a single exponential server.
39sourceIdx = [];
40queueIdx = [];
41for ist = 1:sn.nstations
42 nodeIdx = sn.stationToNode(ist);
43 if sn.nodetype(nodeIdx) == NodeType.Source
44 sourceIdx = ist;
45 elseif sn.nodetype(nodeIdx) == NodeType.Queue
46 if isempty(queueIdx)
47 queueIdx = ist;
48 else
49 line_error(mfilename, 'getMAMResult exposes the matrix-analytic internals of a single-queue model only.');
50 end
51 end
52end
53if isempty(sourceIdx) || isempty(queueIdx)
54 line_error(mfilename, 'getMAMResult requires an open model with one Source and one Queue.');
55end
56if sn.nclasses > 1
57 line_error(mfilename, 'getMAMResult exposes the matrix-analytic internals of a single-class model only.');
58end
59if sn.nservers(queueIdx) ~= 1
60 line_error(mfilename, 'getMAMResult requires a single-server queue.');
61end
62
63arrivalProc = sn.proc{sourceIdx}{1};
64if isempty(arrivalProc) || ~iscell(arrivalProc) || numel(arrivalProc) < 2
65 line_error(mfilename, 'The arrival process has no Markovian (D0,D1,...) representation.');
66end
67
68serviceProc = sn.proc{queueIdx}{1};
69if isempty(serviceProc) || ~iscell(serviceProc) || size(serviceProc{1},1) ~= 1
70 line_error(mfilename, ['getMAMResult exposes the M/G/1-type internals for exponential service only; ' ...
71 'the queue has a multi-phase service process.']);
72end
73mu = -serviceProc{1}(1,1);
74
75result = qsys_bmapm1(arrivalProc, mu);
76end