pygambit.gambit.Game.make_outcome#

Game.make_outcome(location, payoffs: Mapping, label: str) None#

Create an outcome with payoffs and label and attach it at location.

For an extensive game, location 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, whose groups are pooled together, all receiving the same outcome). For a strategic game, location is a pure-strategy contingency — a complete mapping from the game’s players’ labels to strategy labels — or an iterable of such contingencies.

Any outcome all of whose references are among location is absorbed by the operation: it is removed from the game, and label may reuse its label.

Added in version 17.0.0.

Parameters:
  • location (Selector, GroupedSelector, contingency, or iterable of contingencies) – Where to attach the new outcome. Nonempty; each node or contingency may be referenced only once.

  • payoffs (Mapping) – A complete mapping from the game’s players (or their labels) to payoffs. Every player must be present; zeroes must be given explicitly.

  • label (str) – The label of the new outcome; must be nonempty and, after the operation, unique within the game.

Raises:
  • TypeError – If, for an extensive game, location is not a Selector or GroupedSelector.

  • ValueError – If location is empty or contains a repeat; if payoffs is not a complete mapping over exactly the game’s players; if a contingency does not specify exactly one strategy for each player; or if label is empty or is held by an outcome that is not absorbed by the operation.

  • UndefinedOperationError – If the game is in action-graph representation, where outcomes are not represented explicitly.

See also

get_outcome_payoffs

Get the payoffs at an outcome.

set_outcome_payoffs

Set the payoffs at an outcome.

relabel_outcomes

Change the labels of the game’s outcomes.