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
2022-01-18 02:25:28 +01:00

49 lines
No EOL
1.2 KiB
Julia

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
old_states_id::Vector{Int64}
states_id::Vector{Int64}
actions::Vector{SVector{2,Float64}}
actions_id::Vector{Int64}
function EnvHelperSharedProps(
env::Env,
agent::Agent,
hook::H,
n_steps_before_actions_update::Int64,
goal_gyration_tensor_eigvals_ratio::Float64,
n_particles::Int64,
) where {H<:AbstractHook}
return new{H}(
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
function gen_env_helper(::Env, env_helper_params::EnvHelperSharedProps; args)
return ReCo.method_not_implemented()
end
function get_env_agent_hook(env_helper::EnvHelper)
return (env_helper.shared.env, env_helper.shared.agent, env_helper.shared.hook)
end