de.lmu.ifi.dbs.elki.data.synthetic.bymodel.distribution
Class UniformDistribution

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.data.synthetic.bymodel.distribution.UniformDistribution
All Implemented Interfaces:
Distribution

public final class UniformDistribution
extends Object
implements Distribution

Simple uniform distribution class


Field Summary
private  double len
          Len := max - min
private  double max
          Maximum
private  double min
          Minimum
private  Random random
          The random generator.
 
Constructor Summary
UniformDistribution(double min, double max, Random random)
          Constructor for a uniform distribution on the interval [min, max[
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

min

private double min
Minimum


max

private double max
Maximum


len

private double len
Len := max - min


random

private Random random
The random generator.

Constructor Detail

UniformDistribution

public UniformDistribution(double min,
                           double max,
                           Random random)
Constructor for a uniform distribution on the interval [min, max[

Parameters:
min - Minimum value
max - Maximum value
random - Random generator
Method Detail

explain

public double explain(double val)
Return the PDF of the generators distribution

Specified by:
explain in interface Distribution
Parameters:
val - existing value
Returns:
distribution density

generate

public double generate()
Generate a random value with the generators parameters

Specified by:
generate in interface Distribution
Returns:
new generated value

toString

public String toString()
Simple toString explaining the distribution parameters. Used in describing cluster models.

Specified by:
toString in interface Distribution
Overrides:
toString in class Object
Returns:
description

getMin

public double getMin()
Returns:
the minimum value

getMax

public double getMax()
Returns:
the maximum value

Release 0.4.0 (2011-09-20_1324)