org.jgap.impl
Class GaussianRandomGenerator
- java.lang.Object
-
- org.jgap.impl.GaussianRandomGenerator
-
- All Implemented Interfaces:
- java.io.Serializable, RandomGenerator
public class GaussianRandomGenerator extends java.lang.Object implements RandomGenerator
Gaussian deviation serving as basis for randomly finding a number.- Since:
- 1.1
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description GaussianRandomGenerator()GaussianRandomGenerator(double a_standardDeviation)Constructor speicifying the (obliagtory) standard deviation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetGaussianStdDeviation()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.voidsetGaussianStdDeviation(double a_standardDeviation)
-
-
-
Constructor Detail
-
GaussianRandomGenerator
public GaussianRandomGenerator()
-
GaussianRandomGenerator
public GaussianRandomGenerator(double a_standardDeviation)
Constructor speicifying the (obliagtory) standard deviation.- Parameters:
a_standardDeviation- the standard deviation to use
-
-
Method Detail
-
setGaussianStdDeviation
public void setGaussianStdDeviation(double a_standardDeviation)
-
getGaussianStdDeviation
public double getGaussianStdDeviation()
-
nextInt
public int nextInt()
Description copied from interface:RandomGeneratorReturns 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.- Specified by:
nextIntin interfaceRandomGenerator- Returns:
- positive integer value
-
nextInt
public int nextInt(int a_ceiling)
Description copied from interface:RandomGeneratorReturns 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.- Specified by:
nextIntin interfaceRandomGenerator- Parameters:
a_ceiling- the upper boundary excluded- Returns:
- positive integer value between 0 and (ceiling - 1)
-
nextLong
public long nextLong()
Description copied from interface:RandomGeneratorReturns 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.- Specified by:
nextLongin interfaceRandomGenerator- Returns:
- positive long value
-
nextDouble
public double nextDouble()
Description copied from interface:RandomGeneratorReturns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.- Specified by:
nextDoublein interfaceRandomGenerator- Returns:
- a psuedorandom double value GREATER/EQUAL 0 AND LESS THAN 1
-
nextFloat
public float nextFloat()
Description copied from interface:RandomGeneratorReturns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from this random number generator's sequence.- Specified by:
nextFloatin interfaceRandomGenerator- Returns:
- a psuedorandom float value
-
nextBoolean
public boolean nextBoolean()
Description copied from interface:RandomGeneratorReturns 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.- Specified by:
nextBooleanin interfaceRandomGenerator- Returns:
- a pseudorandom boolean value
-
-
DMelt 3.0 © DataMelt by jWork.ORG