cad.simcad.utilz.random
Class MTAdapter

java.lang.Object
  |
  +--java.util.Random
        |
        +--cad.simcad.utilz.random.MersenneTwister
              |
              +--cad.simcad.utilz.random.MTAdapter
All Implemented Interfaces:
RandomGenerator, java.io.Serializable

public class MTAdapter
extends MersenneTwister
implements RandomGenerator

Used as a wrapper for the MersenneTwister class

Version:
1.0
Author:
Charles-Philip Bentley
See Also:
Serialized Form

Constructor Summary
MTAdapter()
          Creates new MTChild
MTAdapter(long seed)
          Creates new MTChild
 
Method Summary
 int getNextInt()
          Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.
 int getNextInt(int n)
          Returns an integer drawn uniformly from 0 to n-1.
 
Methods inherited from class cad.simcad.utilz.random.MersenneTwister
main, next, nextBoolean, nextByte, nextBytes, nextChar, nextDouble, nextFloat, nextInt, nextShort, setSeed
 
Methods inherited from class java.util.Random
nextGaussian, nextInt, nextLong
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MTAdapter

public MTAdapter(long seed)
Creates new MTChild


MTAdapter

public MTAdapter()
Creates new MTChild

Method Detail

getNextInt

public int getNextInt()
Description copied from interface: RandomGenerator
Returns 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 232 possible int values are produced with (approximately) equal probability.

Specified by:
getNextInt in interface RandomGenerator
Returns:
the next pseudorandom, uniformly distributed int value from this random number generator's sequence.

getNextInt

public int getNextInt(int n)
Returns an integer drawn uniformly from 0 to n-1. Suffice it to say, n must be > 0, or an IllegalArgumentException is raised.

Specified by:
getNextInt in interface RandomGenerator

Logo

With the help of www.sourceforge.net and www.info.ucl.ac.be