LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
gallery_cqn_multiclass.m
1function model = gallery_cqn_multiclass(m,r,wantdelay)
2if nargin == 0
3 m = 1;
4 r = 2;
5 wantdelay = true;
6end
7model = Network('Multi-class CQN');
8%% Block 1: nodes
9for i=1:m
10 node{i} = Queue(model, ['Queue ',num2str(i)], SchedStrategy.PS);
11end
12if wantdelay
13 node{end+1} = Delay(model, 'Delay 1');
14end
15%% Block 2: classes
16for s=1:r
17 jobclass{s} = ClosedClass(model, ['Class',num2str(s)], 5, node{1}, 0);
18end
19
20for s=1:r
21 for i=1:m
22 node{i}.setService(jobclass{s}, Exp.fitMean(round(50*rand))); % (Queue 1,Class1)
23 end
24 if wantdelay
25 node{end}.setService(jobclass{s}, Exp.fitMean(round(100*rand))); % (Delay 1,Class1)
26 end
27end
28
29%% Block 3: topology
30P = model.initRoutingMatrix(); % initialize routing matrix
31for s=1:r
32 P{jobclass{s},jobclass{s}} = Network.serialRouting(node);
33end
34model.link(P);
35end
Definition mmt.m:92