ipdlx
Class GameResult

java.lang.Object
  extended by ipdlx.GameResult
Direct Known Subclasses:
StandardGameResult

public class GameResult
extends java.lang.Object

Results of the game how many points each player won

Author:
Jan Humble

Field Summary
protected  int nrRounds
           
protected  double[] payoffs
          number of points won by players
protected  Player[] players
           
 
Constructor Summary
GameResult(int nrRounds)
          constructor
GameResult(Player[] players, int nrRounds)
          constructor
GameResult(java.util.Vector players, int nrRounds)
          constructor
 
Method Summary
 void addPayoff(int index, double payoff)
           
 double[][] getLog()
          returns game log (for both players)
 double getPayoffPlayer(int playerNb)
          returns number of points won by selected player during this game
 double[] getPayoffs()
          returns number of points won by each player during this game
 Player getPlayer(int index)
           
 java.lang.String toString()
           
 void writeMove(int nbOfRound, int player, double move)
          write type of move made by players to game log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

payoffs

protected final double[] payoffs
number of points won by players


players

protected final Player[] players

nrRounds

protected final int nrRounds
Constructor Detail

GameResult

public GameResult(int nrRounds)
constructor


GameResult

public GameResult(java.util.Vector players,
                  int nrRounds)
constructor


GameResult

public GameResult(Player[] players,
                  int nrRounds)
constructor

Method Detail

getPlayer

public final Player getPlayer(int index)

addPayoff

public void addPayoff(int index,
                      double payoff)

getPayoffs

public double[] getPayoffs()
returns number of points won by each player during this game

Returns:
payoff number of points won by each player

getPayoffPlayer

public final double getPayoffPlayer(int playerNb)
returns number of points won by selected player during this game

Parameters:
playerNb - player A or B
Returns:
payoff number of points won selected player

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

writeMove

public void writeMove(int nbOfRound,
                      int player,
                      double move)
write type of move made by players to game log

Parameters:
nbOfRound - - which round is this
player - - which player A or B
move - - type of move of player - COOPERATION or DEFECTION

getLog

public double[][] getLog()
returns game log (for both players)

Returns:
game log