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.specialgames
Class CournotGame

    java.lang.Object
      edu.princeton.repeatedgames.rgsolve.games.Game
          edu.princeton.repeatedgames.rgsolve.games.specialgames.CournotGame

All Implemented Interfaces:
  java.io.Serializable

    public class CournotGame

extends Game
implements java.io.Serializable

A Cournot Game, where P(Q) = Max{ A - B * Q, 0 } Minimum output is zero, maximum output for player i in {1,2} is the maximum between `A/B` and `*PROF* / ci`, where *PROF* is the monopolist profit.

See Also:
  Serialized Form

Field Summary
`(package private) double` | `A` Price at Q = 0
`(package private) double` | `B` Negative slope of inverse demand curve
`(package private) double` | `c1` Constant marginal cost of player 1
`(package private) double` | `c2` Constant marginal cost of player 2
`(package private) double` | `maxOutput1` Maximum output for player 1
`(package private) double` | `maxOutput2` Maximum output for player 2
`private static long` | `serialVersionUID` Serialization ID

Fields inherited from class edu.princeton.repeatedgames.rgsolve.games.Game
`description, extension`

Constructor Summary
`CournotGame(int m1, int m2, double delta, double A, double B, double c1, double c2)` Instantiates a Cournot Game

Method Summary
`double` | `getA()` Returns the value of the field called 'a'.
`double` | `getB()` Returns the value of the field called 'b'.
`double` | `getC1()` Returns the value of the field called 'c1'.
`double` | `getC2()` Returns the value of the field called 'c2'.
`double` | `getMaxOutput1()` Returns the value of the field called 'maxOutput1'.
`double` | `getMaxOutput2()` Returns the value of the field called 'maxOutput2'.
`double` | `payoff1(int a1, int a2)` payoff to player 1
`double` | `payoff2(int a1, int a2)` payoff to player 2
`private void` | `setA(double a)` Sets the field called 'a' to the given value.
`private void` | `setB(double b)` Sets the field called 'b' to the given value.
`private void` | `setC1(double c1)` Sets the field called 'c1' to the given value.
`private void` | `setC2(double c2)` Sets the field called 'c2' to the given value.

Methods inherited from class edu.princeton.repeatedgames.rgsolve.games.Game
`actionUsable, copyUsableActions, delta, m, m1, m2, payoff, 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

### A

    double A

  Price at Q = 0

### B

    double B

  Negative slope of inverse demand curve

### c1

    double c1

  Constant marginal cost of player 1

### c2

    double c2

  Constant marginal cost of player 2

### maxOutput1

    double maxOutput1

  Maximum output for player 1

### maxOutput2

    double maxOutput2

  Maximum output for player 2

Constructor Detail

### CournotGame

    public CournotGame(int m1,
                       int m2,
                       double delta,
                       double A,
                       double B,
                       double c1,
                       double c2)

  Instantiates a Cournot Game

  Parameters:
    `m1` - number of actions to player 1
    `m2` - number of actions to player 2
    `delta` -
    `A` -
    `B` -
    `c1` -
    `c2` -

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

### getA

    public double getA()

  Returns the value of the field called 'a'.

  Returns:
    Returns the a.

### setA

    private void setA(double a)

  Sets the field called 'a' to the given value.

  Parameters:
    `a` - The a to set.

### getB

    public double getB()

  Returns the value of the field called 'b'.

  Returns:
    Returns the b.

### setB

    private void setB(double b)

  Sets the field called 'b' to the given value.

  Parameters:
    `b` - The b to set.

### getC1

    public double getC1()

  Returns the value of the field called 'c1'.

  Returns:
    Returns the c1.

### setC1

    private void setC1(double c1)

  Sets the field called 'c1' to the given value.

  Parameters:
    `c1` - The c1 to set.

### getC2

    public double getC2()

  Returns the value of the field called 'c2'.

  Returns:
    Returns the c2.

### setC2

    private void setC2(double c2)

  Sets the field called 'c2' to the given value.

  Parameters:
    `c2` - The c2 to set.

### getMaxOutput1

    public double getMaxOutput1()

  Returns the value of the field called 'maxOutput1'.

  Returns:
    Returns the maxOutput1.

### getMaxOutput2

    public double getMaxOutput2()

  Returns the value of the field called 'maxOutput2'.

  Returns:
    Returns the maxOutput2.

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