Skip to content

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

@ruddyscent ruddyscent commented Oct 29, 2023

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant