LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
SchedStrategy.m
1classdef (Sealed) SchedStrategy
2 % SchedStrategy Enumeration of queueing scheduling disciplines and strategies
3 %
4 % SchedStrategy defines constants for all supported scheduling disciplines
5 % in LINE queueing systems. These strategies determine the order in which
6 % jobs are selected for service from queues, affecting system performance
7 % and fairness characteristics.
8 %
9 % @brief Comprehensive enumeration of queueing scheduling disciplines
10 %
11 % Key scheduling categories:
12 % - Order-based: FCFS, LCFS, SIRO (service order policies)
13 % - Size-based: SJF, LJF, SEPT, LEPT (job length policies)
14 % - Sharing: PS, DPS, GPS (processor sharing variants)
15 % - Priority: HOL, PSPRIO, DPSPRIO, GPSPRIO (priority disciplines)
16 % - Special: INF, FORK, POLLING, EXT, REF (specialized strategies)
17 %
18 % Common scheduling strategies:
19 % - FCFS: First-Come-First-Served (FIFO)
20 % - LCFS: Last-Come-First-Served (LIFO/Stack)
21 % - PS: Processor Sharing (round-robin with infinitesimal time slices)
22 % - SJF: Shortest Job First (preemptive shortest remaining time)
23 % - HOL: Head-of-Line priority (non-preemptive priority)
24 % - INF: Infinite server (delay station, no queueing)
25 %
26 % SchedStrategy is used in:
27 % - Queue node configuration
28 % - Service discipline specification
29 % - Performance analysis parameterization
30 % - Model validation and compatibility checking
31 % - Solver method selection
32 %
33 % Example:
34 % @code
35 % queue1 = Queue(model, 'Server1', SchedStrategy.FCFS);
36 % queue2 = Queue(model, 'Server2', SchedStrategy.PS);
37 % delay = Queue(model, 'ThinkTime', SchedStrategy.INF);
38 % @endcode
39 %
40 % Copyright (c) 2012-2026, Imperial College London
41 % All rights reserved.
42
43 properties (Constant)
44 INF = 0;
45 FCFS = 1;
46 LCFS = 2;
47 SIRO = 3;
48 SJF = 4;
49 LJF = 5;
50 PS = 6;
51 DPS = 7;
52 GPS = 8;
53 SEPT = 9;
54 LEPT = 10;
55 HOL = 11;
56 FORK = 12;
57 EXT = 13;
58 REF = 14;
59 LCFSPR = 15;
60 POLLING = 16;
61 PSPRIO = 17;
62 DPSPRIO = 18;
63 GPSPRIO = 19;
64 LCFSPI = 20;
65 LCFSPRIO = 21;
66 LCFSPRPRIO = 22;
67 LCFSPIPRIO = 23;
68 FCFSPRIO = 11; % Alias for HOL
69 FCFSPR = 24;
70 FCFSPI = 25;
71 FCFSPRPRIO = 26;
72 FCFSPIPRIO = 27;
73 SRPT = 28;
74 SRPTPRIO = 29;
75 EDD = 30; % Earliest Due Date (non-preemptive)
76 EDF = 31; % Earliest Deadline First (preemptive)
77 LPS = 32; % Least Progress Scheduling
78 PSJF = 33; % Preemptive Shortest Job First (priority by original size)
79 FB = 34; % Feedback / Least Attained Service (priority by age)
80 LAS = 34; % Alias for FB (Least Attained Service)
81 LRPT = 35; % Longest Remaining Processing Time
82 SETF = 36; % Shortest Elapsed Time First (non-preemptive FB)
83 SET = 36; % Alias for SETF
84 FSP = 37; % Fair Sojourn Protocol (preemptive; ranks by virtual PS finish time)
85 PAS = 38; % Pass-and-swap (order-independent queue with class compatibility/swap graph)
86 OI = 39; % Order-independent queue (pass-and-swap specialization with empty/zero swap graph)
87 end
88
89 methods (Static)
90 function id = toId(type)
91 % ID = TOID(TYPE)
92 if isnumeric(type)
93 id = type;
94 else
95 line_error(mfilename, 'Invalid scheduling strategy type.');
96 end
97 end
98
99 function type = fromId(id)
100 % TYPE = FROMID(ID)
101 if ismember(id, [SchedStrategy.INF, SchedStrategy.FCFS, SchedStrategy.LCFS, ...
102 SchedStrategy.SIRO, SchedStrategy.SJF, SchedStrategy.LJF, ...
103 SchedStrategy.PS, SchedStrategy.DPS, SchedStrategy.GPS, ...
104 SchedStrategy.SEPT, SchedStrategy.LEPT, SchedStrategy.SRPT, SchedStrategy.SRPTPRIO, SchedStrategy.HOL, ...
105 SchedStrategy.FORK, SchedStrategy.EXT, SchedStrategy.REF, ...
106 SchedStrategy.LCFSPR, SchedStrategy.POLLING, ...
107 SchedStrategy.PSPRIO, SchedStrategy.DPSPRIO, SchedStrategy.GPSPRIO, ...
108 SchedStrategy.LCFSPI, SchedStrategy.LCFSPRIO, SchedStrategy.LCFSPRPRIO, SchedStrategy.LCFSPIPRIO, ...
109 SchedStrategy.FCFSPRIO, SchedStrategy.FCFSPR, SchedStrategy.FCFSPI, SchedStrategy.FCFSPRPRIO, SchedStrategy.FCFSPIPRIO, ...
110 SchedStrategy.EDD, SchedStrategy.EDF, SchedStrategy.LPS, ...
111 SchedStrategy.PSJF, SchedStrategy.FB, SchedStrategy.LRPT, SchedStrategy.SETF, ...
112 SchedStrategy.FSP, SchedStrategy.PAS, SchedStrategy.OI])
113 type = id;
114 else
115 line_error(mfilename, 'Unrecognized scheduling strategy ID.');
116 end
117 end
118
119 function text = toText(type)
120 % TEXT = TOTEXT(TYPE)
121 switch type
122 case SchedStrategy.INF
123 text = 'inf';
124 case SchedStrategy.FCFS
125 text = 'fcfs';
126 case SchedStrategy.FCFSPR
127 text = 'fcfspr';
128 case SchedStrategy.FCFSPI
129 text = 'fcfspi';
130 case SchedStrategy.LCFS
131 text = 'lcfs';
132 case SchedStrategy.SIRO
133 text = 'siro';
134 case SchedStrategy.SJF
135 text = 'sjf';
136 case SchedStrategy.LJF
137 text = 'ljf';
138 case SchedStrategy.PS
139 text = 'ps';
140 case SchedStrategy.DPS
141 text = 'dps';
142 case SchedStrategy.GPS
143 text = 'gps';
144 case SchedStrategy.SEPT
145 text = 'sept';
146 case SchedStrategy.LEPT
147 text = 'lept';
148 case SchedStrategy.SRPT
149 text = 'srpt';
150 case SchedStrategy.SRPTPRIO
151 text = 'srptprio';
152 case SchedStrategy.HOL
153 text = 'hol';
154 case SchedStrategy.FCFSPRIO
155 text = 'hol';
156 case SchedStrategy.FORK
157 text = 'fork';
158 case SchedStrategy.EXT
159 text = 'ext';
160 case SchedStrategy.REF
161 text = 'ref';
162 case SchedStrategy.LCFSPR
163 text = 'lcfspr';
164 case SchedStrategy.LCFSPI
165 text = 'lcfspi';
166 case SchedStrategy.LCFSPRIO
167 text = 'lcfsprio';
168 case SchedStrategy.LCFSPRPRIO
169 text = 'lcfsprprio';
170 case SchedStrategy.LCFSPIPRIO
171 text = 'lcfspiprio';
172 case SchedStrategy.FCFSPRPRIO
173 text = 'fcfsprprio';
174 case SchedStrategy.FCFSPIPRIO
175 text = 'fcfspiprio';
176 case SchedStrategy.POLLING
177 text = 'polling';
178 case SchedStrategy.PSPRIO
179 text = 'psprio';
180 case SchedStrategy.DPSPRIO
181 text = 'dpsprio';
182 case SchedStrategy.GPSPRIO
183 text = 'gpsprio';
184 case SchedStrategy.EDD
185 text = 'edd';
186 case SchedStrategy.EDF
187 text = 'edf';
188 case SchedStrategy.LPS
189 text = 'lps';
190 case SchedStrategy.PSJF
191 text = 'psjf';
192 case SchedStrategy.FB
193 text = 'fb';
194 case SchedStrategy.LRPT
195 text = 'lrpt';
196 case SchedStrategy.SETF
197 text = 'setf';
198 case SchedStrategy.FSP
199 text = 'fsp';
200 case SchedStrategy.PAS
201 text = 'pas';
202 case SchedStrategy.OI
203 text = 'oi';
204 otherwise
205 line_error(mfilename, 'Unrecognized scheduling strategy type.');
206 end
207 end
208
209 function type = fromText(text)
210 % TYPE = FROMTEXT(TEXT)
211 if iscell(text)
212 text = text{:};
213 end
214 switch lower(text)
215 case 'inf'
216 type = SchedStrategy.INF;
217 case 'fcfs'
218 type = SchedStrategy.FCFS;
219 case 'fcfspr'
220 type = SchedStrategy.FCFSPR;
221 case 'fcfspi'
222 type = SchedStrategy.FCFSPI;
223 case 'lcfs'
224 type = SchedStrategy.LCFS;
225 case 'siro'
226 type = SchedStrategy.SIRO;
227 case 'sjf'
228 type = SchedStrategy.SJF;
229 case 'ljf'
230 type = SchedStrategy.LJF;
231 case 'ps'
232 type = SchedStrategy.PS;
233 case 'dps'
234 type = SchedStrategy.DPS;
235 case 'gps'
236 type = SchedStrategy.GPS;
237 case 'sept'
238 type = SchedStrategy.SEPT;
239 case 'lept'
240 type = SchedStrategy.LEPT;
241 case 'srpt'
242 type = SchedStrategy.SRPT;
243 case 'srptprio'
244 type = SchedStrategy.SRPTPRIO;
245 case 'hol'
246 type = SchedStrategy.HOL;
247 case 'fcfsprio'
248 type = SchedStrategy.FCFSPRIO;
249 case 'fork'
250 type = SchedStrategy.FORK;
251 case 'ext'
252 type = SchedStrategy.EXT;
253 case 'ref'
254 type = SchedStrategy.REF;
255 case 'lcfspr'
256 type = SchedStrategy.LCFSPR;
257 case 'lcfspi'
258 type = SchedStrategy.LCFSPI;
259 case 'lcfsprio'
260 type = SchedStrategy.LCFSPRIO;
261 case 'lcfsprprio'
262 type = SchedStrategy.LCFSPRPRIO;
263 case 'lcfspiprio'
264 type = SchedStrategy.LCFSPIPRIO;
265 case 'fcfsprprio'
266 type = SchedStrategy.FCFSPRPRIO;
267 case 'fcfspiprio'
268 type = SchedStrategy.FCFSPIPRIO;
269 case 'polling'
270 type = SchedStrategy.POLLING;
271 case 'psprio'
272 type = SchedStrategy.PSPRIO;
273 case 'dpsprio'
274 type = SchedStrategy.DPSPRIO;
275 case 'gpsprio'
276 type = SchedStrategy.GPSPRIO;
277 case 'edd'
278 type = SchedStrategy.EDD;
279 case 'edf'
280 type = SchedStrategy.EDF;
281 case 'lps'
282 type = SchedStrategy.LPS;
283 case 'psjf'
284 type = SchedStrategy.PSJF;
285 case 'fb'
286 type = SchedStrategy.FB;
287 case 'las'
288 type = SchedStrategy.LAS;
289 case 'lrpt'
290 type = SchedStrategy.LRPT;
291 case 'setf'
292 type = SchedStrategy.SETF;
293 case 'set'
294 type = SchedStrategy.SET;
295 case 'fsp'
296 type = SchedStrategy.FSP;
297 case 'pas'
298 type = SchedStrategy.PAS;
299 case 'oi'
300 type = SchedStrategy.OI;
301 case 'pp'
302 % LQNS preemptive priority - maps to FCFS with preemptive resume priority
303 type = SchedStrategy.FCFSPRPRIO;
304 case 'cfs'
305 % LQNS completely fair scheduling - maps to Generalized Processor Sharing
306 type = SchedStrategy.GPS;
307 otherwise
308 line_error(mfilename, 'Unrecognized scheduling strategy text.');
309 end
310 end
311
312 function property = toProperty(text)
313 % PROPERTY = TOPROPERTY(TEXT)
314 if iscell(text)
315 text = text{:};
316 end
317 switch lower(text)
318 case 'inf'
319 property = 'INF';
320 case 'fcfs'
321 property = 'FCFS';
322 case 'fcfspr'
323 property = 'FCFSPR';
324 case 'fcfspi'
325 property = 'FCFSPI';
326 case 'lcfs'
327 property = 'LCFS';
328 case 'siro'
329 property = 'SIRO';
330 case 'sjf'
331 property = 'SJF';
332 case 'ljf'
333 property = 'LJF';
334 case 'ps'
335 property = 'PS';
336 case 'dps'
337 property = 'DPS';
338 case 'gps'
339 property = 'GPS';
340 case 'sept'
341 property = 'SEPT';
342 case 'lept'
343 property = 'LEPT';
344 case 'srpt'
345 property = 'SRPT';
346 case 'srptprio'
347 property = 'SRPTPRIO';
348 case 'hol'
349 property = 'HOL';
350 case 'fcfsprio'
351 property = 'FCFSPRIO';
352 case 'fork'
353 property = 'FORK';
354 case 'ext'
355 property = 'EXT';
356 case 'ref'
357 property = 'REF';
358 case 'lcfspr'
359 property = 'LCFSPR';
360 case 'lcfspi'
361 property = 'LCFSPI';
362 case 'lcfsprio'
363 property = 'LCFSPRIO';
364 case 'lcfsprprio'
365 property = 'LCFSPRPRIO';
366 case 'lcfspiprio'
367 property = 'LCFSPIPRIO';
368 case 'fcfsprprio'
369 property = 'FCFSPRPRIO';
370 case 'fcfspiprio'
371 property = 'FCFSPIPRIO';
372 case 'polling'
373 property = 'POLLING';
374 case 'psprio'
375 property = 'PSPRIO';
376 case 'dpsprio'
377 property = 'DPSPRIO';
378 case 'gpsprio'
379 property = 'GPSPRIO';
380 case 'edd'
381 property = 'EDD';
382 case 'edf'
383 property = 'EDF';
384 case 'lps'
385 property = 'LPS';
386 case 'psjf'
387 property = 'PSJF';
388 case 'fb'
389 property = 'FB';
390 case 'las'
391 property = 'LAS';
392 case 'lrpt'
393 property = 'LRPT';
394 case 'setf'
395 property = 'SETF';
396 case 'set'
397 property = 'SET';
398 case 'fsp'
399 property = 'FSP';
400 case 'pas'
401 property = 'PAS';
402 case 'oi'
403 property = 'OI';
404 otherwise
405 line_error(mfilename, 'Unrecognized scheduling strategy property.');
406 end
407 end
408
409 function text = toFeature(type)
410 % TEXT = TOFEATURE(TYPE)
411 switch type
412 case SchedStrategy.INF
413 text = 'SchedStrategy_INF';
414 case SchedStrategy.FCFS
415 text = 'SchedStrategy_FCFS';
416 case SchedStrategy.FCFSPR
417 text = 'SchedStrategy_FCFSPR';
418 case SchedStrategy.FCFSPI
419 text = 'SchedStrategy_FCFSPI';
420 case SchedStrategy.LCFS
421 text = 'SchedStrategy_LCFS';
422 case SchedStrategy.SIRO
423 text = 'SchedStrategy_SIRO';
424 case SchedStrategy.SJF
425 text = 'SchedStrategy_SJF';
426 case SchedStrategy.LJF
427 text = 'SchedStrategy_LJF';
428 case SchedStrategy.PS
429 text = 'SchedStrategy_PS';
430 case SchedStrategy.DPS
431 text = 'SchedStrategy_DPS';
432 case SchedStrategy.GPS
433 text = 'SchedStrategy_GPS';
434 case SchedStrategy.SEPT
435 text = 'SchedStrategy_SEPT';
436 case SchedStrategy.LEPT
437 text = 'SchedStrategy_LEPT';
438 case SchedStrategy.SRPT
439 text = 'SchedStrategy_SRPT';
440 case SchedStrategy.SRPTPRIO
441 text = 'SchedStrategy_SRPTPRIO';
442 case SchedStrategy.HOL
443 text = 'SchedStrategy_HOL';
444 case SchedStrategy.FCFSPRIO
445 text = 'SchedStrategy_HOL';
446 case SchedStrategy.FORK
447 text = 'SchedStrategy_FORK';
448 case SchedStrategy.EXT
449 text = 'SchedStrategy_EXT';
450 case SchedStrategy.REF
451 text = 'SchedStrategy_REF';
452 case SchedStrategy.LCFSPR
453 text = 'SchedStrategy_LCFSPR';
454 case SchedStrategy.LCFSPI
455 text = 'SchedStrategy_LCFSPI';
456 case SchedStrategy.LCFSPRIO
457 text = 'SchedStrategy_LCFSPRIO';
458 case SchedStrategy.LCFSPRPRIO
459 text = 'SchedStrategy_LCFSPRPRIO';
460 case SchedStrategy.LCFSPIPRIO
461 text = 'SchedStrategy_LCFSPIPRIO';
462 case SchedStrategy.FCFSPRPRIO
463 text = 'SchedStrategy_FCFSPRPRIO';
464 case SchedStrategy.FCFSPIPRIO
465 text = 'SchedStrategy_FCFSPIPRIO';
466 case SchedStrategy.POLLING
467 text = 'SchedStrategy_POLLING';
468 case SchedStrategy.PSPRIO
469 text = 'SchedStrategy_PSPRIO';
470 case SchedStrategy.DPSPRIO
471 text = 'SchedStrategy_DPSPRIO';
472 case SchedStrategy.GPSPRIO
473 text = 'SchedStrategy_GPSPRIO';
474 case SchedStrategy.EDD
475 text = 'SchedStrategy_EDD';
476 case SchedStrategy.EDF
477 text = 'SchedStrategy_EDF';
478 case SchedStrategy.LPS
479 text = 'SchedStrategy_LPS';
480 case SchedStrategy.PSJF
481 text = 'SchedStrategy_PSJF';
482 case SchedStrategy.FB
483 text = 'SchedStrategy_FB';
484 case SchedStrategy.LRPT
485 text = 'SchedStrategy_LRPT';
486 case SchedStrategy.SETF
487 text = 'SchedStrategy_SETF';
488 case SchedStrategy.FSP
489 text = 'SchedStrategy_FSP';
490 case SchedStrategy.PAS
491 text = 'SchedStrategy_PAS';
492 case SchedStrategy.OI
493 text = 'SchedStrategy_OI';
494 otherwise
495 line_error(mfilename, 'Unrecognized scheduling strategy feature.');
496 end
497 end
498 end
499end
Definition Station.m:245