Constructor and Description |
---|
AbstractPolicy() |
Modifier and Type | Method and Description |
---|---|
static int |
calculateSampleSize(int populationSize)
sampleSize how many samples to take
|
static int[] |
generateRandomSample(int populationSize)
Generates a random sample from a population
|
Element |
selectedBasedOnPolicy(Element[] sampledElements,
Element justAdded)
Finds the best eviction candidate based on the sampled elements.
|
public static int calculateSampleSize(int populationSize)
populationSize
- the size of the storepublic Element selectedBasedOnPolicy(Element[] sampledElements, Element justAdded)
selectedBasedOnPolicy
in interface Policy
sampledElements
- this should be a random subset of the populationjustAdded
- we never want to select the element just added. May be null.public static int[] generateRandomSample(int populationSize)
populationSize
- the size to draw fromCopyright © 2003-2013 Terracotta, Inc.. All Rights Reserved.