Number reduced strategies sequentially instead of by action signature - #1002
Number reduced strategies sequentially instead of by action signature#1002d-kad wants to merge 5 commits into
Conversation
|
I've cherry-picked out the sparsity violation and made a separate PR, as consistent use of I suggest that many of the tests we had with strategy labels were actually testing that we are generating the correct sets of reduced strategies - as we were saying, the crux of the problem is that the strategy label was doing double duty as sometimes communicating details about the reduced strategy mapping of infosets to actions. So I propose these tests shouldn't just have the strategy labels changed because this is effectively losing coverage. Just as a for-example, So at least some of these tests should probably be rewritten to exercise |
|
I have added a commit which proposes some crude UX for the GUI - left-clicking a strategy label in the reduced strategic game pops up a transient window showing the map. It's really basic, but at least we don't lose information for now. This will tie into the bigger discussion we are having about UX for strategic games (and the GUI in general). @rahulsavani Noting for you as we should think about what features we might want to explore/display the reduced strategy space, or richer visualisation of the Kuhn's theorem mapping from strategies to behaviours... |
| return create_efg_corresponding_to_bimatrix_game(A, B, title) | ||
|
|
||
|
|
||
| def strategy_map(player: gbt.Player, strategy: gbt.Strategy) -> tuple: |
There was a problem hiding this comment.
This is a function that actually ought to be part of the game API.
I would suggest something like Game.get_behavior(player: str, strategy: str).
This should return an object which is map-like. We should be able to pass a node or information set (for the moment) to it, and it should return the prescribed action label, or raise an exception if the player does not have the move at that node or information set.
@rahulsavani to think about/discuss at the next meeting.
Yes, in particular, I worked hard to get the correct old labels in the classes underlying these tests: They seem like natural ones to adapt for still testing that we are doing the strategy map correctly. |
…om a given strategy.
919d967 to
940e07f
Compare
Description of the changes in this PR
Reduced strategies of extensive games were labelled by concatenating the chosen action's number
at each information set (
"*"where unspecified). These labels were not injective — once an information sethad ten or more actions,
(1, 11)and(11, 1)both rendered"111"— which broke NFG round-trippingand made label lookup ambiguous.
This PR labels reduced strategies by their sequence number in generation order (
"1","2", ...),matching table games. The order is deterministic.
A separate commit fixes unrelated
m_behavmap pollution found alongside this.