3model = Network(
'model');
5node{1} = Delay(model,
'Delay');
6node{2} = Queue(model,
'Queue1', SchedStrategy.FCFS);
7jobclass{1} = ClosedClass(model,
'Class1', 5, node{2}, 0);
9node{1}.setService(
jobclass{1}, Exp(1));
10node{2}.setService(
jobclass{1}, Exp(0.7));
12M = model.getNumberOfStations();
13K = model.getNumberOfClasses();
19[Qt,Ut,Tt] = model.getTranHandles();
20options = Solver.defaultOptions;
24options.timespan = [0,40];
26%% This part illustrates the execution of different solvers
28solver{end+1} = CTMC(model,options);
29%solver{end+1} = JMT(model,options);
30%solver{end+1} = SSA(model,options);
31solver{end+1} = FLD(model,options);
32%solver{end+1} = MVA(model,options);
37disp(
'Prior 1: prior all on default initialization')
38disp('Initial state
is:')
39state=model.getState();
40[state{1}(1,:),state{2}(1,:)]
42 fprintf(1,
'SOLVER: %s\n',solver{s}.getName());
43 [QNt,UNt,TNt] = solver{s}.getTranAvg(Qt,Ut,Tt);
45 plot(QNt{2,1}.t,QNt{2,1}.metric,dashing{s}); hold on
48title(
'Prior on default state');
49ylabel(
'Queue length - station 2, class 1');
53legend('ctmc','fluid','Location','SouthEast')
56model.initFromMarginal([2;3]);
57disp('Prior 2: prior all on first found state with given marginal')
58disp('Initial state
is:')
59state=model.getState();
60[state{1}(1,:),state{2}(1,:)]
63 fprintf(1,
'SOLVER: %s\n',solver{s}.getName());
64 [QNt_marg,UNt_marg,TNt_marg] = solver{s}.getTranAvg(Qt,Ut,Tt);
66 plot(QNt_marg{2,1}.t,QNt_marg{2,1}.metric,dashing{s}); hold on
69title(
'Prior on state with 3 jobs in station 2');
70ylabel(
'Queue length - station 2, class 1');
74%legend('ctmc','fluid')