pygambit.gambit.Game#
- class pygambit.gambit.Game#
A game, the fundamental unit of analysis in game theory.
Games may be represented in extensive or strategic form.
Methods
get_max_payoff(player)Returns the largest payoff for player in any play of the game.
get_min_payoff(player)Returns the smallest payoff for player in any play of the game.
get_outcome_payoffs(label)Returns the payoff to each player at the outcome labeled label.
Returns the labels of the outcomes in the game.
get_payoffs(contingency)Returns the payoff to each player at a pure-strategy contingency.
get_strategies(player)Returns a snapshot of the labels of the strategies belonging to player.
has_perfect_recall(player)Returns whether player has perfect recall.
mixed_strategy_profile([data, rational])Create a mixed strategy profile over the game.
random_strategy_profile([denom, gen])Create a MixedStrategy on the game, with probabilities drawn from the uniform distribution over the set of mixed strategy profiles.
relabel_players(labels[, strict])Simultaneously reassign the labels of the game's players.
set_outcome_payoffs(label, payoffs)Sets the payoff to each player at the outcome labeled label.
strategy_support_profile([strategies])Create a new StrategySupportProfile on the game.
to_arrays(dtype)Generate the payoff tables for players represented as numpy arrays.
to_efg([filepath_or_buffer])Save the game to an .efg file or return its serialized representation
to_html([filepath_or_buffer])Export the game to HTML format.
to_latex([filepath_or_buffer])Export the game to LaTeX format.
to_nfg([filepath_or_buffer])Save the game to a .nfg file or return its serialized representation
Attributes
An iterator over the contingencies in the game.
Get or set the description of the game.
Whether the game is constant sum.
Whether the game is perfect recall.
The maximum payoff to any player in any play of the game.
The minimum payoff to any player in any play of the game.
The set of players in the game.
Get or set the title of the game.
