LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
init_state_ps.m
1clear node jobclass solver AvgTable
2model = Network('model');
3
4node{1} = Delay(model, 'InfiniteServer');
5node{2} = Queue(model, 'Queue1', SchedStrategy.PS);
6node{2}.setNumServers(2);
7
8jobclass{1} = ClosedClass(model, 'Class1', 3, node{1}, 0);
9jobclass{2} = ClosedClass(model, 'Class2', 1, node{1}, 0);
10
11node{1}.setService(jobclass{1}, Exp(3));
12node{1}.setService(jobclass{2}, Exp(0.5));
13
14node{2}.setService(jobclass{1}, Exp(0.1));
15node{2}.setService(jobclass{2}, Exp(1));
16
17M = model.getNumberOfStations();
18K = model.getNumberOfClasses();
19
20P = cell(K,K);
21P{1,1} = [0.3,0.1; 0.2,0];
22P{1,2} = [0.6,0; 0.8,0];
23P{2,2} = [0,1; 0,0];
24P{2,1} = [0,0; 1,0];
25
26model.link(P);
27model.initFromMarginalAndStarted([2,1;1,0],[0,0;1,0]);
28
29options = Solver.defaultOptions;
30options.verbose = 1;
31options.seed = 23000;
32options.samples = 1e5;
33
34disp('This example shows the execution of the solver on a 2-class 2-node class-switching model with specified initial state.')
35% This part illustrates the execution of different solvers
36solver{1} = CTMC(model,options);
37solver{end+1} = JMT(model,options);
38solver{end+1} = SSA(model,options);
39solver{end+1} = FLD(model,options);
40solver{end+1} = MVA(model,options);
41solver{end+1} = NC(model,options);
42for s=1:length(solver)
43 fprintf(1,'SOLVER: %s\n',solver{s}.getName());
44 AvgTable{s} = solver{s}.getAvgTable();
45 AvgTable{s}
46end