Skip to content

Commit

Permalink
add field_x-1 and field_y-1
Browse files Browse the repository at this point in the history
 A the true bound is [0, grid_size-1], add  field_x-1 and field_y-1 to the max_obs for non-grid_observation mode
  • Loading branch information
GoingMyWay committed Mar 24, 2022
1 parent fc5ad04 commit 068315a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lbforaging/foraging/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ def _get_observation_space(self):
max_food_level = self.max_player_level * len(self.players)

min_obs = [-1, -1, 0] * max_food + [-1, -1, 0] * len(self.players)
max_obs = [field_x, field_y, max_food_level] * max_food + [
field_x,
field_y,
max_obs = [field_x-1, field_y-1, max_food_level] * max_food + [
field_x-1,
field_y-1,
self.max_player_level,
] * len(self.players)
else:
Expand Down

0 comments on commit 068315a

Please sign in to comment.