4model = Network(
'model');
6node{1} = Delay(model,
'Delay');
7node{2} = Queue(model,
'Queue1', SchedStrategy.PS);
8jobclass{1} = ClosedClass(model,
'Class1', 2, node{1}, 0);
9jobclass{2} = ClosedClass(model,
'Class2', 3, node{1}, 0);
11node{1}.setService(
jobclass{1}, Exp.fitMean(1.0));
12node{1}.setService(
jobclass{2}, Exp.fitMean(1.0));
14node{2}.setService(
jobclass{1}, Exp(NaN)); % NaN = to be estimated
15node{2}.setService(
jobclass{2}, Exp(NaN)); % NaN = to be estimated
17P = model.initRoutingMatrix;
22%% Generate random dataset
for queue-lengths
25% synthetic queue-length data consistent with PS demands of 0.2 and 0.4
26qlen1_samples = 0.3 * ones(n,1) + rand(n,1) * 0.1;
27qlen2_samples = 0.8 * ones(n,1) + rand(n,1) * 0.1;
29%% Estimate demands
using QMLE
30options = ParamEstimator.defaultOptions;
31options.method =
'qmle';
32se = ParamEstimator(model, options);
34ql1 = SampledMetric(MetricType.QLen, ts, qlen1_samples, node{2},
jobclass{1});
35ql2 = SampledMetric(MetricType.QLen, ts, qlen2_samples, node{2},
jobclass{2});
40estVal = se.estimateAt(node{2})
44solver{end+1} = SolverMVA(model);
46AvgTable = cell(1,length(solver));
48 fprintf(1,
'SOLVER: %s\n',solver{s}.getName());
49 AvgTable{s} = solver{s}.getAvgTable();