edu.stanford.multiagent.gamer
Class NPlayerChicken

java.lang.Object
  |
  +--edu.stanford.multiagent.gamer.ParameterizedObject
        |
        +--edu.stanford.multiagent.gamer.Game
              |
              +--edu.stanford.multiagent.gamer.NPlayerChicken

public class NPlayerChicken
extends Game

Generate an instance of the N-Player Chicken game. Subclasses Game directly without an intermediate layer.


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
NPlayerChicken()
           
 
Method Summary
protected  void checkParameters()
          Make sure that the parameters are in the proper range
 void doGenerate()
          Generate the game.
protected  java.lang.String getGameHelp()
          Return help screen information about the given game class.
 java.util.Vector getPayoff(int[] outcome)
          Return a Vector with all players' utilities at the given outcome
 double getPayoff(int[] outcome, int player)
          Return the payoff for the given player in the given outcome.
 void initialize()
          Set the numbers of players and actions for the game, initilaize variables, and so on.
 void randomizeParameters()
          Randomize the parameters which were not filled in by the user.
 
Methods inherited from class edu.stanford.multiagent.gamer.Game
generate, getAutoNormPayoff, getDescription, getHelp, getName, getNormPayoff, getNumActions, getNumActions, getNumPlayers, getOutputPayoff, getOutputPayoff, getRangeHelp, parseActions, parsePlayersActions, parsePlayersSameNumberActions, parseSameNumberActions, setDescription, setName, setNormMinAndMax, setNumActions, setNumActions, setNumPlayers, writeGame
 
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

NPlayerChicken

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

initialize

public void initialize()
                throws java.lang.Exception
Set the numbers of players and actions for the game, initilaize variables, and so on.

Overrides:
initialize in class Game
Throws:
java.lang.Exception

checkParameters

protected void checkParameters()
                        throws java.lang.Exception
Make sure that the parameters are in the proper range

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

randomizeParameters

public void randomizeParameters()
Randomize the parameters which were not filled in by the user.

Overrides:
randomizeParameters in class ParameterizedObject

getPayoff

public double getPayoff(int[] outcome,
                        int player)
Return the payoff for the given player in the given outcome. Assumes everything has already been set up.

Specified by:
getPayoff in class Game
Parameters:
outcome - array of integers representing which actions have been chosen by each player
player - the player whose payoff to return

getPayoff

public java.util.Vector getPayoff(int[] outcome)
Return a Vector with all players' utilities at the given outcome

Overrides:
getPayoff in class Game
Parameters:
outcome - an array containing the action choices of all players at the given outcome

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 game.

Specified by:
doGenerate in class ParameterizedObject