pygambit.gambit.Game.insert_event#

Game.insert_event(node: Selector, actions: Mapping) None#

Insert a chance move prior to the node identified by node, with actions and their probabilities given by actions. The node becomes the first child of the newly-inserted node.

node 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:
  • node (Selector) – A Selector resolving to the single node before which to insert 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 node is not a Selector.

  • UndefinedOperationError – If actions is empty.

  • ValueError – If node does not resolve to exactly one node; if actions contains an empty label; or if the probabilities are not non-negative numbers summing to exactly one.