LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
mmap_super_safe.m
1function SUP = mmap_super_safe(MMAPs, maxorder, method)
2% SUP = mmap_super_safe(MMAPs, maxorder)
3% Superposition of marked MAPS
4
5if nargin == 2
6 method = 'default';
7end
8empty = cellfun(@isempty, MMAPs);
9MMAPs(empty)=[];
10scv_unmarked = cellfun(@map_scv, MMAPs);
11[~,Iset]=sort(scv_unmarked); % sort flows with small scv first
12SUP = {};
13for i=Iset(:)' % low-SCV first
14 if isempty(SUP) % is this is the first MMAP
15 SUP = MMAPs{i};
16 if maxorder == 1
17 % then treat it as a Poisson process if the limit is 1
18 SUP = mmap_exponential(mmap_lambda(MMAPs{i}));
19 end
20 else
21 if length(SUP{1}) * length(MMAPs{i}{1}) > maxorder
22 % otherwise treat it as a marked AMAP(2) process if the limit is >1
23 if length(SUP{1}) * 2 <= maxorder
24 SUP = mmap_super(SUP, mamap2m_fit_gamma_fb_mmap(MMAPs{i}), method);
25 else
26 SUP = mmap_super(SUP, mmap_exponential(mmap_lambda(MMAPs{i})), method);
27 end
28 else
29 SUP = mmap_super(SUP,MMAPs{i}, method);
30 end
31 end
32
33end
34end