argosim.rand_utils module#
Random utils.
A small module to hold a class for a temporary seed, so as to not mess with any global seed.
- Authors:
Samuel Gullin <gullin@ia.forth.gr>
- class argosim.rand_utils.local_seed(seed=None)[source]#
Bases:
object
Holds a seed for use with numpy.random in a local scope.
Can be instantiated with no seed, in which case it will yield the default behaviour. Note that if seed is set to the same seed numpy was using outside this scope, that doesn’t mean the state is the same – if you intend to keep the same state, use seed = None.
- seed#
The seed used for numpy.random in the local scope.
- Type:
int, optional
- old_state#
The state of numpy.random outside this scope, to be resumed afterwards.