Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opponent seed is not propagated after env.copy() #274

Closed
BDonnot opened this issue Jan 12, 2022 · 0 comments · Fixed by #278 or #279
Closed

Opponent seed is not propagated after env.copy() #274

BDonnot opened this issue Jan 12, 2022 · 0 comments · Fixed by #278 or #279
Labels
bug Something isn't working

Comments

@BDonnot
Copy link
Collaborator

BDonnot commented Jan 12, 2022

Environment

  • Grid2op version: 1.6.4
  • System: windows
  • Additional system information: None

Bug description

When calling "env.copy()" the opponent does not attack correctly.

This is probably due to an issue in the "seed" function.

How to reproduce

Code snippet

import grid2op
env = grid2op.make("l2rpn_icaps_2021", test=True)
env.seed(3)
env.reset()
print(f"{env._opponent._attack_times = }")
env_cpy = env.copy()
print(f"{env._opponent._attack_times = }")
print(f"{env_cpy._opponent._attack_times = }")
... # Some code 

Current output

env._opponent._attack_times = array([  5, 105, 180])
env._opponent._attack_times = array([  5, 105, 180])
env_cpy._opponent._attack_times = array([], dtype=int32)

Expected output

env._opponent._attack_times = array([  5, 105, 180])
env._opponent._attack_times = array([  5, 105, 180])
env_cpy._opponent._attack_times = array([ 5, 105, 180], dtype=int32)
@BDonnot BDonnot added the bug Something isn't working label Jan 12, 2022
BDonnot referenced this issue in BDonnot/Grid2Op Jan 12, 2022
@BDonnot BDonnot linked a pull request Jan 19, 2022 that will close this issue
@BDonnot BDonnot linked a pull request Jan 19, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant