pygambit.gambit.Game.add_outcome#

Game.add_outcome(label: str, payoffs: list | None = None) Outcome#

Add a new outcome to the game.

Changed in version 16.7.0: A label is now required and must be nonempty and unique among the game’s outcomes.

Parameters:
  • label (str) – The label for the outcome. Must be nonempty and not already in use by another outcome in the game.

  • payoffs (list, optional) – The payoffs of the outcome to each player.

Raises:

ValueError – If payoffs is specified but is not the same length as the number of players in the game, or if label is empty or already in use by another outcome.

Returns:

A reference to the newly-created outcome.

Return type:

Outcome