pyrado

Module contents

set_seed(seed: Optional[int], sub_seed: Optional[int] = None, sub_sub_seed: Optional[int] = None, verbose: bool = False) Optional[int][source]

Set the seed for the random number generators. The actual seed is computed from the base seed seed´, and the first- and second-order sub-seeds (`sub_seed and sub_sub_seed, respectively). All of these seeds get concatenated in a string which is then MD5-hashed and crushed into a 32-bit integer.

Parameters:
  • seed – base seed, pass None to skip seeding; must be an unsigned 10-bit integer

  • sub_seed – sub-seed, defaults to zero; must be an unsigned 14-bit integer; overflows will be cast back into the interval by masking, i.e., only the last 14 bits will be kept; underflows are first made positive by taking the absolute value

  • sub_sub_seed – sub-sub-seed, defaults to zero; must be an unsigned 8-bit integer; underflows will be cast back into the interval by taking the absolute value

  • verbose – if True the seed is printed

Returns:

the seed that was set