edu.indiana.util.distribution
Class BinomialDistribution

java.lang.Object
  extended by edu.indiana.util.distribution.BinomialDistribution
All Implemented Interfaces:
Distribution, java.io.Serializable, java.lang.Cloneable

public class BinomialDistribution
extends java.lang.Object
implements Distribution

A specification of a binomial random distribution.

See Also:
Serialized Form

Field Summary
protected  double pSuccess
           
 
Constructor Summary
BinomialDistribution()
          Construct a BinomialDistribution.
BinomialDistribution(double pSuccess)
          Creates a new instance of BinomialDistribution
 
Method Summary
 java.lang.Object clone()
          Obtain a copy of this distribution.
 boolean equals(java.lang.Object other)
           
 int generateIntValue()
          Generate an int value according to this distribution.
 double generateValue()
          Generate a value according to this distribution.
 void setParameters(double[] parameters)
          Set the parameters of this distribution.
 java.lang.String toString()
          Obtain a String representation of this distribution.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pSuccess

protected double pSuccess
Constructor Detail

BinomialDistribution

public BinomialDistribution()
Construct a BinomialDistribution. Parameters must be set with setParameters().


BinomialDistribution

public BinomialDistribution(double pSuccess)
Creates a new instance of BinomialDistribution

Method Detail

generateValue

public double generateValue()
Generate a value according to this distribution.

Specified by:
generateValue in interface Distribution

generateIntValue

public int generateIntValue()
Description copied from interface: Distribution
Generate an int value according to this distribution.

Specified by:
generateIntValue in interface Distribution

setParameters

public void setParameters(double[] parameters)
Set the parameters of this distribution.

Specified by:
setParameters in interface Distribution

toString

public java.lang.String toString()
Obtain a String representation of this distribution.

Specified by:
toString in interface Distribution
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Obtain a copy of this distribution.

Specified by:
clone in interface Distribution
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object