nl.tudelft.simulation.jstats.streams
Interface StreamInterface

All Superinterfaces:
Serializable
All Known Implementing Classes:
DX120Generator, Java2Random, MersenneTwister, RandomNumberGenerator

public interface StreamInterface
extends 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 2002-2005-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.

Since:
1.0
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:25:41 $
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

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

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

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

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

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

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

long getSeed()
returns the seed of the generator

Returns:
long the seed

setSeed

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

Parameters:
seed - the new seed

reset

void reset()
resets the stream



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