Closed kraftpunk97-zz closed 5 years ago
Great work, @kraftpunk97 ! Regarding the returned environment, my idea was something as following:
mutable struct EnvWrapper
done::Bool
total_reward
frames::Int
trainable::Bool
# any other metadata can be put here
env::AbstractEnv
end
function step!(env_wrap::EnvWrapper, a)
s', r, done, _ = step!(env_wrap.env, a)
env_wrap.total_reward += r
env_wrap.done = done
env_wrap.frames += 1
return s', r, done, _
end
function reset!(env_wrap::EnvWrapper)
env_wrap.done = false
env_wrap.total_reward = 0
env_wrap.frames = 0
reset!(env_wrap.env)
end
state(env_wrap::EnvWrapper) = env_wrap.env.state
How does returned environment of make
compare with this?
PR added with reference to issue #10. Had to restructure the package. All the environments have been moved to
src/Envs/classic_control/
directory. The utility for rendering has been relocated tosrc/vis/utils.jl
The global registry itself is defined in
src/Envs/registration.jl
. It can be accessed using two functions,make
andregister
.register
is used to register a new environment the call to which can be called fromsrc/Envs/registry.jl
. Eachregister
calls requires a string to be used when calling viamake
, a symbol of the Environment type and the path to the file where the environment is defined.make
calls require just the name of the environment and any additional keyword arguments, but that needs to be tested/implemented.@tejank10 Please review and provide feedback :)