We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3084967 commit 2a56cceCopy full SHA for 2a56cce
balrog/environments/battleships/base.py
@@ -77,7 +77,7 @@ def _reward_shaping(self, obs, reward):
77
78
for i in range(1, self.num_ships + 1):
79
ship = (self.ships == i).astype(int)
80
- ship_sunk = np.all(np.bitwise_and(ship, hits[0].astype(int)) == ship)
+ ship_sunk = np.all(np.bitwise_and(ship, hits.astype(int)) == ship)
81
if ship_sunk and i not in self.sunk_ships:
82
self.sunk_ships.add(i)
83
return 10 # +10 reward for sinking the ship
0 commit comments