Skip to content

[Proposal] Uniform API for Getting the Current State (and maybe setting it as well?) for Environments #995

Open
@Delta-Sigma

Description

@Delta-Sigma

Proposal

Uniform API for all environments for something like .get_state() and .set_state(state) or maybe .get_last_obs() or something like an Env instance attribute: Env.state

Motivation

All environments compute the state already and return it when you do reset or step. Getting the current state can be very neat e.g. when you want to have a wrapper to an environment that does something non-standard in some specific states e.g. only one tile in FrozenLake is slippery.

Sorry if this has been addressed already, I tried searching to the best of my ability whether this was already proposed or not.

And then, in the future, setting a state can also be very useful?

Pitch

No response

Alternatives

Alternatives that I can think of would not be so neat e.g. the wrapper is passed the last state every time some special needs to be taken, and user's code keeps track of last observation/state etc.

Another alternative would be that people needing such functionality modify the code of the environments themselves, which again I think is not so neat and requires needless diving into the internal workings of environments.

Additional context

No response

Checklist

  • I have checked that there is no similar issue in the repo

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