Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deep sea treasure We have found that there is an error in the _is_valid_state of the environment. #112

Merged

Conversation

Daiki04
Copy link
Contributor

@Daiki04 Daiki04 commented Dec 11, 2024

Deep sea treasure I found that there was an error in the _is_valid_state of the environment. In the MIRRORED environment, the x-coordinate is from 0 to 19, but the _is_valid_state was set so that the x-coordinate can only be from 0 to 10. Validate was modified as follows.

    def _is_valid_state(self, state):
        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

@ffelten ffelten merged commit 4db1fd0 into Farama-Foundation:main Dec 11, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants