Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _seed(self, seed=None):
self.np_random, seed = seeding.np_random(seed)
# Update the random policy if needed
if isinstance(self.opponent, str):
if self.opponent == 'random':
self.opponent_policy = make_random_policy(self.np_random)
else:
raise error.Error('Unrecognized opponent policy {}'.format(self.opponent))
else:
self.opponent_policy = self.opponent
return [seed]
def seed(self, seed=None):
self.np_random, seed = seeding.np_random(seed)
return [seed]
def _seed(self, seed=None):
"""Sets the seed for this env's random number generator(s).
Note:
Some environments use multiple pseudorandom number generators.
We want to capture all such seeds used in order to ensure that
there aren't accidental correlations between multiple generators.
Returns:
list: Returns the list of seeds used in this env's random
number generators. The first value in the list should be the
"main" seed, or the value which a reproducer should pass to
'seed'. Often, the main seed equals the provided 'seed', but
this won't be true if seed=None, for example.
"""
self.np_random, seed = seeding.np_random(seed)
return [seed]
def _seed(self, seed=None):
self.np_random, seed = seeding.np_random(seed)
return [seed]
def _seed(self, seed=None):
self.np_random, seed = seeding.np_random(seed)
return [seed]
def _seed(self, seed=None):
self.np_random, seed = seeding.np_random(seed)
return [seed]
def seed(self, seed=None):
self.np_random, seed = seeding.np_random(seed)
return [seed]
def seed(self, seed=None):
self.np_random, seed = seeding.np_random(seed)
return [seed]
def _seed(self, seed=None):
self.np_random, seed = seeding.np_random(seed)
return [seed]
def _seed(self, seed=None):
self.np_random, seed = seeding.np_random(seed)
return [seed]