LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
DMMAPFromDMRAP.m
1% D = DMMAPFromDMRAP(H, precision)
2%
3% Obtains a Markovian representation of a discrete rational
4% arrival process of the same size, if possible, using the
5% procedure published in [1]_.
6%
7% Parameters
8% ----------
9% H : list/cell of matrices of shape(M,M), length(N)
10% The H0...HN matrices of the DMRAP 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
14%
15% Returns
16% -------
17% D : list/cell of matrices of shape(M,M), length(N)
18% The D0...DN matrices of the DMMAP (if found)
19%
20% References
21% ----------
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)
26
27function D = DMMAPFromDMRAP(H,prec)
28
29 if ~exist('prec','var')
30 prec = 1e-14;
31 end
32
33 global BuToolsCheckInput;
34
35 if isempty(BuToolsCheckInput)
36 BuToolsCheckInput = true;
37 end
38
39 if BuToolsCheckInput && ~CheckDMRAPRepresentation(H)
40 error('DMMAPFromDMRAP: Input isn''t a valid DMRAP representation');
41 end
42
43 function nH = transfun (oH, B)
44 nH = cell(1,length(oH));
45 for i=1:length(oH)
46 nH{i} = inv(B)*oH{i}*B;
47 end
48 end
49
50 function dist = evalfun (oH, k)
51 if nargin<2
52 k = 0;
53 end
54 Ones = ones(size(oH{1}));
55 if rem(k,2) == 0
56 dist = inf;
57 for k=1:length(oH)
58 dist = min(dist, min(min(min(oH{k})),min(min(Ones-oH{k}))));
59 end
60 else
61 dist = 0;
62 for k=1:length(oH)
63 oHk = oH{k};
64 dist = dist + min(sum(oHk(oHk<0)), sum(oHk((Ones-oHk)<0)));
65 end
66 end
67 dist = -dist;
68 end
69
70 D = FindMarkovianRepresentation (H, @transfun, @evalfun, prec);
71end