edu.stanford.multiagent.gamer
Class RandomCompoundGame

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

public class RandomCompoundGame
extends CompoundGame

Return a compound game based on a randomly generated symmetric 2x2 matrix.


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
RandomCompoundGame()
           
 
Method Summary
protected  void checkParameters()
          Checks if Parameter values are consistent.
 void doGenerate()
          Generate the symmetric 2x2 subgame and create a polymatrix game with this 2x2 matrix at all edges except the edges from nodes to themselves which will have stub 0 matrices.
protected  java.lang.String getGameHelp()
          Return help screen information about the given game class.
 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.
 void randomizeParameters()
          Sets values of any unset parameters randomly.
 
Methods inherited from class edu.stanford.multiagent.gamer.CompoundGame
generatePolymatrixGame, initGraph
 
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, 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
getBooleanParameter, getDoubleParameter, getLongParameter, getParamDescription, getParameter, getParameters, getStringParameter, setParameter, setParameter, setParameters, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomCompoundGame

public RandomCompoundGame()
                   throws java.lang.Exception
Method Detail

initialize

public void initialize()
                throws java.lang.Exception
Description copied from class: CompoundGame
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 CompoundGame
Throws:
java.lang.Exception - if, for example, there is a problem initializing the graph

checkParameters

protected void checkParameters()
                        throws java.lang.Exception
Description copied from class: ParameterizedObject
Checks if Parameter values are consistent. Must be implemented by every non-abstract subclass of ParameterizedObject.

Specified by:
checkParameters in class ParameterizedObject
Throws:
java.lang.Exception - if anything is wrong with the parameter values

randomizeParameters

public void randomizeParameters()
Description copied from class: ParameterizedObject
Sets values of any unset parameters randomly. Can and should be overridden in subclasses to handle a non-uniform distribution and for constraints on parameters.

Overrides:
randomizeParameters in class ParameterizedObject

getGameHelp

protected java.lang.String getGameHelp()
Description copied from class: Game
Return help screen information about the given game class.

Specified by:
getGameHelp in class Game

doGenerate

public void doGenerate()
Generate the symmetric 2x2 subgame and create a polymatrix game with this 2x2 matrix at all edges except the edges from nodes to themselves which will have stub 0 matrices.

Specified by:
doGenerate in class ParameterizedObject