ipdlx
Class GameMatrix

java.lang.Object
  extended by ipdlx.GameMatrix

public class GameMatrix
extends java.lang.Object

Author:
Jan Humble

Field Summary
static double[][] defaultPayoffMatrix2x2
           
static double[][] defaultPayoffMatrix5x5
           
protected  int nrColumns
           
protected  int nrRows
           
protected  double[][] payoffMatrix
           
 
Constructor Summary
GameMatrix()
           
GameMatrix(double[][] payoffMatrix)
           
 
Method Summary
 boolean checkValues(double[][] payoffMatrix)
           
 double[] getPayoff(double moveA, double moveB)
           
 double getPayoff(double moveA, double moveB, int player)
           
protected  int[] getPayoffIndex(double moveA, double moveB)
           
 double[][] getPayoffMatrix()
           
static void main(java.lang.String[] args)
           
 void setPayoffMatrix(double[][] payoffMatrix)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

payoffMatrix

protected double[][] payoffMatrix

defaultPayoffMatrix5x5

public static final double[][] defaultPayoffMatrix5x5

defaultPayoffMatrix2x2

public static final double[][] defaultPayoffMatrix2x2

nrRows

protected int nrRows

nrColumns

protected int nrColumns
Constructor Detail

GameMatrix

public GameMatrix()
           throws WrongGameMatrixValuesException
Throws:
WrongGameMatrixValuesException

GameMatrix

public GameMatrix(double[][] payoffMatrix)
           throws WrongGameMatrixValuesException
Throws:
WrongGameMatrixValuesException
Method Detail

checkValues

public boolean checkValues(double[][] payoffMatrix)

setPayoffMatrix

public void setPayoffMatrix(double[][] payoffMatrix)
                     throws WrongGameMatrixValuesException
Throws:
WrongGameMatrixValuesException

getPayoffIndex

protected int[] getPayoffIndex(double moveA,
                               double moveB)

getPayoff

public double getPayoff(double moveA,
                        double moveB,
                        int player)

getPayoff

public double[] getPayoff(double moveA,
                          double moveB)

getPayoffMatrix

public double[][] getPayoffMatrix()

toString

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

main

public static void main(java.lang.String[] args)