|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.princeton.repeatedgames.rgsolve.games.GameFactory
public class GameFactory
This class has methods building special predefined games. For most games, the user is prompted with a dialog to enter parameters.
Nested Class Summary | |
---|---|
private static class |
GameFactory.FIELD_TYPE
An enum for types of fields in games, REAL and INT |
Field Summary | |
---|---|
(package private) static GameFactory.FIELD_TYPE |
INT
Integer fields |
(package private) static GameFactory.FIELD_TYPE |
REAL
Real (double) fields |
Constructor Summary | |
---|---|
private |
GameFactory()
Private constructor |
Method Summary | |
---|---|
static Game |
getArmsRace(int m1,
int m2)
|
static BertrandImperfectSubs |
getBertrandImperfectSubs(int m1,
int m2)
An m1 x m2 Bertrand game with goods that are imperfect substitutes. |
static BertrandPerfectSubs |
getBertrandPerfectSubs(int m1,
int m2)
An m1 x m2 Bertrand game with perfect substitutes, where demand is Q = A - B * min{p1, p2}, and the entire market is captured by the lowest-price firm. |
static CournotGame |
getCournotGame(int m1,
int m2,
double delta)
Returns a Cournot game |
static Game |
getGrabTheDollar(int m1)
|
static RandomNormalGame |
getNormalGame(int m1,
int m2)
An m1 x m2 bivariate normal game. |
private static double[] |
getSpecialGameParameters(java.lang.String gameNotes,
java.lang.String[] fieldNames,
java.lang.String[] defaults,
GameFactory.FIELD_TYPE[] fieldTypes)
Helper method for constructing special game dialogs |
static Game |
getUniformGame(int m1,
int m2)
A game with payoffs drawn i.i.d. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static GameFactory.FIELD_TYPE REAL
static GameFactory.FIELD_TYPE INT
Constructor Detail |
---|
private GameFactory()
Method Detail |
---|
public static Game getUniformGame(int m1, int m2)
m1
- number actions to player 1m2
- number actions to player 2
public static CournotGame getCournotGame(int m1, int m2, double delta)
m1
- number actions to player 1m2
- number actions to player 2delta
- discount
public static BertrandPerfectSubs getBertrandPerfectSubs(int m1, int m2)
m1
- number actions to player 1m2
- number actions to player 2
public static RandomNormalGame getNormalGame(int m1, int m2)
m1
- number actions to player 1m2
- number actions to player 2
public static BertrandImperfectSubs getBertrandImperfectSubs(int m1, int m2)
m1
- number actions to player 1m2
- number actions to player 2
private static double[] getSpecialGameParameters(java.lang.String gameNotes, java.lang.String[] fieldNames, java.lang.String[] defaults, GameFactory.FIELD_TYPE[] fieldTypes)
gameNotes
- description of game and game fieldsfieldNames
- defaults
- fieldTypes
-
public static Game getGrabTheDollar(int m1)
public static Game getArmsRace(int m1, int m2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |