public class Java2Random extends Random implements StreamInterface
java.util.Random
class
which implements the StreamInterface.
(c) copyright 2004 Delft
University of Technology , the Netherlands.
See for project information
www.simulation.tudelft.nl
License of use: Lesser
General Public License (LGPL) , no warranty.
Modifier and Type | Field and Description |
---|---|
protected long |
seed
seed is a link to the seed value.
|
Constructor and Description |
---|
Java2Random()
creates a new Java2Random and in initializes with
System.currentTimeMillis constructs a new Java2Random
|
Java2Random(long seed) |
Modifier and Type | Method and Description |
---|---|
long |
getSeed()
returns the seed of the generator
|
int |
nextInt(int i,
int j)
Method returns (pseudo)random number from the stream over the integers i
and j .
|
void |
reset()
resets a stream
|
void |
setSeed(long seed)
sets the seed of the generator
|
next, nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
nextBoolean, nextDouble, nextFloat, nextInt, nextLong
protected long seed
public Java2Random()
public Java2Random(long seed)
Random.Random(long)
public void reset()
reset
in interface StreamInterface
StreamInterface.reset()
public int nextInt(int i, int j)
StreamInterface
nextInt
in interface StreamInterface
i
- the minimal valuej
- the maximum valueStreamInterface.nextInt(int,
int)
public void setSeed(long seed)
StreamInterface
setSeed
in interface StreamInterface
setSeed
in class Random
seed
- the new seedRandom.setSeed(long)
public long getSeed()
StreamInterface
getSeed
in interface StreamInterface
StreamInterface.getSeed()
Copyright © 2002-2012 Delft University of Technology, the Netherlands. All Rights Reserved.