Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Consolidate add_action/delete_action into single operation #378

Open
tturocy opened this issue Oct 11, 2023 · 0 comments
Open

ENH: Consolidate add_action/delete_action into single operation #378

tturocy opened this issue Oct 11, 2023 · 0 comments
Labels
c++ Items which involve writing in C++ enhancement python Items which involve coding in Python
Milestone

Comments

@tturocy
Copy link
Member

tturocy commented Oct 11, 2023

Overview

The add and delete actions operations could be coalesced into a single operation, which for the moment let's call set_actions. For a chance move, set_actions(infoset, actions) would require a mapping from actions to probabilities, where actions as usual could be specified by label or by action object (requiring the action to be an action at that information set). New actions could be added by introducing a new label, and actions deleted by dropping the label. This would also allow actions to be re-ordered - re-ordering the actions would result in the corresponding subtrees being reordered. For personal player moves, actions would just be a list instead of a mapping. This behaviour is similar to using DataFrame.reindex in pandas, where it's possible to add, delete, and reorder rows and columns arbitrarily.

Specifically, this was trigged by the realisation that delete_action on a chance information set necessarily involves dealing with the action probabilities. This was addressed in #372 to renormalise them to sum to one, but it is thought this might be too implicit and lead to unexpected behaviour.

Implications:

  • This should definitely be changed in the Python API
  • This should almost certainly be changed in C++ as well
  • There will be an implication for how the graphical interface behaves as a result.
  • set_actions should be part of 16.2, and the existing add_action and remove_action retained but deprecated, with removal in 16.3.

Other notes

As part of this issue, we should look and see whether a similar refactoring of operations would be appropriate anywhere else.

See also

@tturocy tturocy added python Items which involve coding in Python c++ Items which involve writing in C++ enhancement labels Oct 11, 2023
@tturocy tturocy added this to the gambit-16.2.0 milestone Oct 11, 2023
@tturocy tturocy modified the milestones: gambit-16.2.0, gambit-16.3.0 Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Items which involve writing in C++ enhancement python Items which involve coding in Python
Projects
None yet
Development

No branches or pull requests

1 participant