1classdef (Sealed) ReplacementStrategy
2 % Enumeration of cache replacement strategies
4 % Copyright (c) 2012-2026, Imperial College London
10 SFIFO = 2; % strict fifo
12 HLRU = 4; % hierarchical/k-LRU: h lists, LRU discipline, promote i->i+1 on hit
13 CLIMB = 5; % move-up-one-position on hit (transposition rule)
14 QLRU = 6; % q-LRU: LRU discipline with probabilistic admission q on a miss
19 function text = toString(type)
21 text = ReplacementStrategy.toText(type);
24 function text = toText(type)
27 case ReplacementStrategy.RR
29 case ReplacementStrategy.FIFO
31 case ReplacementStrategy.SFIFO
33 case ReplacementStrategy.LRU
35 case ReplacementStrategy.HLRU
37 case ReplacementStrategy.CLIMB
39 case ReplacementStrategy.QLRU
44 function text = toFeature(type)
45 % TEXT = TOFEATURE(TYPE)
48 case ReplacementStrategy.RR
49 text =
'ReplacementStrategy_RR';
50 case ReplacementStrategy.FIFO
51 text =
'ReplacementStrategy_FIFO';
52 case ReplacementStrategy.SFIFO
53 text =
'ReplacementStrategy_SFIFO';
54 case ReplacementStrategy.LRU
55 text =
'ReplacementStrategy_LRU';
56 case ReplacementStrategy.HLRU
57 text =
'ReplacementStrategy_HLRU';
58 case ReplacementStrategy.CLIMB
59 text =
'ReplacementStrategy_CLIMB';
60 case ReplacementStrategy.QLRU
61 text =
'ReplacementStrategy_QLRU';