Random generators and state.
Make new random seeds deterministically from a base random seed.
Generate a random int using this object’s base state.
Returns: result – an integer that can be used to seed other random states deterministically. Return type: int
Set the random seed state in this object.
Parameters: hs (None, int, array_like) – seed the random state of this object, see numpy.random.RandomState for valid inputs.
Generate an endless sequence of permutations of the set [0, ..., N).
If we call this N times, we will sweep through the entire set without replacement, on the (N+1)th call a new permutation will be created, etc.
Parameters: N (int) – the length of the set Yields: int – yeilds a random int from the set [0, ..., N)
>>> perm = endless_permutations(5) >>> type(perm) <class 'generator'> >>> p = next(perm) >>> p < 5 True >>> p2 = next(perm) >>> p2 != p True
Set the global hyperseed from which to generate all other seeds.
Parameters: hs (None, int, array_like) – seed the random state of the global hyperseed, see numpy.random.RandomState for valid inputs.