|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcern.colt.PersistentObject
cern.jet.random.AbstractDistribution
public abstract class AbstractDistribution
Abstract base class for all random distributions. A subclass of this class need to override method nextDouble() and, in rare cases, also nextInt().
Currently all subclasses use a uniform pseudo-random number generation engine and transform its results to the target distribution. Thus, they expect such a uniform engine upon instance construction.
MersenneTwister is recommended as uniform
pseudo-random number generation engine, since it is very strong and at the
same time quick. makeDefaultGenerator() will conveniently construct
and return such a magic thing. You can also, for example, use
cern.jet.random.engine.DRand, a quicker (but much weaker) uniform
random number generation engine. Of course, you can also use other strong
uniform random number generation engines. Paul Houle's RngPack package
contains some such beasts; Ranecu,
Ranecu and
Ranlux are strong well analyzed
research grade uniform pseudo-random number generators with known periods.
More info on RngPack can be found here.
Ressources on the Web:
Other useful ressources:
cern.jet.random.engine,
edu.cornell.lassp.houle.RngPack,
cern.jet.random.engine.Benchmark,
cern.jet.random.Benchmark,
Serialized Form| Method Summary | |
|---|---|
double |
apply(double dummy)
Equivalent to nextDouble(). |
int |
apply(int dummy)
Equivalent to nextInt(). |
java.lang.Object |
clone()
Returns a deep copy of the receiver; the copy will produce identical sequences. |
static RandomElement |
makeDefaultGenerator()
Constructs and returns a new uniform random number generation engine seeded with the current time. |
abstract double |
nextDouble()
Returns a random number from the distribution. |
int |
nextInt()
Returns a random number from the distribution; returns (int) Math.round(nextDouble()). |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public double apply(double dummy)
apply in interface DoubleFunctiondummy - argument passed to the function.
public int apply(int dummy)
apply in interface IntFunctiondummy - argument passed to the function.
public java.lang.Object clone()
clone in class PersistentObjectpublic abstract double nextDouble()
public int nextInt()
public static RandomElement makeDefaultGenerator()
MersenneTwister.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||