edu.princeton.repeatedgames.rgsolve.games
Class BimatrixGame

java.lang.Object
  extended by edu.princeton.repeatedgames.rgsolve.games.Game
      extended by edu.princeton.repeatedgames.rgsolve.games.BimatrixGame
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AbreuSannikovExample1, AbreuSannikovExample2, BattleOfTheSexes, HawkDove, PrisonersDilemma, RandomNormalGame

public class BimatrixGame
extends Game
implements java.io.Serializable

This class extends Game and stores a repeated game where the stage game payoffs are stored as 2D arrays

See Also:
Serialized Form

Field Summary
private  double[][] G1
          payoff matrix to player 1
private  double[][] G2
          payoff matrix to player 2
private static long serialVersionUID
          Serialization ID
 
Fields inherited from class edu.princeton.repeatedgames.rgsolve.games.Game
description, extension
 
Constructor Summary
BimatrixGame(double[][] G1, double[][] G2, double delta)
          constructor
BimatrixGame(double[][] G1, double[][] G2, double delta, BitSetFixed usableActions, java.lang.String description)
          constructor
BimatrixGame(int m1, int m2, double delta)
          constructor for an empty game
 
Method Summary
 double payoff1(int a1, int a2)
          payoff to player 1
 double payoff2(int a1, int a2)
          payoff to player 2
 void setPayoff(int a1, int a2, double g1, double g2)
          Sets the payoff at action (a1,a2) to to payoffs (g1,g2)
 
Methods inherited from class edu.princeton.repeatedgames.rgsolve.games.Game
actionUsable, copyUsableActions, delta, m, m1, m2, payoff, setActionUsable, setDescription, setDiscount, usableActionsDefined
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serialization ID

See Also:
Constant Field Values

G1

private double[][] G1
payoff matrix to player 1


G2

private double[][] G2
payoff matrix to player 2

Constructor Detail

BimatrixGame

public BimatrixGame(int m1,
                    int m2,
                    double delta)
constructor for an empty game

Parameters:
m1 - number of actions to 1
m2 - number of actions to 2
delta - discount rate

BimatrixGame

public BimatrixGame(double[][] G1,
                    double[][] G2,
                    double delta)
constructor

Parameters:
G1 - payoff matrix for 1
G2 - payoff matrix for 2
delta - discount rate

BimatrixGame

public BimatrixGame(double[][] G1,
                    double[][] G2,
                    double delta,
                    BitSetFixed usableActions,
                    java.lang.String description)
constructor

Parameters:
G1 - payoff matrix for 1
G2 - payoff matrix for 2
delta - discount rate
usableActions - actions that are usable in equilibrium
description - game notes
Method Detail

payoff1

public double payoff1(int a1,
                      int a2)
Description copied from class: Game
payoff to player 1

Specified by:
payoff1 in class Game
Parameters:
a1 - player 1 action
a2 - player 2 action
Returns:
the payoff to player 1

payoff2

public double payoff2(int a1,
                      int a2)
Description copied from class: Game
payoff to player 2

Specified by:
payoff2 in class Game
Parameters:
a1 - player 1 action
a2 - player 2 action
Returns:
the payoff to player 2

setPayoff

public void setPayoff(int a1,
                      int a2,
                      double g1,
                      double g2)
Sets the payoff at action (a1,a2) to to payoffs (g1,g2)

Parameters:
a1 - action for player 1
a2 - action for player 2
g1 - payoff to 1
g2 - payoff to 2