org.jgap.util
Class randomJava
- java.lang.Object
-
- org.jgap.util.randomX
-
- org.jgap.util.randomJava
-
public class randomJava extends randomX
Implementation of a randomX-compliant class based upon the built-in Java.util.Random generator. Note that since the higher level result composition methods are different from those in the (undocumented) standard library, randomJava results will differ from those of the standard library for a given seed.Designed and implemented in July 1996 by John Walker, kelvin@fourmilab.ch.
-
-
Constructor Summary
Constructors Constructor and Description randomJava()Creates a new pseudorandom number generator, seeded from the current time.randomJava(long seed)Creates a new pseudorandom number generator with a specified seed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description bytenextByte()Get next byte from generator.voidsetSeed(long seed)Set seed for generator.
-
-
-
Constructor Detail
-
randomJava
public randomJava()
Creates a new pseudorandom number generator, seeded from the current time.
-
randomJava
public randomJava(long seed)
Creates a new pseudorandom number generator with a specified seed.- Parameters:
seed- initial seed for the generator
-
-
Method Detail
-
setSeed
public void setSeed(long seed)
Set seed for generator. Subsequent values will be based on the given seed.- Parameters:
seed- seed for the generator
-
nextByte
public byte nextByte()
Get next byte from generator. To minimise calls on the underlying Java generator, integers are generated and individual bytes returned on subsequent calls. A call on setSeed() discards any bytes in the buffer.
-
-
DMelt 3.0 © DataMelt by jWork.ORG