Overview | Package | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.grogra.blocks.arrangeBlock
Class RandomGenerator

    java.lang.Object
      de.grogra.blocks.arrangeBlock.RandomGenerator

All Implemented Interfaces:
  ContinuousGenerator, Seedable

    public class RandomGenerator

extends java.lang.Object
implements ContinuousGenerator

A random number generator producing pseudorandom numbers based on the value of a specific seed. The generator is a multiplicative linear congruential generator. It generates numbers through the following structure:

`Y[1] = (742938285*Y[0]) mod (231-1)`

The seed (`Y[0]`) provided is used to generate a sequence of pseudorandom numbers uniformly distributed between `0` and `1`. The cycle of the generator is `231-2`.

Author:
  F.Mallet from Costas Simatos original

Constructor Summary
`RandomGenerator()`
`RandomGenerator(long seed)`

Method Summary
`long` | `getSeed()` Get the random number generator's seed.
`long` | `nextLong()`
`void` | `reseed()` Get another seed well-spaced (from the default `SeedGenerator`)
`double` | `sample()`
`void` | `setSeed(long seed)` Set the random number generator's seed.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RandomGenerator

    public RandomGenerator()

### RandomGenerator

    public RandomGenerator(long seed)

Method Detail

### getSeed

    public long getSeed()

  Description copied from interface: `Seedable`
  Get the random number generator's seed.

  Specified by:
    `getSeed` in interface `Seedable`
  Returns:
    The generator's seed

### nextLong

    public long nextLong()

  Returns:
    The next long random number in the sequence

### reseed

    public void reseed()

  Description copied from interface: `Seedable`
  Get another seed well-spaced (from the default `SeedGenerator`)

  Specified by:
    `reseed` in interface `Seedable`

### sample

    public double sample()

  Specified by:
    `sample` in interface `ContinuousGenerator`

### setSeed

    public void setSeed(long seed)

  Description copied from interface: `Seedable`
  Set the random number generator's seed.

  Specified by:
    `setSeed` in interface `Seedable`
  Parameters:
    `seed` - The new seed for the generator

Overview | Package | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD