public class Uniform extends AbstractContinousDistribution
Constructor and Description |
---|
Uniform(double min,
double max,
int seed)
Constructs a uniform distribution with the given minimum and maximum, using a
MersenneTwister seeded with the given seed. |
Uniform(double min,
double max,
Random randomGenerator)
Constructs a uniform distribution with the given minimum and maximum.
|
Uniform(Random randomGenerator)
Constructs a uniform distribution with min=0.0 and max=1.0.
|
Modifier and Type | Method and Description |
---|---|
double |
cdf(double x)
Returns the cumulative distribution function (assuming a continous uniform distribution).
|
boolean |
nextBoolean()
Returns a uniformly distributed random boolean.
|
double |
nextDouble()
Returns a uniformly distributed random number in the open interval (min,max) (excluding min and
max).
|
double |
nextDoubleFromTo(double from,
double to)
Returns a uniformly distributed random number in the open interval (from,to) (excluding from and
to).
|
float |
nextFloatFromTo(float from,
float to)
Returns a uniformly distributed random number in the open interval (from,to) (excluding from and
to).
|
int |
nextIntFromTo(int from,
int to)
Returns a uniformly distributed random number in the closed interval
[from,to] (including from
and to).
|
long |
nextLongFromTo(long from,
long to)
Returns a uniformly distributed random number in the closed interval [from,to] (including from
and to).
|
double |
pdf(double x)
Returns the probability distribution function (assuming a continous uniform distribution).
|
void |
setState(double min,
double max)
Sets the internal state.
|
String |
toString()
Returns a String representation of the receiver.
|
nextInt
apply, apply, getRandomGenerator, randomDouble, setRandomGenerator
isDensifying
public Uniform(double min, double max, int seed)
MersenneTwister
seeded with the given seed.public Uniform(double min, double max, Random randomGenerator)
public Uniform(Random randomGenerator)
public double cdf(double x)
cdf
in class AbstractContinousDistribution
public boolean nextBoolean()
public double nextDouble()
nextDouble
in class AbstractDistribution
public double nextDoubleFromTo(double from, double to)
public float nextFloatFromTo(float from, float to)
public int nextIntFromTo(int from, int to)
public long nextLongFromTo(long from, long to)
public double pdf(double x)
pdf
in class AbstractContinousDistribution
public void setState(double min, double max)
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.