edu.stanford.multiagent.gamer
Class LocalEffectGame
java.lang.Object
|
+--edu.stanford.multiagent.gamer.ParameterizedObject
|
+--edu.stanford.multiagent.gamer.Game
|
+--edu.stanford.multiagent.gamer.LocalEffectGame
- Direct Known Subclasses:
- RandomLEG
- public abstract class LocalEffectGame
- extends Game
Abstract class which can be used to implement any Local-Effect
game. Can be extended in order generate bi-directional LEGs,
Uniform LEGs, etc.
Field Summary |
protected edu.stanford.multiagent.gamer.graphs.ALGraph |
graph
|
Method Summary |
double |
getPayoff(int[] outcome,
int player)
Calculates the payoff for a player as the negation of the
cost function for the action the player has chosen. |
void |
initialize()
Sets the number of players based on the command line parameter. |
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, 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 |
graph
protected edu.stanford.multiagent.gamer.graphs.ALGraph graph
LocalEffectGame
public LocalEffectGame()
throws java.lang.Exception
- Constructor for a LEG.
initialize
public void initialize()
throws java.lang.Exception
- Sets the number of players based on the command line parameter.
Separate initializers should be used for setting up the necessary
functions and graphs.
- Overrides:
initialize
in class Game
- Throws:
java.lang.Exception
getPayoff
public double getPayoff(int[] outcome,
int player)
- Calculates the payoff for a player as the negation of the
cost function for the action the player has chosen.
- Specified by:
getPayoff
in class Game
- Parameters:
outcome
- an array holding the action choices of each playerplayer
- the player whose payoff should be returned