Skip to content

Commit

Permalink
Fixed Validate of Deep sea treasure
Browse files Browse the repository at this point in the history
  • Loading branch information
Daiki04 committed Dec 11, 2024
1 parent 1c672e7 commit 02ae8fe
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 02ae8fe

Please sign in to comment.