edu.stanford.multiagent.gamer
Class CompoundGame

java.lang.Object
  |
  +--edu.stanford.multiagent.gamer.ParameterizedObject
        |
        +--edu.stanford.multiagent.gamer.Game
              |
              +--edu.stanford.multiagent.gamer.GraphicalGame
                    |
                    +--edu.stanford.multiagent.gamer.CompoundGame
Direct Known Subclasses:
RandomCompoundGame

public abstract class CompoundGame
extends GraphicalGame

Class implements any compound game. Can be extended to generate N-player version of any symmetric 2x2 game.


Field Summary
 
Fields inherited from class edu.stanford.multiagent.gamer.GraphicalGame
graph
 
Fields inherited from class edu.stanford.multiagent.gamer.Game
actions, DEFAULT_HIGH, DEFAULT_LOW, intMult, intPayoffs, players, pMaxPayoff, pMinPayoff, pNormalize, symActions
 
Fields inherited from class edu.stanford.multiagent.gamer.ParameterizedObject
parameters
 
Constructor Summary
CompoundGame()
          Construct a new Compound game.
 
Method Summary
protected  void generatePolymatrixGame(double R, double S, double T, double P)
          Sets up the compound game as a graphical game (polymatrix, really) with each submatrix being in the form R, R S, T T, S P, P for whatever values of R, S, T, and P are passed in.
protected  void initGraph()
          Initializes a complete graph with the number of nodes equal to the number of players in the game.
 void initialize()
          Sets the number of players from the command line parameter, sets the number of actions to 2 for each player, and initializes the graph.
 
Methods inherited from class edu.stanford.multiagent.gamer.GraphicalGame
addEdge, addEdge, getPayoff, setNodeMatrix, writeGame
 
Methods inherited from class edu.stanford.multiagent.gamer.Game
generate, getAutoNormPayoff, getDescription, getGameHelp, getHelp, getName, getNormPayoff, getNumActions, getNumActions, getNumPlayers, getOutputPayoff, getOutputPayoff, getPayoff, getRangeHelp, parseActions, parsePlayersActions, parsePlayersSameNumberActions, parseSameNumberActions, setDescription, setName, setNormMinAndMax, setNumActions, setNumActions, setNumPlayers
 
Methods inherited from class edu.stanford.multiagent.gamer.ParameterizedObject
checkParameters, doGenerate, getBooleanParameter, getDoubleParameter, getLongParameter, getParamDescription, getParameter, getParameters, getStringParameter, randomizeParameters, setParameter, setParameter, setParameters, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundGame

public CompoundGame()
             throws java.lang.Exception
Construct a new Compound game.

Method Detail

initialize

public void initialize()
                throws java.lang.Exception
Sets the number of players from the command line parameter, sets the number of actions to 2 for each player, and initializes the graph. All child classes should call this function for initialization.

Overrides:
initialize in class Game
Throws:
java.lang.Exception - if, for example, there is a problem initializing the graph

initGraph

protected void initGraph()
Initializes a complete graph with the number of nodes equal to the number of players in the game.

Specified by:
initGraph in class GraphicalGame

generatePolymatrixGame

protected void generatePolymatrixGame(double R,
                                      double S,
                                      double T,
                                      double P)
Sets up the compound game as a graphical game (polymatrix, really) with each submatrix being in the form R, R S, T T, S P, P for whatever values of R, S, T, and P are passed in.

Parameters:
R -
S -
T -
P -