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 'Normal',...
36 'Pareto',...
37 'PH',...
38 'Replayer',...
39 'Trace',...
40 'Uniform', ...
41 'Weibull',...
42 'StatelessClassSwitcher',...
43 'CacheClassSwitcher',...
44 'InfiniteServer',...
45 'Forker',...
46 'Joiner',...
47 'LogTunnel', ...
48 'SharedServer', ...
49 'Buffer', ...
50 'Linkage',...
51 'Enabling', ...
52 'Timing', ...
53 'Firing', ...
54 'Storage', ...
55 'Timing', ...
56 'RandomSource', ...
57 'Dispatcher', ...
58 'Server', ...
59 'ServiceTunnel', ...
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', ...
88 'ClosedClass', ...
89 'OpenClass'};
90 end
91
92 methods
93 function self = SolverFeatureSet()
94 % SELF = SOLVERFEATURESET()
95
96 % Nodes and Stations
97 fields = SolverFeatureSet.fields;
98 for f=1:length(fields)
99 self.list.(fields{f})=false;
100 end
101 end
102
103 function self = setTrue(self, feature)
104 % SELF = SETTRUE(FEATURE)
105
106 if iscell(feature)
107 for c=1:length(feature)
108 self.setTrue(feature{c});
109 end
110 else
111 if ~strcmpi(feature,'char') % ignore empty sections
112 self.list.(feature) = true;
113 end
114 end
115 end
116
117 function self = setFalse(self, feature)
118 % SELF = SETFALSE(FEATURE)
119
120 if iscell(feature)
121 for c=1:length(feature)
122 self.setFalse(feature{c});
123 end
124 else
125 self.list.(feature) = false;
126 end
127 end
128
129 end
130
131 methods(Static)
132 function bool = supports(featSupportedList, featUsedList)
133 % BOOL = SUPPORTS(FEATSUPPORTEDLIST, FEATUSEDLIST)
134
135 bool = true;
136 unsupported = {};
137
138 % Nodes and Stations
139 fields = SolverFeatureSet.fields;
140 for f=1:length(fields)
141 if featUsedList.list.(fields{f}) > featSupportedList.list.(fields{f})
142 bool = false;
143 unsupported{end+1} = fields{f}; %#ok<AGROW>
144 end
145 end
146
147 if ~isempty(unsupported)
148 str='Some features are not supported by the chosen solver (feature: ';
149 for u=1:length(unsupported)
150 if u==1
151 str = sprintf('%s%s',str,unsupported{u});
152 else
153 str = sprintf('%s, %s',str,unsupported{u});
154 end
155 end
156 str = sprintf('%s).\n',str);
157 line_warning(mfilename,str);
158 end
159 end
160 end
161end