pygambit.gambit.Game.get_outcome#
- Game.get_outcome(location) str | None#
Returns the label of the outcome attached at location.
For a tree game, location is a Selector (an H-built expression, evaluated against this game) that must resolve to exactly one node.
For a strategic (table) game, location is a pure-strategy contingency – a complete mapping from the game’s players’ labels to the label of the strategy played by that player.
Added in version 17.0.0.
- Parameters:
location (Selector or Mapping) – A Selector resolving to a single node (tree game), or a pure-strategy contingency (strategic game).
- Returns:
The label of the outcome attached at location, or None if it is the null outcome.
- Return type:
str or None
- Raises:
TypeError – If location is not a Selector (tree game); or is not a mapping, or a key or value is not a str (strategic game).
ValueError – For a tree game, if location does not resolve to exactly one node. For a strategic game, if location does not specify exactly one strategy for each player of the game, or a key is an empty or all-whitespace string.
KeyError – For a strategic game, if a player label, or a player’s strategy label, does not match any player, or that player’s strategies, in the game.
UndefinedOperationError – If the game is in neither a tree nor a strategic (table) representation.
