pygambit.gambit.ExtensiveGame.make_outcome#
- ExtensiveGame.make_outcome(location: Selector | GroupedSelector, payoffs: Mapping, label: str) None#
Create an outcome with payoffs and label and attach it at location.
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).
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 or GroupedSelector) – Where to attach the new outcome. Nonempty; each node 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 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; or if label is empty or is held by an outcome that is not absorbed by the operation.
See also
get_outcome_payoffsGet the payoffs at an outcome.
set_outcome_payoffsSet the payoffs at an outcome.
relabel_outcomesChange the labels of the game’s outcomes.
