LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
npfqn_traffic_split_cs.m
1function varargout = npfqn_traffic_split_cs(MMAP, P, config)
2% Given a MMAP, produces a new array after split and class switching
3% P(r,(j-1)*R+s): prob that a class-r departure flows to destination j in
4% class s out of R possible classes
5%empty = cellfun(@isempty, MMAP);
6%MMAP(empty)=[];
7%P(:,empty)=[];
8%P(empty,:)=[];
9
10n = length(MMAP);
11[R,J] = size(P);
12M = round(J/R);
13
14SMMAP = cell(1,M);
15for jst=1:M
16 SMMAP{jst} = cell(1,2+R);
17 SMMAP{jst}{1} = MMAP{1} + MMAP{2};
18 SMMAP{jst}{2} = 0*MMAP{2};
19 for s=1:R
20 SMMAP{jst}{2+s} = SMMAP{jst}{1} * 0;
21 for r=1:R
22 SMMAP{jst}{2+s} = SMMAP{jst}{2+s} + MMAP{2+r}*P(r,(jst-1)*R+s);
23 SMMAP{jst}{2} = SMMAP{jst}{2} + MMAP{2+r}*P(r,(jst-1)*R+s);
24 SMMAP{jst}{1} = SMMAP{jst}{1} - MMAP{2+r}*P(r,(jst-1)*R+s);
25 end
26 end
27 SMMAP{jst} = mmap_normalize(SMMAP{jst});
28end
29varargout = SMMAP;
30end