From 420fe105068f54ce018cc923586bed30c15263cc Mon Sep 17 00:00:00 2001 From: Maximilian Huettenrauch Date: Tue, 16 Feb 2021 18:47:08 +0100 Subject: [PATCH] biac normal cost --- alr_envs/mujoco/ball_in_a_cup/ball_in_a_cup_reward.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/alr_envs/mujoco/ball_in_a_cup/ball_in_a_cup_reward.py b/alr_envs/mujoco/ball_in_a_cup/ball_in_a_cup_reward.py index 525fe34..7c68e35 100644 --- a/alr_envs/mujoco/ball_in_a_cup/ball_in_a_cup_reward.py +++ b/alr_envs/mujoco/ball_in_a_cup/ball_in_a_cup_reward.py @@ -61,7 +61,7 @@ class BallInACupReward(alr_reward_fct.AlrReward): success = False if self.check_collision(sim): - reward = - 1e-5 * action_cost - 1000 + reward = - 1e-4 * action_cost - 1000 stop_sim = True return reward, success, stop_sim @@ -70,12 +70,13 @@ class BallInACupReward(alr_reward_fct.AlrReward): dist_final = self.dists_final[-1] dist_ctxt = self.dists_ctxt[-1] - cost = self._get_stage_wise_cost(ball_in_cup, min_dist, dist_final, dist_ctxt) - reward = np.exp(-1 * cost) - 1e-5 * action_cost + # cost = self._get_stage_wise_cost(ball_in_cup, min_dist, dist_final, dist_ctxt) + cost = 2 * (0.33 * min_dist + 0.33 * dist_final + 0.33 * dist_ctxt) + reward = np.exp(-1 * cost) - 1e-4 * action_cost stop_sim = True success = dist_final < 0.05 and ball_in_cup else: - reward = - 1e-5 * action_cost + reward = - 1e-4 * action_cost success = False return reward, success, stop_sim