|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.opttek.optquest.COptQuestRandomNumber
public class COptQuestRandomNumber
The COptQuestRandomNumber class provides random numbers in different forms such as uniform or triangular.
| Constructor Summary | |
|---|---|
COptQuestRandomNumber()
Default Constructor - uses a predefined random number seed. |
|
COptQuestRandomNumber(int seed)
Constructor used to provide the random number seed. |
|
| Method Summary | |
|---|---|
int |
Discrete01(double oneProbability)
|
int |
DiscreteUniform(int min,
int max)
|
int |
GetNextRandomOrder()
GetNextRandomOrder() returns the next random integer value set by SetRandomOrderRange(). |
double |
LogNormal(double mean,
double stddev)
|
double |
Normal(double mean,
double stddev)
|
double |
Normal01()
|
int |
PickBasedOnWeights(double[] weights,
int numWeights)
|
void |
SetRandomOrderRange(int min,
int max)
SetRandomOrderRange() sets a range from min to max to return the integer values from min to max in a random order. |
void |
SetSeed(int seed)
SetSeed() changes the random number seed and resets the random number generator. |
double |
Triangular(double min,
double mostlikely,
double max)
Triangular() returns a random number from a triangular distribution. |
boolean |
TrueFalse()
|
boolean |
TrueFalse(double trueProbability)
|
double |
Uniform(double min,
double max)
Uniform() returns a uniform random number from min to max. |
double |
Uniform01()
Uniform01() returns a uniform random number from 0.0 to 1.0. |
int |
UniformInteger(int LowerBound,
int UpperBound)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public COptQuestRandomNumber()
public COptQuestRandomNumber(int seed)
seed - - random number seed| Method Detail |
|---|
public void SetSeed(int seed)
seed - - random number seed
public double Triangular(double min,
double mostlikely,
double max)
throws COptQuestException
min - - minimum valuemostlikely - - most likely valuemax - - maximum value
COptQuestExceptionpublic double Uniform01()
public double Normal01()
public double Normal(double mean,
double stddev)
public double Uniform(double min,
double max)
min - - minimum valuemax - - maximum value
COptQuestExceptionpublic int Discrete01(double oneProbability)
public boolean TrueFalse(double trueProbability)
public boolean TrueFalse()
public int DiscreteUniform(int min,
int max)
public double LogNormal(double mean,
double stddev)
public void SetRandomOrderRange(int min,
int max)
public int GetNextRandomOrder()
public int UniformInteger(int LowerBound,
int UpperBound)
public int PickBasedOnWeights(double[] weights,
int numWeights)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||