Interface NearbyRandom
- All Known Implementing Classes:
BetaDistributionNearbyRandom
,BlockDistributionNearbyRandom
,LinearDistributionNearbyRandom
,ParabolicDistributionNearbyRandom
public interface NearbyRandom
Strategy pattern to select a index of a nearby ordered value range according to a probability distribution.
It is recommended that instances be
equal
if they represent the same random function,
in order to support nearby entity selector equality.-
Method Summary
Modifier and TypeMethodDescriptionint
Used to limit the RAM memory size of the nearby distance matrix.int
-
Method Details
-
nextInt
- Parameters:
random
- never nullnearbySize
- never negative. The number of available values to select from. Normally this is the size of the value range for a non-chained variable and the size of the value range (= size of the entity list) minus 1 for a chained variable.- Returns:
0 <= x < nearbySize
-
getOverallSizeMaximum
int getOverallSizeMaximum()Used to limit the RAM memory size of the nearby distance matrix.- Returns:
- one more than the maximum number that
nextInt(Random, int)
can return,Integer.MAX_VALUE
if there is none
-