Skip to content

Conversation

@jhtschultz
Copy link
Member

Addresses Issue #401. As requested, GetAllHistories() returns a std::vector<std::unique_ptr<State>>.

Use State::FullHistory to check for equality, rather than State::ToString

Is there any reason we need to actually perform this check for equality or will a DFS suffice? I couldn’t come up with a scenario in which there’s a difference so I implemented it as a straightforward DFS. Wanted to check though because there’s been some discussion around this issue and I could well have missed something.

I gave GetAllHistories() its own file. Seemed like the right way to go but if there’s a preference for including it in the get_all_states file as a separate function I’m happy to do that.

And if there’s anything else I can do for this PR just let me know :)

@google-cla google-cla bot added the cla: yes label Oct 10, 2020
@gabrfarina
Copy link
Contributor

gabrfarina commented Oct 10, 2020

I'm not a maintainer, but I think there was consensus that the code that counts infosets in open_spiel/examples/count_all_states.cc would need to move to GetAllHistories to avoid undercounting in some classes of games (#399).

Thanks for this, once it lands I will move the tests in #376 to use it :-)

@jhtschultz
Copy link
Member Author

That ought to do it. Thanks @gabrfarina!

OpenSpiel pushed a commit that referenced this pull request Oct 11, 2020
PiperOrigin-RevId: 336522286
Change-Id: I749a52f22a83a026ddbbae982586425dccb4a82e
@lanctot
Copy link
Collaborator

lanctot commented Oct 11, 2020

Oh hey John, seems like there is a conflict with master, can you double check that your last commit was included in the update along with the rest?

@lanctot lanctot closed this Oct 11, 2020
@lanctot
Copy link
Collaborator

lanctot commented Oct 11, 2020

Just checked, it was not included. Sorry, completely missed that (I modified the same file internally.)

But also: I don't think we want to replace states entirely with histories in that example because that would overcount states in the perfect information games, right?

Edit: just noticed the example doesn't actually count the states! It probably should... given the file name. ;-) I can do both before next update (Tuesday).

@jhtschultz jhtschultz deleted the get_all_histories branch October 13, 2020 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants