Skip to content

Commit b8151e7

Browse files
committed
fix error
1 parent c3476c8 commit b8151e7

File tree

1 file changed

+1
-1
lines changed
  • balrog/environments/battleships

1 file changed

+1
-1
lines changed

balrog/environments/battleships/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def _reward_shaping(self, obs, reward):
7777

7878
for i in range(1, self.num_ships + 1):
7979
ship = (self.ships == i).astype(int)
80-
ship_sunk = np.all(np.bitwise_and(ship, hits[0].astype(int)) == ship)
80+
ship_sunk = np.all(np.bitwise_and(ship, hits.astype(int)) == ship)
8181
if ship_sunk and i not in self.sunk_ships:
8282
self.sunk_ships.add(i)
8383
return 10 # +10 reward for sinking the ship

0 commit comments

Comments
 (0)