Skip to content

Reset an environment with an observation as "init state" #707

Description

@BDonnot

Is your feature request related to a problem? Please describe.

It is not a problem, but something that could have some values, for example for debugging or even to help understand what is going on.

Today, we can achieve similar behviour by doing:

import grid2op
env_name = "l2rpn_case14_sandbox"
env = grid2op.make(env_name, ...)

obs = ... # an observation, from a runner or another environment.
saved_init_state = {"set_bus": obs.topo_vect, "injections": {"load_p": obs.load_p, "load_q": obs.load_q, "prod_p": obs.gen_p, "prod_v": obs.gen_v}}

similar_obs = obs = env.reset(options={"init state": saved_init_state})

This is pretty verbose and does not consider the cooldowns, timestep_overflow of similar environment attributes.

Describe the solution you'd like

Ex. This is how i would like it to be done:

import grid2op
env_name = ...
env = grid2op.make(env_name, ...)

similar_obs = obs = env.reset(options={"init state": obs})

Additional context

The "core" code should be pretty much done as this kind of feature is used for "ForecastedEnv" and for "obs.simulate" for example.
Only "glue code" should be done.

NB This would not keep the random state of the grid.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions