All Packages Class Hierarchy This Package Previous Next Index
Class simula.random.RandomEngine
java.lang.Object
|
+----simula.random.RandomEngine
- public abstract class RandomEngine
- extends Object
The abstract class RandomEngine is the common parent of the entire hierarchy
of the pseudo-random number generators. It riproduces the same interface
as java.util.Random
. The only thing required to have an effective
pseudo-random generator is the implementation of the nextByte
method.
This hierarchy is widely inspired to that realized in July 1996 by
John Walker,
kelvin@fourmilab.ch.
- See Also:
- Random
-
RandomEngine()
-
-
nextBit()
- Returns the next pseudo-random bit.
-
nextByte()
-
Returns the next pseudo-random byte.
-
nextByte(byte[])
- Fills the entire given array with pseudo-random generated bytes.
-
nextByte(byte[], int)
- Fills the given array with pseudo-random generated bytes.
-
nextDouble()
- Returns the next pseudo-random double precision floating point
value (according to a uniform distribution).
-
nextFloat()
- Returns the next pseudo-random floating point value (according to a uniform distribution).
-
nextGaussian()
- Returns the next pseudo-random value according to a normal distribution.
-
nextInt()
- Returns the next pseudo-random integer value (according to a uniform distribution).
-
nextLong()
- Returns the next pseudo-random long integer value (according to a uniform distribution).
-
nextShort()
- Returns the next pseudo-random short integer value (according to a uniform distribution).
-
setSeed()
- The change of seed must be notified to the super class from every
child of RandomEngine.
RandomEngine
public RandomEngine()
nextBit
public boolean nextBit()
- Returns the next pseudo-random bit.
- Returns:
- the next pseudo-random bit.
nextByte
public abstract byte nextByte()
- Returns the next pseudo-random byte.
- Returns:
- the next pseudo-random byte.
nextByte
public void nextByte(byte buf[])
- Fills the entire given array with pseudo-random generated bytes.
- Parameters:
- buf - Array to fill.
nextByte
public void nextByte(byte buf[],
int buflen)
- Fills the given array with pseudo-random generated bytes.
- Parameters:
- buf - Array of at least byte to fill.
- buflen - Number of bytes to store.
nextDouble
public double nextDouble()
- Returns the next pseudo-random double precision floating point
value (according to a uniform distribution).
- Returns:
- the next pseudo-random double precision floating point
value (according to a uniform distribution).
nextFloat
public float nextFloat()
- Returns the next pseudo-random floating point value (according to a uniform distribution).
- Returns:
- the next pseudo-random floating point value (according to a uniform distribution).
nextGaussian
public double nextGaussian()
- Returns the next pseudo-random value according to a normal distribution.
- Returns:
- the next pseudo-random value according to a normal distribution.
nextInt
public int nextInt()
- Returns the next pseudo-random integer value (according to a uniform distribution).
- Returns:
- the next pseudo-random integer value (according to a uniform distribution).
nextLong
public long nextLong()
- Returns the next pseudo-random long integer value (according to a uniform distribution).
- Returns:
- the next pseudo-random long integer value (according to a uniform distribution).
nextShort
public short nextShort()
- Returns the next pseudo-random short integer value (according to a uniform distribution).
- Returns:
- the next pseudo-random short integer value (according to a uniform distribution).
setSeed
public void setSeed()
- The change of seed must be notified to the super class from every
child of RandomEngine.
All Packages Class Hierarchy This Package Previous Next Index