
public final class UniformDistribution extends Object implements Distribution
| Modifier and Type | Field and Description |
|---|---|
private double |
len
Len := max - min
|
private double |
max
Maximum
|
private double |
min
Minimum
|
private Random |
random
The random generator.
|
| Constructor and Description |
|---|
UniformDistribution(double min,
double max,
Random random)
Constructor for a uniform distribution on the interval [min, max[
|
| Modifier and Type | Method and Description |
|---|---|
double |
explain(double val)
Return the PDF of the generators distribution
|
double |
generate()
Generate a random value with the generators parameters
|
double |
getMax() |
double |
getMin() |
String |
toString()
Simple toString explaining the distribution parameters.
|
private double min
private double max
private double len
private Random random
public UniformDistribution(double min,
double max,
Random random)
min - Minimum valuemax - Maximum valuerandom - Random generatorpublic double explain(double val)
explain in interface Distributionval - existing valuepublic double generate()
generate in interface Distributionpublic String toString()
toString in interface DistributiontoString in class Objectpublic double getMin()
public double getMax()