LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
DMRAPFromMoments.m
1% H = DMRAPFromMoments(moms, Nm)
2%
3% Creates a discrete marked rational arrival process that
4% has the same marginal and lag-1 joint moments as given
5% (see [1]_).
6%
7% Parameters
8% ----------
9% moms : vector of doubles
10% The list of marginal moments. To obtain a discrete
11% marked rational process of order M, 2*M-1 marginal
12% moments are required.
13% Nm : list of matrices, shape (M,M)
14% The list of lag-1 joint moment matrices. The
15% length of the list determines K, the number of arrival
16% types of the discrete rational process.
17%
18% Returns
19% -------
20% H : list of matrices, shape (M,M)
21% The H0, H1, ..., HK matrices of the discrete marked
22% rational process
23%
24% References
25% ----------
26% .. [1] Andras Horvath, Gabor Horvath, Miklos Telek, "A
27% traffic based decomposition of two-class queueing
28% networks with priority service," Computer Networks
29% 53:(8) pp. 1235-1248. (2009)
30
31function H = DMRAPFromMoments(moms, Nm)
32
33 [v, H0] = MGFromMoments (moms);
34 N = size(H0,1);
35
36 H0i = inv(eye(N)-H0);
37 Ge = zeros(N);
38 G1 = zeros(N);
39
40 H0ip = eye(N);
41 for i=1:N
42 Ge(i,:) = v * H0ip;
43 G1(:,i) = sum(H0ip, 2);
44 H0ip = H0ip * i * H0i;
45 if i>1
46 H0ip = H0ip * H0;
47 end
48 end
49
50 Gei = inv(Ge);
51 G1i = inv(G1);
52
53 H = cell(1,length(Nm)+1);
54 H{1} = H0;
55 for i=2:length(Nm)+1
56 Nmi = Nm{i-1};
57 row1 = FactorialMomsFromMoms(Nmi(1,2:end));
58 col1 = FactorialMomsFromMoms(Nmi(2:end,1));
59 mid = JFactorialMomsFromJMoms(Nmi(2:end,2:end));
60 Nmi = [Nmi(1,1), row1; col1, mid];
61 H{i} = (eye(N)-H0)*Gei*Nmi*G1i;
62 end
63end