|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.princeton.repeatedgames.rgsolve.games.Game
public abstract class Game
An abstract class representing a repeated game
Field Summary | |
---|---|
private static double |
DEFAULT_DELTA
default discount rate |
private double |
delta
discount, initialized to DEFAULT_DELTA |
java.lang.String |
description
notes on or description of a game |
static java.lang.String |
extension
the file extension of the serialized game object |
private int |
m1
number of player 1 actions |
private int |
m2
number of player 2 actions |
private static long |
serialVersionUID
Serialization ID |
private BitSetFixed |
usableActions
actions profiles that are usable in equilibrium |
Constructor Summary | |
---|---|
Game(int m1,
int m2,
double delta)
super Constructor |
|
Game(int m1,
int m2,
double delta,
BitSetFixed usableActions)
super Constructor |
|
Game(int m1,
int m2,
double delta,
BitSetFixed usableActions,
java.lang.String description)
super Constructor |
|
Game(int m1,
int m2,
double delta,
java.lang.String description)
super Constructor |
Method Summary | |
---|---|
boolean |
actionUsable(int a1,
int a2)
whether the action profile (a1, a2) is usable |
BitSetFixed |
copyUsableActions()
|
double |
delta()
accessor for delta |
int |
m(int player)
The number of actions to player player ,
where 0 is player one and anything else is player 2 |
int |
m1()
accessor for m1 |
int |
m2()
accessor for m2 |
double |
payoff(int player,
int a1,
int a2)
payoff to player player , where
0 is player one and anything else is player 2 |
abstract double |
payoff1(int a1,
int a2)
payoff to player 1 |
abstract double |
payoff2(int a1,
int a2)
payoff to player 2 |
void |
setActionUsable(int a1,
int a2,
boolean isUsable)
Sets whether the action profile (a1,a2) is usable
in equilibrium |
protected void |
setDescription(java.lang.String description)
Sets the game descriptions string |
void |
setDiscount(double delta)
Initializes the discount rate delta |
private void |
setNumActions(int m1,
int m2)
Initializes the number of actions in this game |
private void |
setUsableActions(BitSetFixed usableActions)
sets the usable actions |
boolean |
usableActionsDefined()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private static final double DEFAULT_DELTA
public static final java.lang.String extension
public java.lang.String description
private double delta
DEFAULT_DELTA
private int m1
private int m2
private BitSetFixed usableActions
Constructor Detail |
---|
public Game(int m1, int m2, double delta, BitSetFixed usableActions, java.lang.String description)
m1
- number of player 1 actionsm2
- number of player 2 actionsdelta
- discount rateusableActions
- usable action profile vectordescription
- game notespublic Game(int m1, int m2, double delta)
m1
- number of player 1 actionsm2
- number of player 2 actionsdelta
- discount ratepublic Game(int m1, int m2, double delta, BitSetFixed usableActions)
m1
- number of player 1 actionsm2
- number of player 2 actionsdelta
- discount rateusableActions
- usable action profile vectorpublic Game(int m1, int m2, double delta, java.lang.String description)
m1
- number of player 1 actionsm2
- number of player 2 actionsdelta
- discount ratedescription
- game notesMethod Detail |
---|
protected void setDescription(java.lang.String description)
description
- private void setUsableActions(BitSetFixed usableActions)
usableActions
- public void setDiscount(double delta)
delta
delta
- private void setNumActions(int m1, int m2)
m1
- number of player 1 actionsm2
- number of player 2 actionspublic boolean actionUsable(int a1, int a2)
a1
- action for player 1a2
- action for player 2
public double payoff(int player, int a1, int a2)
player
, where
0 is player one and anything else is player 2
a1
- player 1 actiona2
- player 2 action
player
public abstract double payoff1(int a1, int a2)
a1
- player 1 actiona2
- player 2 action
public abstract double payoff2(int a1, int a2)
a1
- player 1 actiona2
- player 2 action
public int m(int player)
player
,
where 0 is player one and anything else is player 2
player
-
public int m1()
m1
public int m2()
m2
public double delta()
delta
public boolean usableActionsDefined()
usableActions
bit set is not nullpublic BitSetFixed copyUsableActions()
public void setActionUsable(int a1, int a2, boolean isUsable)
(a1,a2)
is usable
in equilibrium
a1
- player 1 actiona2
- player 2 actionisUsable
- whether it is usable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |