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

AbstractWrappedEnvironment #40

Open
colinxs opened this issue May 6, 2020 · 0 comments
Open

AbstractWrappedEnvironment #40

colinxs opened this issue May 6, 2020 · 0 comments

Comments

@colinxs
Copy link
Contributor

colinxs commented May 6, 2020

It'd be nice if we had something like:

struct MyWrappedEnvironment{E<:AbstractEnvironment} <: AbstractWrappedEnvironment
    parent::E
end
# default definition somewhere in Lyceum
Base.parent(env::AbstractWrappedEnvironment) = env.parent
getobservation!(o, env::AbstractWrappedEnvironment) = getobservation!(o, parent(env))
# user-defined overload
getstate!(s, env::MyWrappedEnvironment) = # ...

So that you didn't have to copy out the entire environment just to tweak one little thing. As a motivating example, say one wanted to learn a dynamics model for an AbstractMuJoCoEnvironment. The inclusion of qacc_warmstart as part of state makes that difficult, and removing it requires copying out an environment. AbstractWrappedEnvironment is one way to deal with that.

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

No branches or pull requests

1 participant