From 02ae8fe5078072965bc03175526514de463b02e3 Mon Sep 17 00:00:00 2001 From: Daiki04 Date: Wed, 11 Dec 2024 12:13:29 +0900 Subject: [PATCH] Fixed Validate of Deep sea treasure --- .../envs/deep_sea_treasure/deep_sea_treasure.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mo_gymnasium/envs/deep_sea_treasure/deep_sea_treasure.py b/mo_gymnasium/envs/deep_sea_treasure/deep_sea_treasure.py index 374c15a0..479a880b 100644 --- a/mo_gymnasium/envs/deep_sea_treasure/deep_sea_treasure.py +++ b/mo_gymnasium/envs/deep_sea_treasure/deep_sea_treasure.py @@ -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: