utilities
Class TaemsRandom

java.lang.Object
  |
  +--utilities.TaemsRandom

public class TaemsRandom
extends java.lang.Object

This class defines a new TaemsRandom generator based on the Random for java.util.Random The only difference is, this classe, you can get the seed !


Constructor Summary
TaemsRandom()
           
TaemsRandom(long seed)
           
 
Method Summary
static TaemsRandom getDefault()
          Gets the default log object
 long getSeed()
           
 long getUniqID()
          returns a Long Value used for Action/Commitment or any kind of uniq ID (completly indepedant of Taems).
 boolean isAnInteger(float value)
          isAnInteger(float value)
 float nextFloat()
          nextFloat returns a uniformly distributed number between 0 to 1.0
 double nextGaussian()
          nextGaussian returns a number between 0 to 1.0 from a gaussian distribution
 int nextInt()
          nextInt returns a number between 0 to the sum
 float nextValue()
          nextValue returns a value corresponding at the distribution
static void setDefault(TaemsRandom r)
          Sets the default Taems Random Number Generator
 void setDistribution(Distribution d)
          setDistribution set the distribution for the TaemsRandom number (using the Distribution Structure)
 void setDistribution(float[] args)
          setDistribution set the distribution for the TaemsRandom number the form is a pair of [ percentage value ]
 void unsetDistribution()
          unsetDistribution to avoid concurrent access to the same Random structure
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaemsRandom

public TaemsRandom(long seed)
Parameters:
long - seed is the seed for the random number

TaemsRandom

public TaemsRandom()
Method Detail

setDistribution

public void setDistribution(Distribution d)
setDistribution set the distribution for the TaemsRandom number (using the Distribution Structure)

setDistribution

public void setDistribution(float[] args)
setDistribution set the distribution for the TaemsRandom number the form is a pair of [ percentage value ]

unsetDistribution

public void unsetDistribution()
unsetDistribution to avoid concurrent access to the same Random structure

nextInt

public int nextInt()
nextInt returns a number between 0 to the sum
Returns:
int

nextFloat

public float nextFloat()
nextFloat returns a uniformly distributed number between 0 to 1.0
Returns:
float

nextGaussian

public double nextGaussian()
nextGaussian returns a number between 0 to 1.0 from a gaussian distribution
Returns:
double

nextValue

public float nextValue()
nextValue returns a value corresponding at the distribution

isAnInteger

public boolean isAnInteger(float value)
isAnInteger(float value)

getSeed

public long getSeed()

getUniqID

public long getUniqID()
returns a Long Value used for Action/Commitment or any kind of uniq ID (completly indepedant of Taems).

setDefault

public static void setDefault(TaemsRandom r)
Sets the default Taems Random Number Generator

getDefault

public static TaemsRandom getDefault()
Gets the default log object
Returns:
The default Log object