Skip to content

Commit 4ba44f6

Browse files
PBardecinjon
authored andcommitted
Board is always copied when returned as an observation to avoid in-place modification of the observation when state of the environment changes
1 parent 69da607 commit 4ba44f6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pommerman/forward_model.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,8 @@ def in_view_range(position, v_row, v_col):
546546
observations = []
547547
for agent in agents:
548548
agent_obs = {'alive': alive_agents}
549-
board = curr_board
549+
board = curr_board.copy()
550550
if is_partially_observable:
551-
board = board.copy()
552551
for row in range(board_size):
553552
for col in range(board_size):
554553
if not in_view_range(agent.position, row, col):

0 commit comments

Comments
 (0)