-
Notifications
You must be signed in to change notification settings - Fork 254
ENH: Consolidate add_action/delete_action into single operation #378
Description
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_actionsshould be part of 16.2, and the existingadd_actionandremove_actionretained 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.