1
0
Fork 0
mirror of https://gitlab.rlp.net/mobitar/ReCo.jl.git synced 2024-09-19 19:01:17 +00:00
ReCo.jl/src/RL/EnvHelper.jl

49 lines
1.2 KiB
Julia
Raw Normal View History

2022-01-11 18:00:41 +00:00
abstract type EnvHelper end
struct EnvHelperSharedProps{H<:AbstractHook}
env::Env
agent::Agent
hook::H
n_steps_before_actions_update::Int64
goal_gyration_tensor_eigvals_ratio::Float64
n_particles::Int64
2022-01-15 20:27:15 +00:00
old_states_id::Vector{Int64}
states_id::Vector{Int64}
2022-01-11 18:00:41 +00:00
actions::Vector{SVector{2,Float64}}
2022-01-15 20:27:15 +00:00
actions_id::Vector{Int64}
2022-01-11 18:00:41 +00:00
function EnvHelperSharedProps(
env::Env,
agent::Agent,
2022-01-18 01:17:52 +00:00
hook::AbstractHook,
2022-01-11 18:00:41 +00:00
n_steps_before_actions_update::Int64,
goal_gyration_tensor_eigvals_ratio::Float64,
n_particles::Int64,
2022-01-18 01:17:52 +00:00
)
return new(
2022-01-11 18:00:41 +00:00
env,
agent,
hook,
n_steps_before_actions_update,
goal_gyration_tensor_eigvals_ratio,
n_particles,
fill(0, n_particles),
fill(0, n_particles),
fill(SVector(0.0, 0.0), n_particles),
fill(0, n_particles),
)
end
end
2022-01-14 11:28:47 +00:00
function gen_env_helper(::Env, env_helper_params::EnvHelperSharedProps; args)
2022-01-14 12:01:14 +00:00
return ReCo.method_not_implemented()
2022-01-11 18:00:41 +00:00
end
function get_env_agent_hook(env_helper::EnvHelper)
return (env_helper.shared.env, env_helper.shared.agent, env_helper.shared.hook)
end