LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
oqn_basic.m
1clear node jobclass solver AvgTable
2
3model = Network('model');
4
5node{1} = Delay(model, 'Delay');
6node{2} = Queue(model, 'Queue1', SchedStrategy.FCFS);
7node{3} = Source(model,'Source');
8node{4} = Sink(model,'Sink');
9
10jobclass{1} = OpenClass(model, 'Class1', 0);
11
12node{1}.setService(jobclass{1}, HyperExp(0.5,3.0,10.0));
13node{2}.setService(jobclass{1}, Exp(1));
14node{3}.setArrival(jobclass{1}, Exp(0.1));
15
16M = model.getNumberOfStations();
17K = model.getNumberOfClasses();
18
19P = cell(K,K);
20P{1,1} = [0,1,0,0; 0,0,0,1; 1,0,0,0; 0,0,0,0];
21
22model.link(P);
23%%
24options = Solver.defaultOptions;
25options.keep=true;
26options.verbose=1;
27options.cutoff = 10;
28options.seed = 23000;
29options.iter_max = 200;
30%options.samples=2e4;
31
32disp('This example shows the execution of the solver on a 1-class 2-node open model.')
33% This part illustrates the execution of different solvers
34solver={};
35solver{end+1} = CTMC(model,options); % CTMC is infinite on this model
36solver{end+1} = FLD(model,options);
37solver{end+1} = MVA(model,options);
38solver{end+1} = MAM(model,options);
39solver{end+1} = NC(model,options);
40solver{end+1} = JMT(model,options);
41solver{end+1} = SSA(model,options);
42solver{end+1} = DES(model,options);
43for s=1:length(solver)
44 fprintf(1,'SOLVER: %s\n',solver{s}.getName());
45 AvgTable{s} = solver{s}.getAvgTable();
46 AvgTable{s}
47end