|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectipdlx.Game
ipdlx.StandardGame
public class StandardGame
Standard 2 player game
| Field Summary | |
|---|---|
protected Player |
playerA
first player |
protected Player |
playerB
second player |
| Fields inherited from class ipdlx.Game |
|---|
broadcastResult, broadcastRoundResults, gameListeners, gameMatrix, gameResult, moveTimeLimit, players, probabilityOfMistake, stDev |
| Fields inherited from interface ipdlx.PDValues |
|---|
COOPERATE, DEFAULT_MISTAKE_LEVEL, DEFAULT_PUNISHMENT, DEFAULT_REWARD, DEFAULT_SUCKER, DEFAULT_TEMPTATION, DEFECT, EXIT, moves, PLAYER_A, PLAYER_B |
| Constructor Summary | |
|---|---|
StandardGame()
Constructs a standard game, playing 200 rounds with the default game matrix. |
|
StandardGame(Game game)
Constructs a new game with the same game parameters as the given one. |
|
StandardGame(int nrOfRounds,
GameMatrix gameMatrix)
constructor |
|
StandardGame(int nrOfRounds,
GameMatrix gameMatrix,
float noise)
constructor |
|
| Method Summary | |
|---|---|
Player |
getPlayerA()
|
Player |
getPlayerB()
|
GameResult |
play()
plays the game and return the results of it |
void |
setPlayerA(Player playerA)
sets the first player |
void |
setPlayerB(Player playerB)
sets the second player |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Player playerA
protected Player playerB
| Constructor Detail |
|---|
public StandardGame(Game game)
game - a template game to copy parameters frompublic StandardGame()
public StandardGame(int nrOfRounds,
GameMatrix gameMatrix)
nrOfRounds - number of iterationsgameMatrix - matrix of the prisoner's dilemma game
public StandardGame(int nrOfRounds,
GameMatrix gameMatrix,
float noise)
nrOfRounds - number of iterationsgameMatrix - matrix of the prisoner's dilemma gamenoise - probability of mistake| Method Detail |
|---|
public final void setPlayerA(Player playerA)
playerA - first player of this gamepublic final Player getPlayerA()
public final Player getPlayerB()
public void setPlayerB(Player playerB)
playerB - second player of this gamepublic GameResult play()
play in class Game
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||