JGAP

org.jgap
Interface RandomGenerator

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
CauchyRandomGenerator, GaussianRandomGenerator, StockRandomGenerator

public interface RandomGenerator
extends java.io.Serializable

The RandomGenerator interface provides an abstraction for the random number implementation so that more rigorous or alternative implementations can be provided as desired.

ATTENTION: nextDouble should only return values betwen 0 (inclusive) and 1 (exclusive!). The same holds for nextFloat.

Since:
1.0

Field Summary
static java.lang.String CVS_REVISION
          String containing the CVS revision.
 
Method Summary
 boolean nextBoolean()
          Returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence.
 double nextDouble()
          Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.
 float nextFloat()
          Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from this random number generator's sequence.
 int nextInt()
          Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.
 int nextInt(int a_ceiling)
          Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.
 long nextLong()
          Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.
 

Field Detail

CVS_REVISION

static final java.lang.String CVS_REVISION
String containing the CVS revision. Read out via reflection!

See Also:
Constant Field Values
Method Detail

nextInt

int nextInt()
Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence. The general contract of nextInt is that one int value is pseudorandomly generated and returned. All 2^32 possible int values are produced with (approximately) equal probability.

Returns:
a pseudorandom integer value
Since:
1.0

nextInt

int nextInt(int a_ceiling)
Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence. The general contract of nextInt is that one int value in the specified range is pseudorandomly generated and returned. All n possible int values are produced with (approximately) equal probability.

Parameters:
a_ceiling - the upper boundary excluded
Returns:
a pseudorandom integer value between 0 and the given ceiling - 1, inclusive
Since:
1.0

nextLong

long nextLong()
Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence. The general contract of nextLong() is that one long value is pseudorandomly generated and returned. All 2^64 possible long values are produced with (approximately) equal probability.

Returns:
a psuedorandom long value
Since:
1.0

nextDouble

double nextDouble()
Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.

Returns:
a psuedorandom double value GREATER/EQUAL 0 AND LESS THAN 1
Since:
1.0

nextFloat

float nextFloat()
Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from this random number generator's sequence.

Returns:
a psuedorandom float value
Since:
1.0

nextBoolean

boolean nextBoolean()
Returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence. The general contract of nextBoolean is that one boolean value is pseudorandomly generated and returned. The values true and false are produced with (approximately) equal probability.

Returns:
a pseudorandom boolean value
Since:
1.0

JGAP