Skip to content

Commit

Permalink
info on gym + env.seed
Browse files Browse the repository at this point in the history
  • Loading branch information
aboundy committed Oct 29, 2023
1 parent b1737c8 commit db0f7ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pufferlib/environments/pokemon_red_updated.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ def __init__(

self.reset()

def reset(self):
def reset(self, seed=None):
# Gym v26 favours `Env.reset(seed=seed)` this allows seeding to only be changed on environment reset.
# https://gymnasium.farama.org/content/migration-guide/#seed-and-random-number-generator
self.seed = seed

# restart game, skipping credits
self.initial_state.seek(0)
self.pyboy.load_state(self.initial_state)
Expand Down

0 comments on commit db0f7ad

Please sign in to comment.