LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
map_max.m
1function M=map_max(A,B)
2% M=map_max(A,B) - MAP of the maximum of two independent MAPs
3%
4% Input:
5% A: a MAP in the form of {D0,D1}
6% B: a MAP in the form of {D0,D1}
7%
8% Output:
9% M: a MAP in the form of {D0,D1} whose inter-arrival times are
10% distributed as max(X,Y), with X~A and Y~B drawn independently at each
11% arrival epoch from the respective embedded equilibrium distributions
12%
13% The phase space is ordered as [(i,j) pairs, B-only phases, A-only
14% phases]: in the first block both A and B are still running, in the
15% second block A has already completed and B is awaited, in the third
16% block B has completed and A is awaited. An arrival is recorded when the
17% second of the two completes, i.e. only out of the last two blocks.
18%
19na=size(A{1},1);
20nb=size(B{1},1);
21a=-A{1}*ones(na,1);
22b=-B{1}*ones(nb,1);
23% pair state (i,j) has index (i-1)*nb+j, matching krons(A{1},B{1})
24M0=[
25 krons(A{1},B{1}), kron(a,eye(nb)), kron(eye(na),b)
26 zeros(nb,na*nb), B{1}, zeros(nb,na)
27 zeros(na,na*nb), zeros(na,nb), A{1}
28 ];
29pie = [kron(map_pie(A),map_pie(B)),zeros(1,nb),zeros(1,na)];
30% completion rate of the second of the two processes out of each phase; it
31% is zero in the pair block, where only the first one can still complete
32d = [zeros(na*nb,1); b; a];
33M1 = d*pie;
34M={M0,M1};
35end
Definition Station.m:245