ipdlx
Class MultiPlayerGame

java.lang.Object
  extended by ipdlx.Game
      extended by ipdlx.MultiPlayerGame
All Implemented Interfaces:
PDValues

public class MultiPlayerGame
extends Game

A multiplayer game.

Author:
Jan Humble

Field Summary
 
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
MultiPlayerGame(Game game)
          Constructs a new game with the same game parameters as the given one.
MultiPlayerGame(int nrOfRounds, GameMatrix gameMatrix)
          constructor
MultiPlayerGame(int nrOfRounds, GameMatrix gameMatrix, float noise)
          constructor
 
Method Summary
 GameResult play()
          plays the game and return the results of it
 
Methods inherited from class ipdlx.Game
addGameListener, addPlayer, addPlayers, broadcastGameStart, broadcastResults, broadcastRoundResults, filterMove, getBroadcastResult, getBroadcastRoundResults, getGameListeners, getGameMatrix, getNrRoundsStDev, getNumberOfRounds, getNumberOfRounds, getNumberOfRoundsStDev, getProbabilityOfMistake, getStrategyMove, getStrategyMove, removeGameListener, setBroadcastResult, setBroadcastRoundResults, setGameMatrix, setMoveTimeLimit, setNrRoundsStDev, setNumberOfRounds, setPlayers, setProbabilityOfMistake, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiPlayerGame

public MultiPlayerGame(Game game)
Constructs a new game with the same game parameters as the given one. Also, all game listeners are transferred.

Parameters:
game - a template game to copy parameters from

MultiPlayerGame

public MultiPlayerGame(int nrOfRounds,
                       GameMatrix gameMatrix)
constructor

Parameters:
nrOfRounds - number of iterations
gameMatrix - matrix of the prisoner's dilemma game

MultiPlayerGame

public MultiPlayerGame(int nrOfRounds,
                       GameMatrix gameMatrix,
                       float noise)
constructor

Parameters:
nrOfRounds - number of iterations
gameMatrix - matrix of the prisoner's dilemma game
noise - probability of mistake
Method Detail

play

public GameResult play()
plays the game and return the results of it

Overrides:
play in class Game
Returns:
result of the game