RandomStream
This class represents a pseudo-random stream, such as the one consumed by the
Monte Carlo transport. The stream can be shifted forwards or backwards using the
index attribute. By default, the stream is
seeded using the system entropy.
Constructor
- class RandomStream(seed=None)
The seed argument should be a 128-bit integer. If no seed is provided, a random value will be chosen using the system entropy.
Attributes
Note
The attributes below are both readable and writable. For instance, decreasing the index will rewind the pseudo-random stream.
Methods
- RandomStream.normal(shape=None)
Returns pseudo-random numbers that are distributed according to the Normal distribution. If the shape argument is not specified, the function will return a single
float. Otherwise, it will return anumpy.ndarrayof pseudo-random values with the specified shape.
- RandomStream.uniform01(shape=None)
Returns pseudo-random numbers that are uniformly distributed over \((0,1)\). As above, depending on the shape argument, the function will return a single
floator anumpy.ndarray.