Skip to content

Commit

Permalink
multiagent reward
Browse files Browse the repository at this point in the history
  • Loading branch information
JacopoPan committed Nov 20, 2023
1 parent b5d3549 commit d1948db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gym_pybullet_drones/envs/LeaderFollowerAviary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

################################################################################
Expand Down

0 comments on commit d1948db

Please sign in to comment.