public final class MiniSimClimber extends Object implements HillClimber
The algorithm is explained by the authors in Cache Modeling and Optimization using Miniature Simulation.
HillClimber.Adaptation, HillClimber.QueueType| Constructor and Description |
|---|
MiniSimClimber(Config config) |
| Modifier and Type | Method and Description |
|---|---|
HillClimber.Adaptation |
adapt(double windowSize,
double probationSize,
double protectedSize,
boolean isFull)
Determines how to adapt the segment sizes.
|
void |
onHit(long key,
HillClimber.QueueType queue,
boolean isFull)
Records that a hit occurred with a full cache.
|
void |
onMiss(long key,
boolean isFull)
Records that a miss occurred with a full cache.
|
public MiniSimClimber(Config config)
public void onHit(long key,
HillClimber.QueueType queue,
boolean isFull)
HillClimberonHit in interface HillClimberkey - the key accessedqueue - the queue the entry was found inisFull - if the cache is fully populatedpublic void onMiss(long key,
boolean isFull)
HillClimberonMiss in interface HillClimberkey - the key accessedisFull - if the cache is fully populated and had to evictpublic HillClimber.Adaptation adapt(double windowSize, double probationSize, double protectedSize, boolean isFull)
HillClimberadapt in interface HillClimberwindowSize - the current window sizeprobationSize - the current probation sizeprotectedSize - the current protected sizeisFull - if the cache is fully populated