LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
mmap_pie.m
1function pie = mmap_pie(MMAP)
2% For each class c, computes the stationary probability of the DTMC
3% embedded at the restart intants after an arrival of class c.
4% Input:
5% - MMAP: the MMAP of order n with m classes
6% Output:
7% - pie: an mxn matrix, where the c-th row is the solution for class c
8
9symbolic = map_issym(MMAP);
10
11n = size(MMAP{1},1);
12m = size(MMAP,2)-2;
13
14if ~symbolic
15 pie = zeros(m,n);
16else
17 pie = sym(zeros(m,n));
18end
19
20for c = 1:m
21 Pc = (-MMAP{1}-MMAP{2}+MMAP{2+c}) \ MMAP{2+c};
22 if ~symbolic
23 A = Pc'-eye(n);
24 A(end,:) = ones(1,n);
25 b = zeros(n,1);
26 b(n) = 1;
27 else
28 A = Pc'-sym(eye(n));
29 A(end,:) = sym(ones(1,n));
30 b = sym(zeros(n,1));
31 b(n) = 1;
32 end
33 pie(c,:) = (A \ b)';
34end
35
36end