Skip to content

Commit

Permalink
Deep sea treasure We have found that there is an error in the _is_val…
Browse files Browse the repository at this point in the history
…id_state of the environment. (#112)
  • Loading branch information
Daiki04 authored Dec 11, 2024
1 parent 1c672e7 commit 4db1fd0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions mo_gymnasium/envs/deep_sea_treasure/deep_sea_treasure.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,16 @@ def _get_map_value(self, pos):
return self.sea_map[pos[0]][pos[1]]

def _is_valid_state(self, state):
if state[0] >= 0 and state[0] <= 10 and state[1] >= 0 and state[1] <= 10:
if self._get_map_value(state) != -10:
return True
return False
if self.map_name == "mirrored":
if state[0] >= 0 and state[0] <= 10 and state[1] >= 0 and state[1] <= 19:
if self._get_map_value(state) != -10:
return True
return False
else:
if state[0] >= 0 and state[0] <= 10 and state[1] >= 0 and state[1] <= 10:
if self._get_map_value(state) != -10:
return True
return False

def render(self):
if self.render_mode is None:
Expand Down

0 comments on commit 4db1fd0

Please sign in to comment.