edu.stanford.multiagent.gamer
Class TimingGame
java.lang.Object
|
+--edu.stanford.multiagent.gamer.ParameterizedObject
|
+--edu.stanford.multiagent.gamer.Game
|
+--edu.stanford.multiagent.gamer.TimingGame
- Direct Known Subclasses:
- GrabTheDollar, MinimumEffortGame, TravelersDilemma, WarOfAttrition
- public abstract class TimingGame
- extends Game
Abstract class implements common features among timing games.
For the extents and purposes of this class, "timing
game" can refer to any game in which the payoff is
computed using a function of the "earliest" (lowest
numbered) action chosen, your own action, and whether
your action came first, tied for first, or came later.
Nested Class Summary |
static class |
TimingGame.TimingGameParams
TimingGameParams is a simple helper class used to store
all of the parameters for the Timing Game function for
one particular player. |
Constructor Summary |
TimingGame()
Constructor for a new timing game. |
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 |
TimingGame
public TimingGame()
throws java.lang.Exception
- Constructor for a new timing game.
setParamsWithTie
public void setParamsWithTie(TimingGame.TimingGameParams[] lowParams,
TimingGame.TimingGameParams[] tiedParams,
TimingGame.TimingGameParams[] notLowParams)
- Sets the parameters for the payoff functions for the case
when the player has the lowest time, the case when the player
is tied, and the case when the player does not have the lowest
time. If ties are not allowed, use setParamsNoTies instead.
- Parameters:
lowParams
- parameter settings for calculating payoff in
the case when a player is the only one with the lowest timetiedParams
- parameter settings for calculating payoff in
the case when a player is tied for the lowest time
setParamsNoTies
public void setParamsNoTies(TimingGame.TimingGameParams[] lowParams,
TimingGame.TimingGameParams[] notLowParams)
- Set the parameters for the payoff functions for the case
when the player has the lowest time and for when the player
does not. Use this function if ties are not allowed.
- Parameters:
lowParams
- parameter settings for calculating payoff in
the case when a player is the only one with the lowest time
getPayoff
public double getPayoff(int[] outcome,
int player)
- Returns the payoff for the given player in the given
outcome using the common timing game parameterized
function. Assumes all parameters have already been
properly set up.
- Specified by:
getPayoff
in class Game
- Parameters:
outcome
- an array holding the actions of each playerplayer
- the player whose payoff should be returned