|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.stanford.multiagent.gamer.ParameterizedObject | +--edu.stanford.multiagent.gamer.Game | +--edu.stanford.multiagent.gamer.DispersionGame
Class implements a specific kind of dispersion game: both action symmetric and agent symmetric as defined in the dispersion games literature, also strong, and common payoff. It is not required that the number of players be equal to the number of actions. The dispersion ordering used is a full ordering where one outcome is more dispersed than another if the entropy is higher. (Other implementations could have been used, such as keeping the partial ordering or using standard deviation, but the entropy-based ordering is easy to implement and equally valid.)
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 | |
DispersionGame()
|
Method Summary | |
protected void |
checkParameters()
Checks if Parameter values are consistent. |
void |
doGenerate()
Generate all groupings of outcomes that will have the same entropy with the given number of players and number of actions. |
protected java.lang.String |
getGameHelp()
Return help screen information about the given game class. |
java.util.Vector |
getPayoff(int[] outcome)
Since the game is common payoff, it is much more efficient to get all payoffs at once. |
double |
getPayoff(int[] outcome,
int player)
The payoff will be the same for each player, based on how dispersed the actions are as a whole. |
void |
initialize()
Initialize the dispersion game by setting the number of players and the number of actions and creating the hashmap for storing entropy/payoff pairs. |
void |
randomizeParameters()
Sets values of any unset parameters randomly. |
void |
setParameters(edu.stanford.multiagent.gamer.ParamParser p,
boolean randomize)
Sets multiple parameters at once using a ParamParser. |
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DispersionGame() throws java.lang.Exception
Method Detail |
public void setParameters(edu.stanford.multiagent.gamer.ParamParser p, boolean randomize) throws java.lang.Exception
ParameterizedObject
setParameters
in class ParameterizedObject
p
- the ParamParser containing the parameters and
their valuesrandomize
- should be set to true if it is desired
that any unset parameters be randomized
java.lang.Exception
public void initialize() throws java.lang.Exception
initialize
in class Game
java.lang.Exception
public double getPayoff(int[] outcome, int player)
getPayoff
in class Game
outcome
- array of integers representing which actions
have been chosen by each playerplayer
- the player whose payoff to returnpublic java.util.Vector getPayoff(int[] outcome)
getPayoff
in class Game
outcome
- an array containing the action choices of
all players at the given outcomeprotected void checkParameters() throws java.lang.Exception
ParameterizedObject
checkParameters
in class ParameterizedObject
java.lang.Exception
- if anything is wrong with the parameter
valuespublic void randomizeParameters()
ParameterizedObject
randomizeParameters
in class ParameterizedObject
protected java.lang.String getGameHelp()
Game
getGameHelp
in class Game
public void doGenerate()
doGenerate
in class ParameterizedObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |