Skip to content

add new environment interface, add environment tests #7

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

Merged
merged 5 commits into from
Jan 8, 2020

Conversation

colinxs
Copy link
Contributor

@colinxs colinxs commented Jan 6, 2020

  1. Signature changes:
  • getreward -> getreward(state, action, observation, env)
  • geteval -> geteval(state, action, observation, env)
  • isdone -> isdone(state, action, observation, env)
    (the single argument versions (e.g. getreward(env)) is still defined for convenience, but internally calls getreward(getstate(env), getaction(env), getobservation(env), env)
  1. Renames:
  • AbstractEnv -> AbstractEnvironment
  • observationspace(env) -> obsspace(env)
  • evaluationspace(env) -> evalspace(env)
  • all env_ctor arguments to env_tconstructor
  • sharedmemory_envs(T, n, args...; kwargs...) -> tconstruct(T, n, args...; kwargs...)
  1. Removals:
  • NaieveEnvSampler (was primarily for debugging)
  • effective_timestep(env) (leaving just timestep(env))
  • reset!(env, state) and reset!(env, state, action)
  1. Additions:
  • setstate!(env, state) (replaces reset!(env, state))
  • docstrings
  • Some misc changes intended to address access to undefined reference in seed_threadrngs! #8
  • Moves test_env from LyceumMuJoCo.jl to LyceumBase.jl and provides more comprehensive test coverage for environments.
  • Misc improvements (e.g. more judicial use of @propagate_inbounds)

@colinxs colinxs merged commit 93d3c5e into master Jan 8, 2020
@colinxs colinxs deleted the env_interface_overhaul branch January 8, 2020 03:03
colinxs added a commit to Lyceum/LyceumMuJoCo.jl that referenced this pull request Jan 8, 2020
Updates LyceumMuJoCo.jl to reflect Lyceum/LyceumBase.jl#7

Additionally:

1) Signature changes:
2) Renames:
  - `AbstractMuJoCoEnv` -> `AbstractMuJoCoEnvironment` (to be consistent with `AbstractEnvironment`)
3) Removals:
  - `MJSimParameters` + related
  - All Gym env ports (to be added in separate PR with updated interface)
4) Additions:
  - More judicious use of `@propagate_inbounds`
  - `copystate!(sim, state)` (unexported), with same behavior as old `setstate!(sim, state)` (see below)
  - docstrings
  - `***_nofwd` functions (e.g. `setaction_nofwd!(sim, action)`) that don't call `mj_forward` (unexported)
5) Behavior changes:
  - `setstate!(sim, state)` now calls `mj_resetData`, copies over `state`, then calls `mj_forward` (see comment above `setstate!`). 
  - `setaction!(sim, action)` calls `mj_forwardSkip` with `mjSTAGE_VEL`
colinxs added a commit to Lyceum/LyceumAI.jl that referenced this pull request Jan 8, 2020
1. Updates LyceumAI to new env interface (Lyceum/LyceumBase.jl#7)
2. Adds NPG test on PointMass
colinxs added a commit to Lyceum/LyceumMuJoCoViz.jl that referenced this pull request Jan 9, 2020
1. Updates LyceumMuJoCoViz to new interface (Lyceum/LyceumBase.jl#7)
2. Fixed `BoundsError` when visualizing trajectories of different lengths
3. Fixes error with burst mode
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

Successfully merging this pull request may close these issues.

1 participant