pygambit.gambit.Game.insert_move#
- Game.insert_move(node: Selector, player: str, actions: list[str]) None#
Insert a move for player prior to the node identified by node, with actions labeled according to actions. The node becomes the first child of the newly-inserted node.
player must be a personal player; use insert_event to insert a chance move.
node is a Selector (an H-built expression, evaluated against this game) that must resolve to exactly one node.
Changed in version 17.0.0: node is now a Selector; a Node or str is no longer accepted directly – build one with H.
- Raises:
TypeError – If node is not a Selector.
UndefinedOperationError – If actions is empty.
KeyError – If no player in the game has label player.
ValueError – If node does not resolve to exactly one node, or actions contains an empty or a duplicated label.
