LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
ld_fes_multiclass.m
1clear node jobclass
2
3% Multiclass FES Aggregation with Norton's Theorem Verification
4%
5% This example demonstrates Norton's theorem for closed multiclass
6% queueing networks: a subset of stations is replaced by a single
7% Flow-Equivalent Server (FES) whose LJCD service rates equal the
8% throughputs of the isolated subnetwork.
9
10N1 = 3; % class-1 jobs
11N2 = 2; % class-2 jobs
12
13%% Original 4-station tandem network with 2 classes
14model = Network('OriginalModel');
15
16node{1} = Delay(model, 'Delay');
17node{2} = Queue(model, 'Q1', SchedStrategy.PS);
18node{3} = Queue(model, 'Q2', SchedStrategy.PS);
19node{4} = Queue(model, 'Q3', SchedStrategy.PS);
20
21jobclass{1} = ClosedClass(model, 'Class1', N1, node{1}, 0);
22jobclass{2} = ClosedClass(model, 'Class2', N2, node{1}, 0);
23
24node{1}.setService(jobclass{1}, Exp.fitMean(1.0));
25node{1}.setService(jobclass{2}, Exp.fitMean(1.5));
26node{2}.setService(jobclass{1}, Exp.fitMean(0.5));
27node{2}.setService(jobclass{2}, Exp.fitMean(0.8));
28node{3}.setService(jobclass{1}, Exp.fitMean(0.3));
29node{3}.setService(jobclass{2}, Exp.fitMean(0.6));
30node{4}.setService(jobclass{1}, Exp.fitMean(0.4));
31node{4}.setService(jobclass{2}, Exp.fitMean(0.7));
32
33P = model.initRoutingMatrix();
34P{1,1} = [0 1 0 0; 0 0 1 0; 0 0 0 1; 1 0 0 0];
35P{2,2} = P{1,1};
36model.link(P);
37
38%% Solve original model
39fprintf('MVA (original):\n');
40AvgOrig = SolverMVA(model, 'method', 'exact').getAvgTable;
41disp(AvgOrig);
42
43%% Aggregate Q1, Q2, Q3 into FES and solve with NC (convolution)
44[fesModel, ~, ~] = ModelAdapter.aggregateFES(model, ...
45 {node{2}, node{3}, node{4}}, struct('solver','mva','verbose',false));
46
47fprintf('NC (FES model):\n');
48AvgNC = SolverNC(fesModel, 'method', 'exact').getAvgTable;
49disp(AvgNC);