LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
SolverFeatureSet.m
1classdef SolverFeatureSet < handle
2 % An auxiliary class to specify the features supported by a solver.
3 %
4 % Copyright (c) 2012-2026, Imperial College London
5 % All rights reserved.
6
7 properties
8 list; % list of features
9 end
10
11 properties (Constant)
12 fields = {'ClassSwitch',...
13 'Cache', ...
14 'Delay', ...
15 'DelayStation',...
16 'Fork',...
17 'Join',...
18 'Logger',...
19 'Place', ...
20 'Queue', ...
21 'Sink',...
22 'Source',...
23 'Router',...
24 'Transition', ...
25 'Cox2',...
26 'APH',...
27 'Det', ...
28 'Erlang',...
29 'Exp',...
30 'Gamma',...
31 'HyperExp', ...
32 'Lognormal',...
33 'MAP',...
34 'MMPP2',...
35 'CyclicPoisson',...
36 'Normal',...
37 'Pareto',...
38 'PH',...
39 'Replayer',...
40 'Trace',...
41 'Uniform', ...
42 'Weibull',...
43 'StatelessClassSwitcher',...
44 'CacheClassSwitcher',...
45 'InfiniteServer',...
46 'Forker',...
47 'Joiner',...
48 'LogTunnel', ...
49 'SharedServer', ...
50 'Buffer', ...
51 'Linkage',...
52 'Enabling', ...
53 'Timing', ...
54 'Firing', ...
55 'Storage', ...
56 'Timing', ...
57 'RandomSource', ...
58 'Dispatcher', ...
59 'Server', ...
60 'ServiceTunnel', ...
61 'RoutingStrategy_PROB', ...
62 'RoutingStrategy_RAND', ...
63 'RoutingStrategy_RROBIN', ...
64 'RoutingStrategy_WRROBIN', ...
65 'RoutingStrategy_KCHOICES', ...
66 'SchedStrategy_INF', ...
67 'SchedStrategy_FCFS', ...
68 'SchedStrategy_LCFS', ...
69 'SchedStrategy_LCFSPI', ...
70 'SchedStrategy_LCFSPR', ...
71 'SchedStrategy_FCFSPR', ...
72 'SchedStrategy_FCFSPI', ...
73 'SchedStrategy_SEPT', ...
74 'SchedStrategy_LEPT', ...
75 'SchedStrategy_DPS', ...
76 'SchedStrategy_GPS', ...
77 'SchedStrategy_LJF', ...
78 'SchedStrategy_LPS', ...
79 'SchedStrategy_SJF', ...
80 'SchedStrategy_SRPT', ...
81 'SchedStrategy_SRPTPRIO', ...
82 'SchedStrategy_PS', ...
83 'SchedStrategy_SIRO', ...
84 'SchedStrategy_HOL', ...
85 'SchedStrategy_EXT', ...
86 'SchedStrategy_POLLING', ...
87 'ReplacementStrategy_RR', ...
88 'ReplacementStrategy_FIFO', ...
89 'ReplacementStrategy_SFIFO', ...
90 'ReplacementStrategy_LRU', ...
91 'ClosedClass', ...
92 'OpenClass'};
93 end
94
95 methods
96 function self = SolverFeatureSet()
97 % SELF = SOLVERFEATURESET()
98
99 % Nodes and Stations
100 fields = SolverFeatureSet.fields;
101 for f=1:length(fields)
102 self.list.(fields{f})=false;
103 end
104 end
105
106 function self = setTrue(self, feature)
107 % SELF = SETTRUE(FEATURE)
108
109 if iscell(feature)
110 for c=1:length(feature)
111 self.setTrue(feature{c});
112 end
113 else
114 if ~strcmpi(feature,'char') % ignore empty sections
115 self.list.(feature) = true;
116 end
117 end
118 end
119
120 function self = setFalse(self, feature)
121 % SELF = SETFALSE(FEATURE)
122
123 if iscell(feature)
124 for c=1:length(feature)
125 self.setFalse(feature{c});
126 end
127 else
128 self.list.(feature) = false;
129 end
130 end
131
132 end
133
134 methods(Static)
135 function bool = supports(featSupportedList, featUsedList)
136 % BOOL = SUPPORTS(FEATSUPPORTEDLIST, FEATUSEDLIST)
137
138 bool = true;
139 unsupported = {};
140
141 % Nodes and Stations
142 fields = SolverFeatureSet.fields;
143 for f=1:length(fields)
144 if featUsedList.list.(fields{f}) > featSupportedList.list.(fields{f})
145 bool = false;
146 unsupported{end+1} = fields{f}; %#ok<AGROW>
147 end
148 end
149
150 if ~isempty(unsupported)
151 str='Some features are not supported by the chosen solver (feature: ';
152 for u=1:length(unsupported)
153 if u==1
154 str = sprintf('%s%s',str,unsupported{u});
155 else
156 str = sprintf('%s, %s',str,unsupported{u});
157 end
158 end
159 str = sprintf('%s).\n',str);
160 line_warning(mfilename,str);
161 end
162 end
163 end
164end