API documentation#
Representation of games#
A game, the fundamental unit of analysis in game theory. |
|
A player in a |
|
An outcome in a |
|
A node in a |
|
An information set in a |
|
A choice available at an |
|
A plan of action for a |
Creating, reading, and writing games#
|
Construct a game from its serialised representation in a GBT file. |
|
Construct a game from its serialised representation in an EFG file. |
|
Construct a game from its serialised representation in a NFG file. |
|
Construct a game from its serialised representation in an AGG file. |
|
Create a new |
|
Create a new |
|
Create a new |
|
Generate the payoff tables for players represented as numpy arrays. |
|
Create a new |
|
Construct a game from its serialised representation in a file. |
|
Construct a game from its serialised representation in a string |
|
Produce a serialization of the game. |
|
Save the game to an .efg file or return its serialized representation |
|
Save the game to a .nfg file or return its serialized representation |
|
Export the game to an .html file or return its serialized representation |
|
Export the game to a .tex file or return its serialized representation |
Transforming game trees#
|
Add a move for player at terminal nodes. |
|
Add a move in information set infoset at terminal nodes. |
|
Insert a move for player prior to the node node, with actions actions. |
|
Insert a move in information set infoset prior to the node node. |
|
Copy the subtree rooted at 'src' to 'dest'. |
|
Move the subtree rooted at 'src' to 'dest'. |
|
Delete the parent node of node. |
|
Truncate the game tree at node, deleting the subtree beneath it. |
Transforming game information structure#
|
Set the player at an information set. |
|
Place node in the information set infoset. |
|
Remove this node from its information set. |
|
Reveals the move made at infoset to player. |
|
Set the action probabilities at chance information set infoset. |
Transforming game components#
|
Add a new player to the game. |
|
Add a new outcome to the game. |
|
Delete an outcome from the game. |
|
Set outcome to be the outcome at node. |
|
Add a new strategy to the set of strategies for player. |
|
Delete strategy from the game. |
Information about the game#
Get or set the title of the game. |
|
Get or set the comment of the game. |
|
Whether the game is constant sum. |
|
Return whether a game has a tree-based representation. |
|
Whether the game is perfect recall. |
|
The set of players in the game. |
|
The set of outcomes in the game. |
|
The minimum payoff in the game. |
|
The maximum payoff in the game. |
|
The set of strategies in the game. |
|
The root node of the game. |
|
The set of actions available in the game. |
|
The set of information sets in the game. |
|
|
Return a list of nodes in the game tree. |
An iterator over the contingencies in the game. |
Gets or sets the text label of the player. |
|
Returns the number of the player in its game. |
|
Gets the |
|
Returns the set of strategies belonging to the player. |
|
Returns the set of information sets at which the player has the decision. |
|
Returns the set of actions available to the player at some information set. |
|
Returns whether the player is the chance player. |
|
Returns the smallest payoff for the player in any outcome of the game. |
|
Returns the largest payoff for the player in any outcome of the game. |
|
Returns the set of strategies belonging to the player. |
The text label associated with this outcome. |
|
Returns the game with which this outcome is associated. |
The text label associated with the node. |
|
Gets the |
|
Returns the outcome attached to the node. |
|
The set of children of this node. |
|
The parent of this node. |
|
Returns whether the node is the root of a proper subgame. |
|
Returns whether this is a terminal node of the game. |
|
The action which leads to this node. |
|
The node which is immediately before this one in its parent's children. |
|
The node which is immediately after this one in its parent's children. |
|
The information set to which this node belongs. |
|
The player who makes the decision at this node. |
|
|
Returns whether this node is a successor of node. |
Get or set the text label of the information set. |
|
The |
|
Whether the information set belongs to the chance player. |
|
The player who has the move at this information set. |
|
The set of actions at the information set. |
|
The set of nodes which are members of the information set. |
|
|
Return whether this information set precedes node in the game tree. |
Get or set the text label of the action. |
|
Get the information set to which the action belongs. |
|
|
Returns whether node precedes this action in the extensive game. |
Get the probability a chance action is played. |
Get or set the text label associated with the strategy. |
|
The game to which the strategy belongs. |
|
The player to which the strategy belongs. |
|
The number of the strategy. |
Player behavior#
|
Create a mixed strategy profile over the game. |
|
Create a MixedStrategy on the game, with probabilities drawn from the uniform distribution over the set of mixed strategy profiles. |
|
Create a mixed behavior profile over the game. |
|
Create a MixedBehaviorProfile on the game, with probabilities drawn from the uniform distribution over the set of mixed behavior profiles. |
|
Create a new StrategySupportProfile on the game. |
Representation of strategic behavior#
Probability distributions over strategies#
Represents a mixed strategy profile over the strategies in a |
|
The game on which this mixed strategy profile is defined. |
|
Iterate over the mixed strategies in the profile. |
|
Iterate over the probabilities assigned to strategies by the profile. |
|
Access a component of the mixed strategy profile specified by index. |
|
Sets a probability or a mixed strategy to value. |
|
|
Returns the expected payoff to a player if all players play according to the profile. |
|
Returns the expected payoff to playing the strategy, if all other players play according to the profile. |
|
Returns the regret to playing strategy, if all other players play according to the profile. |
Returns the regret of player for playing their mixed strategy, if all other players play according to the profile. |
|
Returns the maximum regret of any player. |
|
Returns the derivative of the payoff to playing strategy, with respect to the probability that other is played. |
|
Returns the Lyapunov value (see [McK91]) of the strategy profile. |
|
Creates a mixed behavior profile which is equivalent to this mixed strategy profile. |
|
Create a profile with the same strategy proportions as this one, but normalised so probabilities for each player sum to one. |
|
Creates a copy of the mixed strategy profile. |
|
A probability distribution over a player's strategies. |
|
Iterate over the probabilities assigned to strategies by the mixed strategy. |
|
Returns the probability that the strategy referred to by index is played. |
|
Sets the probability a strategy is played. |
Probability distributions over behavior#
Represents a mixed behavior profile over the actions in a |
|
The game on which this mixed behavior profile is defined. |
|
Iterate over the mixed behaviors in the profile. |
|
Iterate over the mixed actions specified by the profile. |
|
Iterate over the probabilities assigned to actions by the profile. |
|
Access a component of the mixed behavior specified by index. |
|
Sets a probability, mixed agent strategy, or mixed behavior strategy to value. |
|
|
Returns the expected payoff to a player if all players play according to the profile. |
Returns the regret to playing action, if all other players play according to the profile. |
|
Returns the expected payoff to the player of playing an action conditional on reaching its information set, if all players play according to the profile. |
|
|
Returns the expected payoff to the player conditional on reaching an information set, if all players play according to the profile. |
|
Returns the expected payoff to player conditional on play reaching node, if all players play according to the profile. |
Returns the probability with which a node is reached. |
|
|
Returns the probability with which an information set is reached. |
Returns the conditional probability that a node is reached, given that its information set is reached. |
|
|
Returns whether the profile has probabilities defined at the information set. |
Returns the Lyapunov value (see [McK91]) of the strategy profile. |
|
Returns a MixedStrategyProfile which is equivalent to the profile. |
|
Create a profile with the same action proportions as this one, but normalised so probabilities for each infoset sum to one. |
|
Creates a copy of the behavior strategy profile. |
|
A set of probability distributions describing a player's behavior. |
|
Iterate over the mixed actions specified by the mixed behavior. |
|
Iterate over the probabilities assigned to actions by the mixed behavior. |
|
Access a component of the mixed behavior specified by index. |
|
Sets a component of the mixed behavior to value. |
|
A probability distribution over a player's actions at an information set. |
|
Iterate over the probabilities assigned to actions by the mixed action. |
|
Returns the probability that the action referred to by index is played. |
|
Sets the probability an action is played. |
Computation on supports#
|
Return a support profile including only the strategies in profile which are not dominated by another pure strategy. |
Computation of Nash equilibria#
|
Represents the result of a method which computes Nash equilibria in a game. |
|
Compute all pure-strategy Nash equilibria of game. |
|
Compute all mixed-strategy Nash equilibria of a two-player game using the strategic representation. |
|
Compute Nash equilibria by enumerating all support profiles of strategies or actions, and for each support finding all totally-mixed equilibria of the game over that support. |
|
Compute Nash equilibria of a two-player constant-sum game using linear programming. |
|
Compute Nash equilibria of a two-player game using linear complementarity programming. |
|
Compute approximate Nash equilibria of a game using Lyapunov function minimization. |
|
Compute Nash equilibria of a game using the logit quantal response equilibrium correspondence. |
|
Compute Nash equilibria of a game using simplicial subdivision. |
|
Compute Nash equilibria of a game using iterated polymatrix approximation. |
|
Compute Nash equilibria of a game using a global Newton method. |
Computation of quantal response equilibria#
|
|
|
|
|
Use maximum likelihood estimation to find the logit quantal response equilibrium which best fits empirical frequencies of play. |
|
The result of fitting a QRE to a given probability distribution over strategies. |
|
The result of fitting a QRE to a given probability distribution over actions. |