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

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

Open
1 task done
Delta-Sigma opened this issue Apr 5, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@Delta-Sigma
Copy link

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
@Delta-Sigma Delta-Sigma added the enhancement New feature or request label Apr 5, 2024
@Kallinteris-Andreas
Copy link
Collaborator

see #842, this will be worked on after 1.0 release

@Delta-Sigma
Copy link
Author

Delta-Sigma commented Apr 5, 2024

Thank you for your reply.

Just to be clear I am also interested in getting the last/current observation, not just the state e.g. in cases when internal state and observations are not the same and/or do not contain the same information.

Looking forward to 1.0

EDIT: Sorry I closed and opened the issue by mistake. You'll be the better judge of whether to mark it as closed or not. Sorry about the unwanted notifications.

@Kallinteris-Andreas
Copy link
Collaborator

Observation is already returned by step()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants