-
Notifications
You must be signed in to change notification settings - Fork 118
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
Fetching the 'True' Chronics with obs.simulate(...) #657
Labels
bug
Something isn't working
Comments
Hello, I will fix it ASAP. In the mean time (the grid2op release with this fix will wait for some other modifications) I suggest you use: class WeirdReward(BaseReward):
def __init__(self, logger: Logger = None):
super().__init__(logger)
def __call__(self, action: BaseAction, env:BaseEnv, has_error: bool, is_done: bool, is_illegal: bool, is_ambiguous: bool) -> float:
if self.is_simulated_env(env):
return 0. # the data for the simulation does not mean anything, better not use it
# now you can use env.chronics_handler.get_name()
return super().__call__(action, env, has_error, is_done, is_illegal, is_ambiguous) |
Oh and by the way, the "True" chronics will never be fed to "obs.simulate" this is a design choice to ensure that a user cannot access the "future" data, in the same way that accessing a real simulator will not provide you any data about the future. |
BDonnot
added a commit
to BDonnot/Grid2Op
that referenced
this issue
Nov 6, 2024
Signed-off-by: DONNOT Benjamin <[email protected]>
DEUCE1957
pushed a commit
to DEUCE1957/Grid2Op
that referenced
this issue
Nov 8, 2024
Signed-off-by: DONNOT Benjamin <[email protected]> Signed-off-by: Xavier Weiss <[email protected]>
DEUCE1957
pushed a commit
to DEUCE1957/Grid2Op
that referenced
this issue
Nov 20, 2024
Signed-off-by: DONNOT Benjamin <[email protected]> Signed-off-by: Xavier Weiss <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
1.11.0.dev0
ArchLinux
Bug description
A normal, fully initialized, Environment has a chronics_handler - from which you can get the name / ID of the current episode:
The call to the Reward Function has the following signature (from BaseReward):
Hence it should be possible to use
env.chronics_handler.get_name()
inside a custom reward function, since BaseEnv includes the chronics handler. This is useful for, for instance, fetching the load profiles.However, this will throw an error if we use obs.simulate():
Since the _ObsEnv class is used in place of the normal BaseEnv, the normal chronics handler does not exist.
My current workaround is to use:
Minimal Example
The text was updated successfully, but these errors were encountered: