LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
SolverCustom.m
1classdef SolverCustom < NetworkSolver
2 % Example of custom solver
3 %
4 % Copyright (c) 2012-2026, Imperial College London
5 % All rights reserved.
6
7 methods
8 function self = SolverCustom(model,varargin)
9 % SELF = SolverCustom(MODEL,VARARGIN)
10
11 self@NetworkSolver(model, mfilename);
12 self.setOptions(Solver.parseOptions(varargin, self.defaultOptions));
13 end
14
15 runtime = run(self)
16
17 function sn = getStruct(self)
18 % QN = GETSTRUCT()
19
20 % Get data structure summarizing the model
21 sn = self.model.getStruct(false);
22 end
23
24 [runtime, analyzer] = runAnalyzer(self, options);
25
26 function [allMethods] = listValidMethods(self)
27 % allMethods = LISTVALIDMETHODS()
28 % List valid methods for this solver
29 sn = self.model.getStruct();
30 allMethods = {'default'};
31 end
32 end
33
34 methods (Static)
35
36 function featSupported = getFeatureSet()
37 % FEATSUPPORTED = GETFEATURESET()
38
39 featSupported = SolverFeatureSet;
40 featSupported.setTrue({'Sink',...
41 'Source',...
42 'Router',...
43 'ClassSwitch',...
44 'DelayStation',...
45 'Queue',...
46 'Fork',...
47 'Join',...
48 'Forker',...
49 'Joiner',...
50 'Logger',...
51 'Coxian',...
52 'Cox2',...
53 'APH',...
54 'Erlang',...
55 'Exp',...
56 'HyperExp',...
57 'Det',...
58 'Gamma',...
59 'Lognormal',...
60 'MAP',...
61 'MMPP2',...
62 'Normal',...
63 'PH',...
64 'Pareto',...
65 'Weibull',...
66 'Replayer',...
67 'Uniform',...
68 'StatelessClassSwitcher',...
69 'InfiniteServer',...
70 'SharedServer',...
71 'Buffer',...
72 'Dispatcher',...
73 'Server',...
74 'JobSink',...
75 'RandomSource',...
76 'ServiceTunnel',...
77 'LogTunnel',...
78 'Buffer', ...
79 'Linkage',...
80 'Enabling', ...
81 'Timing', ...
82 'Firing', ...
83 'Storage', ...
84 'Place', ...
85 'Transition', ...
86 'SchedStrategy_INF',...
87 'SchedStrategy_PS',...
88 'SchedStrategy_DPS',...
89 'SchedStrategy_FCFS',...
90 'SchedStrategy_GPS',...
91 'SchedStrategy_SIRO',...
92 'SchedStrategy_HOL',...
93 'SchedStrategy_LCFS',...
94 'SchedStrategy_LCFSPR',...
95 'SchedStrategy_SEPT',...
96 'SchedStrategy_LEPT',...
97 'SchedStrategy_SJF',...
98 'SchedStrategy_LJF',...
99 'RoutingStrategy_PROB',...
100 'RoutingStrategy_RAND',...
101 'RoutingStrategy_RROBIN',...
102 'RoutingStrategy_WRROBIN',...
103 'RoutingStrategy_KCHOICES',...
104 'SchedStrategy_EXT',...
105 'ClosedClass',...
106 'OpenClass'});
107 end
108
109 function [bool, featSupported] = supports(model)
110 % [BOOL, FEATSUPPORTED] = SUPPORTS(MODEL)
111
112 featUsed = model.getUsedLangFeatures();
113 featSupported = SolverCustom.getFeatureSet();
114 bool = SolverFeatureSet.supports(featSupported, featUsed);
115 end
116 end
117
118 methods (Static)
119 function options = defaultOptions()
120 % OPTIONS = DEFAULTOPTIONS()
121
122 options = Solver.defaultOptions();
123 options.timespan = [Inf,Inf];
124 end
125 end
126end