Skip to content

Fix off-by-one error in defining the start and end of an XYEnvironment #1303

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hal609
Copy link

@hal609 hal609 commented Oct 4, 2024

When a new XYEnvironment object is created it is given attributes hight and width which are then used to assign the attributes x_end and y_end. However, the x_end and y_end should be one less than the width as the positional index starts at one.

By fixing this it ensures that the is_inbounds returns the correct value and environments can correctly check if things are inbounds.

weasdown added a commit to weasdown/aima-python that referenced this pull request Feb 5, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant