def _seed(self, seed=None): self.np_random, seed1 = seeding.np_random(seed) # Derive a random seed. This gets passed as a uint, but gets # checked as an int elsewhere, so we need to keep it below # 2**31. seed2 = seeding.hash_seed(seed1 + 1) % 2**31 # Empirically, we need to seed before loading the ROM. self.ale.setInt(b'random_seed', seed2) self.ale.loadROM(self.game_path) return [seed1, seed2]
def _seed(self, seed=None): self.np_random, seed1 = seeding.np_random(seed) # Derive a random seed. seed2 = seeding.hash_seed(seed1 + 1) % 2 ** 32 pachi_py.pachi_srand(seed2) return [seed1, seed2]