pygambit.gambit.Game.set_move_actions#
- Game.set_move_actions(infoset: Selector, actions: list[str], drop: bool = False, add: bool = True) None#
Set the actions at the move that the node identified by infoset belongs to, to be actions, matching by label.
An entry of actions matching the label of a current action refers to that action, which keeps its subtrees; an entry matching no current action creates a new action there, leading to a new terminal node at every member; a current action whose label is not in actions is deleted, along with the subtrees its branches lead to. Listing the current labels in a new order reorders the actions as well as the children.
infoset is a Selector (an H-built expression, evaluated against this game) that must resolve to exactly one node.
Added in version 17.0.0.
- Parameters:
infoset (Selector) – A Selector resolving to a single node belonging to the (personal player’s) move at which to set the actions.
actions (list of str) – The labels of the actions the move is to have, in order. Must be nonempty and without duplicates; each label must be a valid, nonempty label.
drop (bool, default False) – Deleting actions is destructive, so it must be explicitly confirmed: if any current action is missing from actions and drop is False, the operation raises without modifying the game.
add (bool, default True) – If False, entries of actions matching no current action raise.
- Raises:
TypeError – If infoset is not a Selector; or if actions is a string, or not an iterable of strings.
UndefinedOperationError – If actions is empty.
ValueError – If infoset does not resolve to exactly one node, or resolves to an event rather than a personal player’s move (use set_event_actions for an event); or if a label in actions is repeated, empty, or invalid; or if adding or deleting actions is not confirmed by add/drop.
See also
set_event_actionsThe corresponding operation for the actions of an event.
relabel_actionsChange the labels of actions, leaving the tree unchanged.
