public class BlockDistributionNearbyRandom extends Object implements NearbyRandom
Modifier and Type | Field and Description |
---|---|
protected int |
sizeMaximum |
protected int |
sizeMinimum |
protected double |
sizeRatio |
protected double |
uniformDistributionProbability |
Constructor and Description |
---|
BlockDistributionNearbyRandom(int sizeMinimum,
int sizeMaximum,
double sizeRatio,
double uniformDistributionProbability) |
Modifier and Type | Method and Description |
---|---|
int |
getOverallSizeMaximum()
Used to limit the RAM memory size of the nearby distance matrix.
|
int |
nextInt(Random random,
int nearbySize) |
protected final int sizeMinimum
protected final int sizeMaximum
protected final double sizeRatio
protected final double uniformDistributionProbability
public BlockDistributionNearbyRandom(int sizeMinimum, int sizeMaximum, double sizeRatio, double uniformDistributionProbability)
public int nextInt(Random random, int nearbySize)
nextInt
in interface NearbyRandom
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.0 <= x < nearbySize
public int getOverallSizeMaximum()
NearbyRandom
getOverallSizeMaximum
in interface NearbyRandom
NearbyRandom.nextInt(Random, int)
can return,
Integer.MAX_VALUE
if there is noneCopyright © 2006–2020 JBoss by Red Hat. All rights reserved.