Skip to content

Commit

Permalink
fix test_reset() function bug (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangjingzhi2003 authored Jul 16, 2024
1 parent e8fcbcf commit 8e70ce5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/test_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,11 @@ def test_reset():
steps = env.Tmax
# run the simulation util the
for i in range(steps):
env.step(np.array([0,0, 0])) # set constant amount of trap every year

curr_ob_space = env.observation_space
observation, reward, terminated, truncated, info = env.step(np.array([0,0, 0])) # set constant amount of trap every year

# if final observation space is [-1, -1], set it to other obseravtion space for test
if curr_ob_space == np.array([-1,-1]):
curr_ob_space = np.array([1,1])
if all(observation == np.array([-1,-1])):
observation = np.array([1,1])

# reset the obseravtion environment
new_ob_space, new_info = env.reset()
Expand Down

0 comments on commit 8e70ce5

Please sign in to comment.