Repository navigation
Add Game.make_outcome, and represent absent outcomes by a null outcome - #1084
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
@d-kad @rahulsavani I've done a first review of this and it's in good shape. To this importantly I have added some new GUI features in the strategic form that try to hint at outcome structure and also allow editing of the outcome structure. Here's a game that's useful for trying it out, featuring both multiple-cell outcomes and also some "null" outcomes Please have a go, views welcome |
|
Had a go everything I tried works nicely, liked the hover highlighting feature especially! Multi-cell merge across non-adjacent cells didn't work on macOS. |
# Conflicts: # ChangeLog
This is a good idea. I have extended it also so that gesture is now a toggle, doesn't just add but can also be used to remove the contingency. |
Issues closed by this PR
make_outcome#1061Description of the changes in this PR
This PR implements
Game.make_outcomeand the null-outcome representation from #1061.The removal of
Game.add_outcome/Game.delete_outcome, and the implicit deletion that depends on it are to follow.Absent outcomes are represented internally by a per-game null outcome, so nodes and contingencies never hold
a null pointer and payoff calculations need no null guards.
From calling code, a node or contingency with no outcome now reports that outcome rather than
None;it has
labelandnumberofNone, zero payoffs, and compares unequal to everything including itself,following the treatment of missing values in
pandas.Null outcomes do not appear when iterating over a game's outcomes, and assigning a payoff to
one raises
UndefinedOperationError.Game.make_outcomecreates an outcome and attaches it to a set of nodes (extensive) or contingencies (strategic)in a single operation, treating them as an equivalence class (cf.
Game.make_infosetandGame.make_event).Payoffs are given as a mapping over all of the game's players. An outcome all of whose references are
taken over by the operation is removed from the game; its label may then be reused (cf.
Game.make_infoset).Game.new_tableno longer creates an outcome for every contingency; outcomes are created as they are needed.Game.from_arraysandGame.from_dictare unaffected, as supplying payoffs creates the outcomes which hold them.