pygambit.gambit.Game.append_event#
- Game.append_event(nodes: Selector | GroupedSelector, actions: Mapping) None#
Add a chance move at terminal nodes, with actions and their probabilities given by actions. All elements of nodes become part of a new event.
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 event is created per distinct group, rather than one spanning every match.
Added in version 17.0.0.
- Parameters:
nodes (Selector or GroupedSelector) – The nonempty set of terminal nodes at which to add the move.
actions (Mapping) – A mapping from each new action’s label to its probability. Nonempty, with no empty label. Probabilities are non-negative and sum to exactly one.
- Raises:
TypeError – If nodes is not a Selector or GroupedSelector.
UndefinedOperationError – If nodes are not all terminal, or actions is empty.
ValueError – If nodes has duplicated elements, or is empty; if actions contains an empty label; or if the probabilities are not non-negative numbers summing to exactly one.
