|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.indiana.util.distribution.UniformDistribution
public class UniformDistribution
A specification of a uniform random distribution.
| Field Summary | |
|---|---|
protected double |
high
|
protected double |
low
|
| Constructor Summary | |
|---|---|
UniformDistribution()
Construct a UniformDistribution. |
|
UniformDistribution(double low,
double high)
Creates new UniformDistribution |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Obtain a copy of this distribution. |
boolean |
equals(java.lang.Object other)
|
int |
generateIntValue()
Returns int value from low (inclusive) to high (exclusive). |
double |
generateValue()
Generate a random value according to this distribution. |
static void |
main(java.lang.String[] args)
|
static int[] |
pickDistinctIndices(int numToChoose,
int low,
int high)
|
static int |
pickIndex(int low,
int high)
Use a uniform distribution to pick a value between low (inclusive) and high (exclusive). |
void |
setParameters(double[] parameters)
Set the parameters for 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 |
|---|
protected double low
protected double high
| Constructor Detail |
|---|
public UniformDistribution()
public UniformDistribution(double low,
double high)
| Method Detail |
|---|
public double generateValue()
generateValue in interface Distributionpublic int generateIntValue()
generateIntValue in interface Distributionpublic void setParameters(double[] parameters)
setParameters in interface Distribution
public static int pickIndex(int low,
int high)
public static int[] pickDistinctIndices(int numToChoose,
int low,
int high)
low - int inclusivehigh - int exclusive
public java.lang.String toString()
toString in interface DistributiontoString in class java.lang.Objectpublic java.lang.Object clone()
clone in interface Distributionclone in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||