Skip to content

Commit

Permalink
Bugfix Four Room rendering (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnathan-L-Gross authored Jan 31, 2025
1 parent 4db1fd0 commit 1e79709
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mo_gymnasium/envs/four_room/four_room.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ def step(self, action):
# can now move
self.state = (s1, collected)

if self.render_mode == "human":
self.render()

# into a goal cell
if s1 == self.goal:
phi = np.ones(len(self.all_shapes), dtype=np.float32)
Expand Down Expand Up @@ -206,9 +209,6 @@ def step(self, action):
phi = self.features(old_state, action, self.state)
return self.state_to_array(self.state), phi, terminated, False, {}

if self.render_mode == "human":
self.render()

# into an empty cell
return (
self.state_to_array(self.state),
Expand Down

0 comments on commit 1e79709

Please # to comment.