Add make_infoset and rewrite information-set operations in terms of it - #999
Add make_infoset and rewrite information-set operations in terms of it#999d-kad wants to merge 6 commits into
Conversation
tturocy
left a comment
There was a problem hiding this comment.
I think this is mostly looking good. Are there any places in our existing tutorials or other materials where we should be using make_infoset in place of the other functions we are defining in terms of make_infoset?
See the main PR thread for other higher-level questions/next steps.
| return g | ||
|
|
||
|
|
||
| def create_two_pair_infosets_efg() -> gbt.Game: |
There was a problem hiding this comment.
We're trying to avoid introducing more games to this file - we want to be removing them actually. Can this test be accomplished by another existing catalog game, or if not, we should make such functions utility functions located close to the test(s) they are relevant for.
| assert list(proxy.members) == [node] | ||
|
|
||
|
|
||
| def test_leave_infoset_sole_member_is_noop(): |
There was a problem hiding this comment.
I would move these under test_infosets, as they are manipulations of information structure.
(Overall our organisation of tests by the type of object is not ideal anyway.)
| information set; the primitive operation for editing information structures. | ||
|
|
||
| ### Changed | ||
| - `Game.leave_infoset`, `Game.set_infoset`, `Game.set_player`, and `Game.reveal` are now |
There was a problem hiding this comment.
Implementation detail changes are probably not important. Changes to user-visible behaviour are, but ideally would be individual bullet points as they're actually logically separate (but I agree doing them all at once by thinking about edge cases while reimplementing makes sense rather than proliferating PRs)
|
The next action on this is to push the implementation of A new complementary issue #1009 provides a proposed way forward of dealing with nodes which heretofore we have called "chance infosets". |
Description of the changes in this PR
Adds
Game.make_infoset(nodes, player, label=None), which forms a set of personal decision nodesinto a single information set. This is the primitive for editing information structure;
leave_infoset,set_infoset,set_player, andrevealare rewritten in terms of it.Behavior changes:
set_infosetnow requires the node's actions to match the target infoset's, with the same labels in the same order(previously only the count was checked), and rejects terminal and chance nodes.
revealnow raises on an absent-minded information set (previously the result was undefined).Adds tests for
make_infosetand for the four rewritten operations, which previously had little or no coverage.Implemented in Cython over existing C++ operations; a native C++
MakeInfosetand the choice of which derived operations to retain are the following steps.