LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
lqn_multi_solvers.m
1clear solver AvgTable
2
3model = LayeredNetwork('LQN1');
4
5% definition of processors, tasks and entries
6P1 = Processor(model, 'P1', Inf, SchedStrategy.INF);
7T1 = Task(model, 'T1', 1, SchedStrategy.REF).on(P1);
8E1 = Entry(model, 'E1').on(T1);
9
10P2 = Processor(model, 'P2', Inf, SchedStrategy.INF);
11T2 = Task(model, 'T2', Inf, SchedStrategy.INF).on(P2);
12E2 = Entry(model, 'E2').on(T2);
13
14% definition of activities
15T1.setThinkTime(Erlang.fitMeanAndOrder(0.0001,2));
16
17A1 = Activity(model, 'A1', Exp(1.0)).on(T1).boundTo(E1).synchCall(E2,3);
18A2 = Activity(model, 'A2', APH.fitMeanAndSCV(1,10)).on(T2).boundTo(E2).repliesTo(E2);
19
20%%
21% instantiate solvers
22options = LQNS.defaultOptions;
23options.keep = true;
24options.verbose = 1;
25%options.method = 'lqsim';
26%options.samples = 1e4;
27lqnssolver = LQNS(model, options);
28AvgTableLQNS = lqnssolver.getAvgTable;
29AvgTableLQNS
30
31% this method runs the MVA solver in each layer
32lnoptions = LN.defaultOptions;
33lnoptions.verbose = 0;
34lnoptions.seed = 2300;
35options = MVA.defaultOptions;
36options.verbose = 0;
37solver{1} = LN(model, @(model) MVA(model, options), lnoptions);
38AvgTable{1} = solver{1}.getAvgTable
39AvgTable{1}
40
41% this method runs the NC solver in each layer
42lnoptions = LN.defaultOptions;
43lnoptions.verbose = 0;
44lnoptions.seed = 2300;
45options = NC.defaultOptions;
46options.verbose = 0;
47solver{2} = LN(model, @(model) NC(model, options), lnoptions);
48AvgTable{2} = solver{2}.getAvgTable
49AvgTable{2}
50
51% this method adapts with the features of each layer
52%solver{2} = LN(model, @(model) LINE(model, LINE.defaultOptions), lnoptions);
53%AvgTable{2} = solver{2}.getAvgTable
54%AvgTable{2}