From 6c9467f21ec5da08d5637ee693afc1f0eac36c78 Mon Sep 17 00:00:00 2001 From: MagDish <2717360869@qq.com> Date: Wed, 25 Sep 2024 22:20:06 +0800 Subject: [PATCH] new --- scripts/gyms/dribble.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/gyms/dribble.py b/scripts/gyms/dribble.py index c78d9a2..0211373 100644 --- a/scripts/gyms/dribble.py +++ b/scripts/gyms/dribble.py @@ -259,6 +259,7 @@ class dribble(gym.Env): def close(self): Draw.clear_all() self.player.terminate() + def execute(self, action): # Actions: @@ -354,7 +355,7 @@ class dribble(gym.Env): loss = self.loss(obs, action_p, action_r) # 计算奖励 - reward = np.linalg.norm(w.ball_cheat_abs_vel) * cos_theta + reward = np.linalg.norm(w.ball_cheat_abs_vel) * cos_theta + loss if self.ball_dist_hip_center_2d < 0.115: reward = 0