Class AbstractDistribution
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AbstractContinuousDistribution
,AbstractDiscreteDistribution
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.
invalid @link
cern.jet.random.engine.MersenneTwister
invalid @link
#makeDefaultGenerator()
invalid @link
cern.jet.random.engine.DRand
Ressources on the Web:
Other useful ressources:
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
apply
(double dummy) Equivalent to nextDouble().int
apply
(int dummy) Equivalent to nextInt().protected MersenneTwisterFast
Returns the used uniform random number generator;abstract double
Returns a random number from the distribution.int
nextInt()
Returns a random number from the distribution; returns (int) Math.round(nextDouble()).protected void
setRandomGenerator
(MersenneTwisterFast randomGenerator) Sets the uniform random generator internally used.
-
Field Details
-
randomGenerator
-
-
Constructor Details
-
AbstractDistribution
public AbstractDistribution()
-
-
Method Details
-
apply
public double apply(double dummy) Equivalent to nextDouble(). This has the effect that distributions can now be used as function objects, returning a random number upon function evaluation. -
apply
public int apply(int dummy) Equivalent to nextInt(). This has the effect that distributions can now be used as function objects, returning a random number upon function evaluation. -
getRandomGenerator
Returns the used uniform random number generator; -
nextDouble
public abstract double nextDouble()Returns a random number from the distribution. -
nextInt
public int nextInt()Returns a random number from the distribution; returns (int) Math.round(nextDouble()). Override this method if necessary. -
setRandomGenerator
Sets the uniform random generator internally used.
-