org.jgap
Interface RandomGenerator
-
- All Superinterfaces:
- java.io.Serializable
- All Known Implementing Classes:
- CauchyRandomGenerator, GaussianRandomGenerator, StockRandomGenerator
public interface RandomGenerator extends java.io.SerializableThe 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
Fields Modifier and Type Field and Description static java.lang.StringCVS_REVISIONString containing the CVS revision.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description booleannextBoolean()Returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence.doublenextDouble()Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.floatnextFloat()Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from this random number generator's sequence.intnextInt()Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.intnextInt(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.longnextLong()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
-
-
DMelt 3.0 © DataMelt by jWork.ORG