pygambit.gambit.Game.append_move#
- Game.append_move(nodes: Selector | GroupedSelector, player: str, actions: list[str]) None#
Add a move for player at terminal nodes. All elements of nodes become part of a new information set, with actions labeled according to actions.
player must be a personal player; use append_event to add a chance move.
nodes is a Selector (an H-built expression, evaluated against this game and treated as a flat set of nodes) or a GroupedSelector (an H-built .by(…) expression) – in the latter case, one new information set is created per distinct group, rather than one spanning every match.
Changed in version 17.0.0: nodes is now a Selector or GroupedSelector; a Node or NodeReferenceSet is no longer accepted directly – build one with H.
- Raises:
TypeError – If nodes is not a Selector or GroupedSelector.
UndefinedOperationError – If nodes are not all terminal, or actions is empty.
KeyError – If no player in the game has label player.
ValueError – If nodes has duplicated elements, or is empty; or if actions contains an empty or a duplicated label.
