public class UniformDistr extends 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(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 ContinuousDistribution
public static double sample(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 generatorCopyright © 2012 The Cloud Computing and Distributed Systems (CLOUDS) Laboratory, The University of Melbourne. All Rights Reserved.