LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
npfqn_traffic_merge_cs.m
1function SMMAP = npfqn_traffic_merge_cs(MMAP, prob, config)
2% Given a cell array of n MMAPs with arrivals of R classes, produces a new
3% MMAP after flow merging and class switching
4% prob((i-1)*R+r,s): prob that a class-r arrival from MMAP i switches to class-s
5n = length(MMAP);
6[~,R] = size(prob);
7
8if ~isfield(config,'merge')
9 config.merge = 'default';
10end
11
12% First let's convert from types to classes
13for i=1:n
14 P = zeros(R);
15 for r=1:R
16 for s=1:R
17 P(r,s) = prob((i-1)*R+r,s);
18 end
19 end
20 MMAP{i} = mmap_mark(MMAP{i}, P);
21end
22
23if n == 1
24 SMMAP = MMAP{1};
25 return;
26else
27 switch config.merge
28 case {'default','super'}
29 SMMAP = MMAP{1};
30 for j=2:n
31 SMMAP = mmap_super(SMMAP, MMAP{j},'match');
32 end
33 end
34end
35end