LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
ReplacementStrategy.m
1classdef (Sealed) ReplacementStrategy
2 % Enumeration of cache replacement strategies
3 %
4 % Copyright (c) 2012-2026, Imperial College London
5 % All rights reserved.
6
7 properties (Constant)
8 RR = 0;
9 FIFO = 1;
10 SFIFO = 2; % strict fifo
11 LRU = 3;
12 %HLRU = 4; % also called k-LRU (Martina et al, Gast & van Houdt; not supported at present)
13 end
14
15 methods (Static)
16
17 function text = toString(type)
18 % TEXT = TOSTRING(ID)
19 text = ReplacementStrategy.toText(type);
20 end
21
22 function text = toText(type)
23 % TEXT = TOTEXT(ID)
24 switch type
25 case ReplacementStrategy.RR
26 text = 'rr';
27 case ReplacementStrategy.FIFO
28 text = 'fifo';
29 case ReplacementStrategy.SFIFO
30 text = 'strict-fifo';
31 case ReplacementStrategy.LRU
32 text = 'lru';
33 end
34 end
35
36 function text = toFeature(type)
37 % TEXT = TOFEATURE(TYPE)
38
39 switch type
40 case ReplacementStrategy.RR
41 text = 'ReplacementStrategy_RR';
42 case ReplacementStrategy.FIFO
43 text = 'ReplacementStrategy_FIFO';
44 case ReplacementStrategy.SFIFO
45 text = 'ReplacementStrategy_SFIFO';
46 case ReplacementStrategy.LRU
47 text = 'ReplacementStrategy_LRU';
48 %case ReplacementStrategy.HLRU
49 % text = 'ReplacementStrategy_HLRU';
50 end
51 end
52 end
53end