Skip to content

Commit

Permalink
Fix Bugs in gym_env
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjarne-55 committed Oct 8, 2024
1 parent ddc3d8c commit 0fb47ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mushroom_rl/environments/gym_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __init__(self, name, horizon=None, gamma=0.99, wrappers=None, wrappers_args=

def reset(self, state=None):
if state is None:
return np.atleast_1d(self.env.reset()), {}
return np.atleast_1d(self.env.reset()[0]), {}
else:
self.env.reset()
self.env.state = state
Expand All @@ -90,7 +90,7 @@ def reset(self, state=None):

def step(self, action):
action = self._convert_action(action)
obs, reward, absorbing, info = self.env.step(action)
obs, reward, absorbing, _, info = self.env.step(action)

return np.atleast_1d(obs), reward, absorbing, info

Expand Down

0 comments on commit 0fb47ec

Please sign in to comment.