Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.princeton.repeatedgames.rgsolve.games
Class GameFactory

    java.lang.Object
      edu.princeton.repeatedgames.rgsolve.games.GameFactory

    public class GameFactory

extends java.lang.Object

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

### REAL

    static GameFactory.FIELD_TYPE REAL

  Real (double) fields

### INT

    static GameFactory.FIELD_TYPE INT

  Integer fields

Constructor Detail

### GameFactory

    private GameFactory()

  Private constructor

Method Detail

### getUniformGame

    public static Game getUniformGame(int m1,
                                      int m2)

  A game with payoffs drawn i.i.d. from U[0,1]

  Parameters:
    `m1` - number actions to player 1
    `m2` - number actions to player 2
  Returns:
    the random uniform game

### getCournotGame

    public static CournotGame getCournotGame(int m1,
                                             int m2,
                                             double delta)

  Returns a Cournot game

  Parameters:
    `m1` - number actions to player 1
    `m2` - number actions to player 2
    `delta` - discount
  Returns:
    a Cournot game

### getBertrandPerfectSubs

    public 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. Marginal costs are c1 and c2.

  Parameters:
    `m1` - number actions to player 1
    `m2` - number actions to player 2
  Returns:
    the Bertrand game

### getNormalGame

    public static RandomNormalGame getNormalGame(int m1,
                                                 int m2)

  An m1 x m2 bivariate normal game.

  Parameters:
    `m1` - number actions to player 1
    `m2` - number actions to player 2
  Returns:
    the bivariate normal Game

### getBertrandImperfectSubs

    public static BertrandImperfectSubs getBertrandImperfectSubs(int m1,
                                                                 int m2)

  An m1 x m2 Bertrand game with goods that are imperfect substitutes. Firm i has demand q_i = max(a - b*p_i + (a + p_j)/b, 0). Marginal costs are c1, c2."

  Parameters:
    `m1` - number actions to player 1
    `m2` - number actions to player 2
  Returns:
    the Bertrand Game

### getSpecialGameParameters

    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

  Parameters:
    `gameNotes` - description of game and game fields
    `fieldNames` -
    `defaults` -
    `fieldTypes` -
  Returns:
    User-inputted values for game fields

### getGrabTheDollar

    public static Game getGrabTheDollar(int m1)

### getArmsRace

    public static Game getArmsRace(int m1,
                                   int m2)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD