Skip to content

Commit ebc397f

Browse files
committed
Fix: correct joint passage reward function (issue #145)
1 parent 34d1735 commit ebc397f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

vmas/scenarios/joint_passage.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,10 @@ def reward(self, agent: Agent):
458458
self.world.get_distance(a, passage)
459459
<= self.min_collision_distance
460460
] += self.collision_reward
461-
for wall in self.walls:
462-
self.collision_rew[
463-
self.world.get_distance(a, wall)
464-
<= self.min_collision_distance
465-
] += self.collision_reward
461+
for wall in self.walls:
462+
self.collision_rew[
463+
self.world.get_distance(a, wall) <= self.min_collision_distance
464+
] += self.collision_reward
466465

467466
# Joint collisions
468467
for p in self.passages:

0 commit comments

Comments
 (0)