edu.indiana.util.distribution
Class SelectionDistribution

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

public class SelectionDistribution
extends java.lang.Object
implements Distribution

In this "distribution", one of several distributions is selected to be the distribution in effect for a single number to be generated. The distribution in effect is selected by yet another distribution.

See Also:
Serialized Form

Constructor Summary
SelectionDistribution(Distribution[] possDistributions)
           
SelectionDistribution(Distribution[] possDistributions, Distribution distSelector)
          Creates a new instance of SelectionDistribution
 
Method Summary
 java.lang.Object clone()
          Obtain a copy of this distribution.
 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SelectionDistribution

public SelectionDistribution(Distribution[] possDistributions)

SelectionDistribution

public SelectionDistribution(Distribution[] possDistributions,
                             Distribution distSelector)
Creates a new instance of SelectionDistribution

Method Detail

generateValue

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

Specified by:
generateValue in interface Distribution

setParameters

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

Specified by:
setParameters 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

toString

public java.lang.String toString()
Description copied from interface: Distribution
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()
Description copied from interface: Distribution
Obtain a copy of this distribution.

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