mirror of
https://gitlab.rlp.net/mobitar/ReCo.jl.git
synced 2025-01-03 15:49:20 +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
|
using ..ReCo: ReCo
|
||||||
|
|
||||||
|
const TRIGGER = 0.6
|
||||||
|
|
||||||
struct LocalCOMWithAdditionalShapeRewardEnv <: Env
|
struct LocalCOMWithAdditionalShapeRewardEnv <: Env
|
||||||
shared::EnvSharedProps
|
shared::EnvSharedProps
|
||||||
|
|
||||||
|
@ -158,7 +160,10 @@ function state_update_hook!(
|
||||||
distance_to_local_center_of_mass_sum / n_particles
|
distance_to_local_center_of_mass_sum / n_particles
|
||||||
env_helper.add_shape_reward_term =
|
env_helper.add_shape_reward_term =
|
||||||
mean_distance_to_local_center_of_mass /
|
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)
|
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
|
using ..ReCo: ReCo
|
||||||
|
|
||||||
|
const TRIGGER = 0.6
|
||||||
|
|
||||||
struct LocalCOMWithAdditionalShapeRewardEnv2 <: Env
|
struct LocalCOMWithAdditionalShapeRewardEnv2 <: Env
|
||||||
shared::EnvSharedProps
|
shared::EnvSharedProps
|
||||||
|
|
||||||
|
@ -156,7 +158,7 @@ function state_update_hook!(
|
||||||
distance_to_local_center_of_mass_sum / n_particles
|
distance_to_local_center_of_mass_sum / n_particles
|
||||||
env_helper.add_shape_reward_term =
|
env_helper.add_shape_reward_term =
|
||||||
mean_distance_to_local_center_of_mass /
|
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
|
return nothing
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue