nl.tudelft.simulation.jstats.streams
Interface StreamInterface

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
Java2Random, RandomNumberGenerator

public interface StreamInterface
extends java.io.Serializable

The StreamInterface defines the streams to be used within the JSTATS package. Potential implementations include the pseudo random stream, the fully one-time random stream, etc.

(c) copyright 2003-2004 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: General Public License (GPL) , no warranty

Since:
1.0
Version:
1.8, 2004-03-20
Author:
Peter Jacobs

Method Summary
 long getSeed()
          returns the seed of the generator
 boolean nextBoolean()
          Returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence.
 double nextDouble()
          Method return a (pseudo)random number from the stream over the interval (0,1) using this stream, after advancing its state by one step.
 float nextFloat()
          Method return a (pseudo)random number from the stream over the interval (0,1) using this stream, after advancing its state by one step.
 int nextInt()
          Method return a (pseudo)random number from the stream over using this stream, after advancing its state by one step.
 int nextInt(int i, int j)
          Method returns (pseudo)random number from the stream over the integers i and j .
 long nextLong()
          Method return a (pseudo)random number from the stream over using this stream, after advancing its state by one step.
 void reset()
          resets the stream
 void setSeed(long seed)
          sets the seed of the generator
 

Method Detail

nextBoolean

public boolean nextBoolean()
Returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence. The general contract of nextBoolean is that one boolean value is pseudorandomly generated and returned. The values true and false are produced with (approximately) equal probability. The method nextBoolean is implemented by class Random as follows:
 public boolean nextBoolean()
 {
 	return next(1) != 0;
 }
 

Returns:
the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence.
Since:
1.2

nextDouble

public double nextDouble()
Method return a (pseudo)random number from the stream over the interval (0,1) using this stream, after advancing its state by one step.

Returns:
double the (pseudo)random number

nextFloat

public float nextFloat()
Method return a (pseudo)random number from the stream over the interval (0,1) using this stream, after advancing its state by one step.

Returns:
float the (pseudo)random number

nextInt

public int nextInt()
Method return a (pseudo)random number from the stream over using this stream, after advancing its state by one step.

Returns:
int the (pseudo)random number

nextInt

public int nextInt(int i,
                   int j)
Method returns (pseudo)random number from the stream over the integers i and j .

Parameters:
i - the minimal value
j - the maximum value
Returns:
int

nextLong

public long nextLong()
Method return a (pseudo)random number from the stream over using this stream, after advancing its state by one step.

Returns:
long the (pseudo)random number

getSeed

public long getSeed()
returns the seed of the generator

Returns:
long the seed

setSeed

public void setSeed(long seed)
sets the seed of the generator

Parameters:
seed - the new seed

reset

public void reset()
resets the stream



Copyright © 2002-2004 Delft University of Technology, the Netherlands. All Rights Reserved.