mirror of
https://gitlab.rlp.net/mobitar/ReCo.jl.git
synced 2024-12-30 16:13:32 +00:00
Adjust triggers
This commit is contained in:
parent
a2c2585afe
commit
c2c475d027
2 changed files with 9 additions and 2 deletions
|
@ -5,6 +5,8 @@ The minimization variable of the additional reward term is the individual ellipt
|
|||
|
||||
using ..ReCo: ReCo
|
||||
|
||||
const TRIGGER = 0.6
|
||||
|
||||
struct LocalCOMWithAdditionalShapeRewardEnv <: Env
|
||||
shared::EnvSharedProps
|
||||
|
||||
|
@ -158,7 +160,10 @@ function state_update_hook!(
|
|||
distance_to_local_center_of_mass_sum / n_particles
|
||||
env_helper.add_shape_reward_term =
|
||||
mean_distance_to_local_center_of_mass /
|
||||
env_helper.max_distance_to_local_center_of_mass < 0.32
|
||||
env_helper.max_distance_to_local_center_of_mass < TRIGGER
|
||||
if env_helper.add_shape_reward_term
|
||||
print("*")
|
||||
end
|
||||
|
||||
env_helper.center_of_mass = ReCo.center_of_mass(particles, env_helper.half_box_len)
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@ The minimization variable of the additional reward term is the absolute differen
|
|||
|
||||
using ..ReCo: ReCo
|
||||
|
||||
const TRIGGER = 0.6
|
||||
|
||||
struct LocalCOMWithAdditionalShapeRewardEnv2 <: Env
|
||||
shared::EnvSharedProps
|
||||
|
||||
|
@ -156,7 +158,7 @@ function state_update_hook!(
|
|||
distance_to_local_center_of_mass_sum / n_particles
|
||||
env_helper.add_shape_reward_term =
|
||||
mean_distance_to_local_center_of_mass /
|
||||
env_helper.max_distance_to_local_center_of_mass < 0.32
|
||||
env_helper.max_distance_to_local_center_of_mass < TRIGGER
|
||||
|
||||
return nothing
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue