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 % Canonical feature-name registry; must stay identical to
13 % jar FeatureSet.java and python base.py SolverFeatureSet.FIELDS
14 fields = {'ClassSwitch',...
15 'Cache', ...
16 'Delay', ...
17 'DelayStation',...
18 'Fork',...
19 'Join',...
20 'Logger',...
21 'Place', ...
22 'QueueingPlace', ...
23 'Queue', ...
24 'JobSink',...
25 'Sink',...
26 'Source',...
27 'Router',...
28 'Transition', ...
29 'Coxian',...
30 'Cox2',...
31 'APH',...
32 'Det', ...
33 'Disabled',...
34 'Erlang',...
35 'Exp',...
36 'Gamma',...
37 'HyperExp', ...
38 'Immediate',...
39 'Lognormal',...
40 'MAP',...
41 'DMAP',...
42 'MMAP',...
43 'BMAP',...
44 'MMPP2',...
45 'NHPP',...
46 'EmpiricalCdf',... % name declared by EmpiricalCDF.m, not the JSON wire type
47 'Expolynomial',...
48 'Normal',...
49 'Pareto',...
50 'PH',...
51 'ME',...
52 'RAP',...
53 'Replayer',...
54 'Trace',...
55 'Uniform', ...
56 'Weibull',...
57 'StatelessClassSwitcher',...
58 'CacheClassSwitcher',...
59 'CacheRetrieval',...
60 'InfiniteServer',...
61 'Forker',...
62 'Joiner',...
63 'LogTunnel', ...
64 'SharedServer', ...
65 'Buffer', ...
66 'Region', ...
67 'Linkage',...
68 'Enabling', ...
69 'Inhibiting', ...
70 'Timing', ...
71 'Firing', ...
72 'Storage', ...
73 'RandomSource', ...
74 'Dispatcher', ...
75 'Server', ...
76 'ServiceTunnel', ...
77 'RoutingStrategy_PROB', ...
78 'RoutingStrategy_RAND', ...
79 'RoutingStrategy_RROBIN', ...
80 'RoutingStrategy_WRROBIN', ...
81 'RoutingStrategy_JSQ', ...
82 'RoutingStrategy_KCHOICES', ...
83 'RoutingStrategy_RL', ...
84 'SchedStrategy_INF', ...
85 'SchedStrategy_FCFS', ...
86 'SchedStrategy_FCFSPR', ...
87 'SchedStrategy_FCFSPI', ...
88 'SchedStrategy_FCFSPRIO', ...
89 'SchedStrategy_FCFSPRPRIO', ...
90 'SchedStrategy_FCFSPIPRIO', ...
91 'SchedStrategy_LCFS', ...
92 'SchedStrategy_LCFSPR', ...
93 'SchedStrategy_LCFSPI', ...
94 'SchedStrategy_LCFSPRIO', ...
95 'SchedStrategy_LCFSPRPRIO', ...
96 'SchedStrategy_LCFSPIPRIO', ...
97 'SchedStrategy_SEPT', ...
98 'SchedStrategy_LEPT', ...
99 'SchedStrategy_SJF', ...
100 'SchedStrategy_LJF', ...
101 'SchedStrategy_SRPT', ...
102 'SchedStrategy_SRPTPRIO', ...
103 'SchedStrategy_PSJF', ...
104 'SchedStrategy_FB', ...
105 'SchedStrategy_LRPT', ...
106 'SchedStrategy_SETF', ...
107 'SchedStrategy_FSP', ...
108 'SchedStrategy_PAS', ...
109 'SchedStrategy_OI', ...
110 'SchedStrategy_PS', ...
111 'SchedStrategy_DPS', ...
112 'SchedStrategy_GPS', ...
113 'SchedStrategy_PSPRIO', ...
114 'SchedStrategy_DPSPRIO', ...
115 'SchedStrategy_GPSPRIO', ...
116 'SchedStrategy_SIRO', ...
117 'SchedStrategy_HOL', ...
118 'SchedStrategy_EXT', ...
119 'SchedStrategy_POLLING', ...
120 'SchedStrategy_EDD', ...
121 'SchedStrategy_EDF', ...
122 'SchedStrategy_LPS', ...
123 'ReplacementStrategy_RR', ...
124 'ReplacementStrategy_FIFO', ...
125 'ReplacementStrategy_SFIFO', ...
126 'ReplacementStrategy_LRU', ...
127 'ReplacementStrategy_HLRU', ...
128 'ReplacementStrategy_CLIMB', ...
129 'ReplacementStrategy_QLRU', ...
130 'ClosedClass', ...
131 'OpenClass', ...
132 'SelfLoopingClass', ...
133 'OpenSignal', ...
134 'ClosedSignal', ...
135 'SignalType_NEGATIVE', ...
136 'SignalType_REPLY', ...
137 'SignalType_CATASTROPHE', ...
138 'SignalBatchRemoval', ...
139 'SignalRemovalPolicy', ...
140 'LoadDependence', ...
141 'ClassDependence', ...
142 'SetupDelayOff', ...
143 'Retrial', ...
144 'Balking', ...
145 'Reneging', ...
146 'Host', ...
147 'Processor', ...
148 'Task', ...
149 'Entry', ...
150 'Activity', ...
151 'SyncCall', ...
152 'AsyncCall', ...
153 'ActivityPrecedence_PRE_SEQ', ...
154 'ActivityPrecedence_POST_SEQ', ...
155 'ActivityPrecedence_PRE_AND', ...
156 'ActivityPrecedence_POST_AND', ...
157 'ActivityPrecedence_PRE_OR', ...
158 'ActivityPrecedence_POST_OR', ...
159 'SchedStrategy_REF'};
160 end
161
162 methods
163 function self = SolverFeatureSet()
164 % SELF = SOLVERFEATURESET()
165
166 % Nodes and Stations
167 fields = SolverFeatureSet.fields;
168 for f=1:length(fields)
169 self.list.(fields{f})=false;
170 end
171 end
172
173 function self = setTrue(self, feature)
174 % SELF = SETTRUE(FEATURE)
175
176 if iscell(feature)
177 for c=1:length(feature)
178 self.setTrue(feature{c});
179 end
180 else
181 if ~strcmpi(feature,'char') % ignore empty sections
182 self.list.(feature) = true;
183 end
184 end
185 end
186
187 function self = setFalse(self, feature)
188 % SELF = SETFALSE(FEATURE)
189
190 if iscell(feature)
191 for c=1:length(feature)
192 self.setFalse(feature{c});
193 end
194 else
195 self.list.(feature) = false;
196 end
197 end
198
199 end
200
201 methods(Static)
202 function [bool, reason] = supports(featSupportedList, featUsedList)
203 % [BOOL, REASON] = SUPPORTS(FEATSUPPORTEDLIST, FEATUSEDLIST)
204 %
205 % BOOL is true when every feature used by the model is supported.
206 % REASON is a human-readable list of the offending feature names
207 % (empty when BOOL is true), for use in method-aware error messages.
208
209 bool = true;
210 unsupported = {};
211
212 % Nodes and Stations
213 fields = SolverFeatureSet.fields;
214 for f=1:length(fields)
215 if featUsedList.list.(fields{f}) > featSupportedList.list.(fields{f})
216 bool = false;
217 unsupported{end+1} = fields{f}; %#ok<AGROW>
218 end
219 end
220
221 reason = '';
222 if ~isempty(unsupported)
223 str='Some features are not supported by the chosen solver (feature: ';
224 for u=1:length(unsupported)
225 if u==1
226 str = sprintf('%s%s',str,unsupported{u});
227 else
228 str = sprintf('%s, %s',str,unsupported{u});
229 end
230 end
231 str = sprintf('%s).\n',str);
232 reason = str;
233 % Preserve the historical side-effect warning for the coarse
234 % (solver-level) callers that do not consume REASON.
235 if nargout < 2
236 line_warning(mfilename,str);
237 end
238 end
239 end
240 end
241end
Definition Station.m:245