LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
initFromAvgQLen.m
1function initFromAvgQLen(self, AvgQLen)
2% INITFROMAVGQLEN(AVGQLEN)
3
4n = round(AvgQLen);
5njobs = sum(n,1);
6% we now address the problem that round([0.5,0.5]) = [1,1] so
7% different from the total initial population
8for r=1:size(AvgQLen,2)
9 if njobs(r) > sum(AvgQLen,1) % error at most by 1
10 i = maxpos(n(:,r));
11 n(i,r) = n(i,r) - 1;
12 njobs = sum(n,1)';
13 end
14end
15try
16 self.initFromMarginal(n);
17catch
18 self.initDefault;
19end
20end