net.sourceforge.jabm.gametheory
Class CompressedPayoffMatrix

java.lang.Object
  extended by net.sourceforge.jabm.gametheory.CompressedPayoffMatrix
All Implemented Interfaces:
java.io.Serializable

public class CompressedPayoffMatrix
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form
 

Nested Class Summary
static class CompressedPayoffMatrix.Entry
           
static class CompressedPayoffMatrix.FullEntry
           
 
Field Summary
protected  java.util.HashMap<CompressedPayoffMatrix.Entry,PayoffMap> matrix
           
protected  int numEntries
           
protected  int numPlayers
           
protected  int[] numPlayersPerRole
           
protected  int numRoles
           
protected  int numStrategies
           
protected  int[] numStrategiesPerRole
           
 
Constructor Summary
CompressedPayoffMatrix(int numRoles, int[] numStrategiesPerRole, int[] numPlayersPerRole, java.util.List<Strategy> strategies)
           
CompressedPayoffMatrix(java.util.List<Strategy> strategies, int numPlayers)
           
 
Method Summary
 java.util.Iterator<CompressedPayoffMatrix.Entry> compressedEntryIterator()
           
 void export(DataWriter out)
           
 void exportToGambit(java.io.PrintWriter nfgOut)
           
 void exportToGambit(java.io.PrintWriter nfgOut, java.lang.String title)
           
 java.util.Iterator<CompressedPayoffMatrix.FullEntry> fullEntryIterator()
           
 PayoffMap getCompressedPayoffs(CompressedPayoffMatrix.Entry entry)
           
 double[] getFullPayoffs(CompressedPayoffMatrix.FullEntry entry)
           
 int getNumEntries()
           
 int getNumPlayers()
           
 int getNumPlayersPerRole(int role)
           
 int getNumStrategies()
           
 int getNumStrategiesPerRole(int role)
           
 java.util.Iterator<CompressedPayoffMatrix.Entry> orderedEntryIterator()
           
 double payoff(double[] mixedStrategy)
           
 double payoff(int strategy, double[] mixedStrategy)
           
static CompressedPayoffMatrix readFromFile(java.lang.String fileName)
           
 void setCompressedPayoffs(CompressedPayoffMatrix.Entry entry, PayoffMap compressedPayoffs)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

matrix

protected java.util.HashMap<CompressedPayoffMatrix.Entry,PayoffMap> matrix

numRoles

protected int numRoles

numStrategiesPerRole

protected int[] numStrategiesPerRole

numPlayersPerRole

protected int[] numPlayersPerRole

numPlayers

protected int numPlayers

numStrategies

protected int numStrategies

numEntries

protected int numEntries
Constructor Detail

CompressedPayoffMatrix

public CompressedPayoffMatrix(int numRoles,
                              int[] numStrategiesPerRole,
                              int[] numPlayersPerRole,
                              java.util.List<Strategy> strategies)

CompressedPayoffMatrix

public CompressedPayoffMatrix(java.util.List<Strategy> strategies,
                              int numPlayers)
Method Detail

size

public int size()

getCompressedPayoffs

public PayoffMap getCompressedPayoffs(CompressedPayoffMatrix.Entry entry)

setCompressedPayoffs

public void setCompressedPayoffs(CompressedPayoffMatrix.Entry entry,
                                 PayoffMap compressedPayoffs)

compressedEntryIterator

public java.util.Iterator<CompressedPayoffMatrix.Entry> compressedEntryIterator()

orderedEntryIterator

public java.util.Iterator<CompressedPayoffMatrix.Entry> orderedEntryIterator()

fullEntryIterator

public java.util.Iterator<CompressedPayoffMatrix.FullEntry> fullEntryIterator()

getFullPayoffs

public double[] getFullPayoffs(CompressedPayoffMatrix.FullEntry entry)

payoff

public double payoff(double[] mixedStrategy)

payoff

public double payoff(int strategy,
                     double[] mixedStrategy)

readFromFile

public static CompressedPayoffMatrix readFromFile(java.lang.String fileName)

export

public void export(DataWriter out)

exportToGambit

public void exportToGambit(java.io.PrintWriter nfgOut)

exportToGambit

public void exportToGambit(java.io.PrintWriter nfgOut,
                           java.lang.String title)

getNumStrategies

public int getNumStrategies()

getNumPlayers

public int getNumPlayers()

getNumPlayersPerRole

public int getNumPlayersPerRole(int role)

getNumStrategiesPerRole

public int getNumStrategiesPerRole(int role)

getNumEntries

public int getNumEntries()