| java.lang.Object org.mmbase.util.RandomPool
RandomPool | public class RandomPool (Code) | | Class for holding a pool of random numbers.
Calling
RandomPool.stir takes care of generating a new 'random' number.
Calling
RandomPool.value returns the current random number.
author: Rico Jansen author: Pierre van Rooden (javadocs) version: $Id: RandomPool.java,v 1.8 2005/10/05 10:44:00 michiel Exp $ |
Method Summary | |
public synchronized void | stir(long x) Maintain a pool of randomness using a modified 64-bit
congruential generator with multipliers dynamically
selected from a set of pseudo-random values. | public long | value() Returns the current random value. | public long | value_and_stir() Stirs, then returns the (new) current random value. | public long | value_and_stir(long mix) Stirs, then returns the (new) current random value. |
RandomPool | public RandomPool()(Code) | | Create a pool.
Use the current time (long milliseconds) as a source of randomness
|
RandomPool | public RandomPool(long init)(Code) | | Create a pool.
Parameters: init - the source of randomness |
stir | public synchronized void stir(long x)(Code) | | Maintain a pool of randomness using a modified 64-bit
congruential generator with multipliers dynamically
selected from a set of pseudo-random values.
Parameters: x - the source of randomness |
value | public long value()(Code) | | Returns the current random value.
|
value_and_stir | public long value_and_stir()(Code) | | Stirs, then returns the (new) current random value.
Use the current time (long milliseconds) as a source of randomness
for stirring.
|
value_and_stir | public long value_and_stir(long mix)(Code) | | Stirs, then returns the (new) current random value.
Parameters: mix - the source of randomness for stirring |
|
|