1% D = MMAPFromMRAP(H, precision)
3% Obtains a Markovian representation of a rational
4% arrival process of the same size,
if possible,
using the
5% procedure published in [1]_.
9% H : list/cell of matrices of shape(M,M), length(N)
10% The H0...HN matrices of the MRAP to transform
11% precision : double, optional
12% A representation
is considered to be a Markovian one
13%
if it
is closer to it than
this precision
17% D : list/cell of matrices of shape(M,M), length(N)
18% The D0...DN matrices of the
MMAP (
if found)
22% .. [1] András Horváth, Gábor Horváth, Miklós Telek,
"A
23% traffic based decomposition of two-class queueing
24% networks with priority service". COMPUTER NETWORKS
25% 53:(8) pp. 1235-1248. (2009)
27function D = MMAPFromMRAP (H,prec)
29 if ~exist(
'prec',
'var')
33 global BuToolsCheckInput;
34 if isempty(BuToolsCheckInput)
35 BuToolsCheckInput = true;
38 if BuToolsCheckInput && ~CheckMRAPRepresentation(H)
39 error('MMAPFromMRAP: Input isn''t a valid MRAP representation');
42 function nH = transfun (oH, B)
43 nH = cell(1,length(oH));
45 nH{i} = inv(B)*oH{i}*B;
49 function dist = evalfun (oH, k)
53 oH0 = oH{1} - diag(diag(oH{1}));
57 dist = min(dist, min(min(oH{k})));
60 dist = sum(oH0(oH0<0));
63 dist = dist + sum(oHk(oHk<0));
69 D = FindMarkovianRepresentation (H, @transfun, @evalfun, prec);