FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Define equality of MCState by ruddyscent · Pull Request #21 · davecom/ClassicComputerScienceProblemsInPython · GitHub

Define equality of MCState - #21

Open
ruddyscent wants to merge 4 commits into
davecom:masterfrom
ruddyscent:ruddyscent-patch-1
Open

Define equality of MCState#21
ruddyscent wants to merge 4 commits into
davecom:masterfrom
ruddyscent:ruddyscent-patch-1

Conversation

ruddyscent commented Oct 29, 2023
edited
Loading

Copy link
Copy Markdown
Contributor

While debugging missionaries.py, I discovered that the explored set accumulates duplicate MCStates.

To solve this problem, I've overridden the __eq__ and __hash__ of the MCState.

This patch resolves the issue [#22]

If __eq__ and __hash__ are not defined, duplicated MCStates will be piled up in the explored set.
A base number should be bigger than a digit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

1 participant


Back | FazBrowse Home | New Git URL