public class UniformDistr extends java.lang.Object implements ContinuousDistribution
| Constructor and Description |
|---|
UniformDistr(double min,
double max)
Creates new uniform distribution.
|
UniformDistr(double min,
double max,
long seed)
Creates new uniform distribution.
|
| Modifier and Type | Method and Description |
|---|---|
double |
sample()
Generate a new random number.
|
static double |
sample(java.util.Random rd,
double min,
double max)
Generates a new random number based on the number generator and values provided as
parameters.
|
void |
setSeed(long seed)
Set the random number generator's seed.
|
public UniformDistr(double min,
double max)
min - minimum valuemax - maximum valuepublic UniformDistr(double min,
double max,
long seed)
min - minimum valuemax - maximum valueseed - simulation seed to be usedpublic double sample()
sample in interface ContinuousDistributionpublic static double sample(java.util.Random rd,
double min,
double max)
rd - the random number generatormin - the minimum valuemax - the maximum valuepublic void setSeed(long seed)
seed - the new seed for the generator