edu.stanford.multiagent.gamer
Class PureCoordinationMatrix

java.lang.Object
  |
  +--edu.stanford.multiagent.gamer.ParameterizedObject
        |
        +--edu.stanford.multiagent.gamer.Game
              |
              +--edu.stanford.multiagent.gamer.PureCoordinationMatrix
Direct Known Subclasses:
CoordinationGame

public abstract class PureCoordinationMatrix
extends Game

Abstract class implements a normal form game which is common payoff and therefore only requires that the payoff for each outcome be stored once.


Field Summary
 
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
PureCoordinationMatrix()
          Constructor for a new pure coordination matrix game.
 
Method Summary
 double getPayoff(int[] outcome, int player)
          Returns the payoff for a player at a given outcome.
protected  void initMatrix()
          Initializes the payoff array assuming the numbers of players and actions have already been set.
protected  void setPayoff(int[] outcome, double value)
          Sets the payoff for all players for a given outcome.
 
Methods inherited from class edu.stanford.multiagent.gamer.Game
generate, getAutoNormPayoff, getDescription, getGameHelp, getHelp, getName, getNormPayoff, getNumActions, getNumActions, getNumPlayers, getOutputPayoff, getOutputPayoff, getPayoff, getRangeHelp, initialize, parseActions, parsePlayersActions, parsePlayersSameNumberActions, parseSameNumberActions, setDescription, setName, setNormMinAndMax, setNumActions, setNumActions, setNumPlayers, writeGame
 
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

PureCoordinationMatrix

public PureCoordinationMatrix()
                       throws java.lang.Exception
Constructor for a new pure coordination matrix game.

Method Detail

initMatrix

protected void initMatrix()
Initializes the payoff array assuming the numbers of players and actions have already been set.


getPayoff

public double getPayoff(int[] outcome,
                        int player)
Returns the payoff for a player at a given outcome.

Specified by:
getPayoff in class Game
Parameters:
outcome - an array holding the action choices for each player
player - the player whose payoff should be returned, irrelevant since the game is common payoff

setPayoff

protected void setPayoff(int[] outcome,
                         double value)
Sets the payoff for all players for a given outcome.

Parameters:
outcome - an array holding the action choices for each player
value - the amount of the payoff for this outcome