From d1948db6501aec099283b5d633a46eea38ef1466 Mon Sep 17 00:00:00 2001 From: Jacopo Panerati Date: Mon, 20 Nov 2023 23:06:54 +0400 Subject: [PATCH] multiagent reward --- gym_pybullet_drones/envs/LeaderFollowerAviary.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gym_pybullet_drones/envs/LeaderFollowerAviary.py b/gym_pybullet_drones/envs/LeaderFollowerAviary.py index 847c68baa..6beca9fa7 100644 --- a/gym_pybullet_drones/envs/LeaderFollowerAviary.py +++ b/gym_pybullet_drones/envs/LeaderFollowerAviary.py @@ -81,9 +81,9 @@ def _computeReward(self): """ states = np.array([self._getDroneStateVector(i) for i in range(self.NUM_DRONES)]) - ret = max(0, 100 - np.linalg.norm(self.TARGET_POS-states[0, 0:3])**2) + ret = max(0, 10 - np.linalg.norm(self.TARGET_POS-states[0, 0:3])**4) for i in range(1, self.NUM_DRONES): - ret += max(0, 10 - np.linalg.norm(states[i-1, 3]-states[i, 3])**2) + ret += max(0, 10 - np.linalg.norm(states[i-1, 3]-states[i, 3])**4) return ret ################################################################################