|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jgap.util.randomX
org.jgap.util.randomLCG
public class randomLCG
Implementation of a randomX-compliant class using the simple (and not very good) rand() linear congruential generator given as an example in the ANSI C specification. This is intended not for serious use, merely as an illustration of a simple software-based randomX generator.
The generation algorithm is:
Designed and implemented in July 1996 by John Walker, kelvin@fourmilab.ch.
| Constructor Summary | |
|---|---|
randomLCG()
Creates a new pseudorandom number generator, seeded from the current time. |
|
randomLCG(long seed)
Creates a new pseudorandom number generator with a specified seed. |
|
| Method Summary | |
|---|---|
byte |
nextByte()
Get next byte from generator. |
void |
setSeed(long seed)
Set seed for generator. |
| Methods inherited from class org.jgap.util.randomX |
|---|
nextBit, nextByte, nextByte, nextDouble, nextFloat, nextGaussian, nextInt, nextLong, nextShort, setSeed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public randomLCG()
public randomLCG(long seed)
seed - initial seed for the generator| Method Detail |
|---|
public void setSeed(long seed)
seed - seed for the generatorpublic byte nextByte()
nextByte in class randomX
|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||