1classdef SolverFeatureSet < handle
2 % An auxiliary
class to specify the features supported by a solver.
4 % Copyright (c) 2012-2026, Imperial College London
8 list; % list of features
12 fields = {
'ClassSwitch',...
42 'StatelessClassSwitcher',...
43 'CacheClassSwitcher',...
60 'RoutingStrategy_PROB', ...
61 'RoutingStrategy_RAND', ...
62 'RoutingStrategy_RROBIN', ...
63 'RoutingStrategy_WRROBIN', ...
64 'RoutingStrategy_KCHOICES', ...
65 'SchedStrategy_INF', ...
66 'SchedStrategy_FCFS', ...
67 'SchedStrategy_LCFS', ...
68 'SchedStrategy_LCFSPI', ...
69 'SchedStrategy_LCFSPR', ...
70 'SchedStrategy_SEPT', ...
71 'SchedStrategy_LEPT', ...
72 'SchedStrategy_DPS', ...
73 'SchedStrategy_GPS', ...
74 'SchedStrategy_LJF', ...
75 'SchedStrategy_LPS', ...
76 'SchedStrategy_SJF', ...
77 'SchedStrategy_SRPT', ...
78 'SchedStrategy_SRPTPRIO', ...
79 'SchedStrategy_PS', ...
80 'SchedStrategy_SIRO', ...
81 'SchedStrategy_HOL', ...
82 'SchedStrategy_EXT', ...
83 'SchedStrategy_POLLING', ...
84 'ReplacementStrategy_RR', ...
85 'ReplacementStrategy_FIFO', ...
86 'ReplacementStrategy_SFIFO', ...
87 'ReplacementStrategy_LRU', ...
93 function self = SolverFeatureSet()
94 % SELF = SOLVERFEATURESET()
97 fields = SolverFeatureSet.fields;
98 for f=1:length(fields)
99 self.list.(fields{f})=
false;
103 function self = setTrue(self, feature)
104 % SELF = SETTRUE(FEATURE)
107 for c=1:length(feature)
108 self.setTrue(feature{c});
111 if ~strcmpi(feature,
'char') % ignore empty sections
112 self.list.(feature) =
true;
117 function self = setFalse(self, feature)
118 % SELF = SETFALSE(FEATURE)
121 for c=1:length(feature)
122 self.setFalse(feature{c});
125 self.list.(feature) =
false;
132 function
bool = supports(featSupportedList, featUsedList)
133 % BOOL = SUPPORTS(FEATSUPPORTEDLIST, FEATUSEDLIST)
139 fields = SolverFeatureSet.fields;
140 for f=1:length(fields)
141 if featUsedList.list.(fields{f}) > featSupportedList.list.(fields{f})
143 unsupported{end+1} = fields{f}; %#ok<AGROW>
147 if ~isempty(unsupported)
148 str=
'Some features are not supported by the chosen solver (feature: ';
149 for u=1:length(unsupported)
151 str = sprintf(
'%s%s',str,unsupported{u});
153 str = sprintf(
'%s, %s',str,unsupported{u});
156 str = sprintf(
'%s).\n',str);
157 line_warning(mfilename,str);