LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
spn_pareto_service.m
1clear P T R solver AvgTable jobclass
2
3model = Network('model');
4
5%% Nodes
6source = Source(model,'Source');
7sink = Sink(model,'Sink');
8
9P{1} = Place(model, 'P1');
10
11T{1} = Transition(model, 'T1');
12
13% Source
14jobclass{1} = OpenClass(model, 'Class1', 0);
15source.setArrival(jobclass{1}, Exp(0.5)); % arrival rate 0.5
16
17%% Parameterisation
18
19% T1 with Pareto service time
20% Pareto(shape, scale) - shape must be >= 2
21% With shape=3 and scale=1, mean service time = 3*1/(3-1) = 1.5
22mode = T{1}.addMode('Mode1');
23T{1}.setNumberOfServers(mode, 1);
24T{1}.setDistribution(mode, Pareto(3, 1)); % Pareto with shape=3, scale=1
25T{1}.setEnablingConditions(mode, jobclass{1}, P{1}, 1);
26T{1}.setFiringOutcome(mode, jobclass{1}, sink, 1);
27
28% Routing
29R = model.initRoutingMatrix(); % initialize routing matrix
30
31R{1,1}(source, P{1}) = 1; % (Source,Class1) -> (P1,Class1)
32R{1,1}(P{1}, T{1}) = 1;
33R{1,1}(T{1}, sink) = 1;
34
35model.link(R);
36
37%% Solver
38options = Solver.defaultOptions;
39options.verbose = 1;
40options.seed = 23000;
41options.samples = 1e4; % limit samples for faster execution
42
43solver = {};
44solver{1} = JMT(model, options);
45AvgTable{1} = solver{1}.getAvgTable();
46AvgTable{1}