pygambit.gambit.Game.get_payoffs#

Game.get_payoffs(contingency: Mapping) PayoffVector#

Returns the payoff to each player at a pure-strategy contingency.

Works for any game representation. For extensive-form and action-graph games the payoffs are computed, not read from a stored outcome, and are always returned as Rational regardless of the game’s own numerical representation.

Added in version 17.0.0.

Parameters:

contingency (Mapping) – A complete mapping from the game’s players’ labels to the label of the strategy played by that player.

Returns:

The payoff to each player, keyed by player label.

Return type:

PayoffVector

Raises:
  • ValueError – If contingency does not specify exactly one strategy for each player of the game, or a key is an empty or all-whitespace string.

  • KeyError – If a player label, or a player’s strategy label, does not match any player, or that player’s strategies, in the game.

  • TypeError – If contingency is not a mapping, or a key or value is not a str.