3model = Network(
'model');
5node{1} = Delay(model,
'Delay');
6node{2} = Queue(model,
'Queue1', SchedStrategy.PS);
7node{3} = Queue(model,
'Queue2', SchedStrategy.PS);
8node{3}.setNumServers(2);
11jobclass{1} = ClosedClass(model,
'Class1', N(1), node{1}, 0);
12jobclass{2} = ClosedClass(model,
'Class2', N(2), node{1}, 0);
14node{1}.setService(
jobclass{1}, Exp(1));
15node{1}.setService(
jobclass{2}, Exp(1));
17node{2}.setService(
jobclass{1}, Exp(3));
18node{2}.setService(
jobclass{2}, Exp(4));
20node{3}.setService(
jobclass{1}, Exp(1));
21node{3}.setService(
jobclass{2}, Exp(3));
26P{1} = [0,1,0; 0,0,1; 1,0,0];
27P{2} = [0,1,0; 0,0,1; 1,0,0];
31M = model.getNumberOfStations();
32K = model.getNumberOfClasses();
34% This part illustrates the execution of different solvers
35fprintf(1,
'This example illustrates the calculation of probabilities via normalizing constants.\n')
37options = Solver.defaultOptions;
44 0, 0]; % rows set to -1 are ignored in the calculation of the marginal probabilities
47 node{i}.setState(n(i,:));
49state = model.getState;
53solver = CTMC(model,options);
54Pr = solver.getProbAggr(node{i});
55fprintf(1,
'Station %d is in state %s with probability %d\n',i,mat2str(state{i}),Pr);
58solver = NC(model,options);
59Pr = solver.getProbAggr(node{i});
60fprintf(1,
'Station %d is in state %s with probability %d\n',i,mat2str(state{i}),Pr);