Transient Random class. Seed/state is not kept after
serializing/deserializing.
Within Blocks Framework - if we initialize Random within the Piece, when
it's serialzied and copied to all workers and all threads - keeping seed
would cause same series of random numbers to be generated everywhere.
So this class is safe to be used in Pieces, while using regular Random
class is forbidden to be serialized.
Best approach would be to not have Random serialized, and create it on
workers, where possible.
Returns a pseudorandom, uniformly distributed int value
between 0 (inclusive) and the specified value (exclusive), drawn from
this random number generator's sequence.
Returns a pseudorandom, uniformly distributed int value
between 0 (inclusive) and the specified value (exclusive), drawn from
this random number generator's sequence.
Parameters:
n - Given upper limit
Returns:
pseudorandom integer number in [0, n) range.
nextDouble
public double nextDouble()
Returns the next pseudorandom, uniformly distributed
double value between 0.0 and
1.0 from this random number generator's sequence.