net.sourceforge.jabm.gametheory
Class GameTheoreticSimulationController

java.lang.Object
  extended by net.sourceforge.jabm.event.AbstractModel
      extended by net.sourceforge.jabm.SimulationController
          extended by net.sourceforge.jabm.SpringSimulationController
              extended by net.sourceforge.jabm.gametheory.GameTheoreticSimulationController
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Runnable, Model, EventScheduler, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean

public class GameTheoreticSimulationController
extends SpringSimulationController
implements java.io.Serializable

A simulation controller which can be used to generate a heuristic payoff matrix, as described in the following paper: ´╗┐Wellman, M. P. (2006). Methods for Empirical Game-Theoretic Analysis. Twenty-First National Conference on Artificial Intelligence (AAAI-06) (pp. 1152-1155). Boston, Massachusetts.

See Also:
Serialized Form
 

Field Summary
protected  java.io.ObjectOutputStream binaryOut
           
protected  java.lang.String binFileName
           
protected  java.lang.String csvFileName
           
protected  CSVWriter csvOut
           
protected  CompressedPayoffMatrix.Entry currentEntry
           
protected  MutableStringWrapper fileNamePrefix
           
protected  PayoffByStrategyReportVariables payoffByStrategy
           
protected  CompressedPayoffMatrix payoffMatrix
           
protected  java.util.List<Strategy> strategies
           
protected  java.util.List<StrategyInitialiser> strategyInitialisers
           
 
Fields inherited from class net.sourceforge.jabm.SpringSimulationController
beanFactory, simulationBeanName, simulationInitialised, simulationScope
 
Fields inherited from class net.sourceforge.jabm.SimulationController
batch, isRunning, listenersInitialised, modelDescription, numSimulations, reports, simulation, simulationFactory, slowSleepInterval
 
Fields inherited from class net.sourceforge.jabm.event.AbstractModel
deleteQueue, genericListeners, specificListeners
 
Constructor Summary
GameTheoreticSimulationController()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  void constructSimulation()
           
 void exportPayoffPatrix()
           
 java.util.Collection<Agent> getAgents()
           
 java.lang.String getBinFileName()
           
 java.lang.String getCsvFileName()
           
 MutableStringWrapper getFileNamePrefix()
           
 PayoffByStrategyReportVariables getPayoffByStrategy()
           
 org.apache.commons.math3.stat.descriptive.SummaryStatistics getPayoffDistribution(Strategy strategy)
           
 CompressedPayoffMatrix getPayoffMatrix()
           
 java.util.List<Strategy> getStrategies()
           
 java.util.List<StrategyInitialiser> getStrategyInitialisers()
           
 void initialise()
           
 void initialiseAgents(CompressedPayoffMatrix.Entry entry)
           
 void initialiseOutput()
           
 void resize(int numAgents)
           
 void run()
          Run the batch of simulations in sequence.
 void setBinFileName(java.lang.String binFileName)
           
 void setCsvFileName(java.lang.String csvFileName)
           
 void setFileNamePrefix(MutableStringWrapper fileNamePrefix)
           
 void setPayoffByStrategy(PayoffByStrategyReportVariables payoffByStrategy)
           
 void setPayoffMatrix(CompressedPayoffMatrix payoffMatrix)
           
 void setStrategyInitialisers(java.util.List<StrategyInitialiser> strategyInitialisers)
           
 void updatePayoffs(CompressedPayoffMatrix.Entry entry)
           
 
Methods inherited from class net.sourceforge.jabm.SpringSimulationController
getBeanFactory, getSimulationBeanName, setBeanFactory, setSimulationBeanName, tearDownSimulation
 
Methods inherited from class net.sourceforge.jabm.SimulationController
addReport, fireEvent, getModelDescription, getNumSimulations, getPopulation, getReports, getSimulation, getSimulationFactory, getSimulationTime, getSlowSleepInterval, isRunning, runSingleSimulation, setListeners, setModelDescription, setNumSimulations, setReports, setSimulation, setSimulationFactory, setSlowSleepInterval, slow, terminate, wireReports, wireSimulation
 
Methods inherited from class net.sourceforge.jabm.event.AbstractModel
addListener, addListener, clearListeners, clone, notifyGenericListeners, notifySpecificListeners, processDeleteQueue, removeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.jabm.EventScheduler
addListener, addListener, removeListener
 

Field Detail

payoffMatrix

protected CompressedPayoffMatrix payoffMatrix

strategies

protected java.util.List<Strategy> strategies

strategyInitialisers

protected java.util.List<StrategyInitialiser> strategyInitialisers

payoffByStrategy

protected PayoffByStrategyReportVariables payoffByStrategy

currentEntry

protected CompressedPayoffMatrix.Entry currentEntry

csvFileName

protected java.lang.String csvFileName

fileNamePrefix

protected MutableStringWrapper fileNamePrefix

binFileName

protected java.lang.String binFileName

csvOut

protected CSVWriter csvOut

binaryOut

protected java.io.ObjectOutputStream binaryOut
Constructor Detail

GameTheoreticSimulationController

public GameTheoreticSimulationController()
Method Detail

initialise

public void initialise()

resize

public void resize(int numAgents)

run

public void run()
Description copied from class: SimulationController
Run the batch of simulations in sequence.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class SimulationController

constructSimulation

protected void constructSimulation()
Overrides:
constructSimulation in class SpringSimulationController

getPayoffDistribution

public org.apache.commons.math3.stat.descriptive.SummaryStatistics getPayoffDistribution(Strategy strategy)

updatePayoffs

public void updatePayoffs(CompressedPayoffMatrix.Entry entry)

initialiseAgents

public void initialiseAgents(CompressedPayoffMatrix.Entry entry)

getPayoffMatrix

public CompressedPayoffMatrix getPayoffMatrix()

setPayoffMatrix

public void setPayoffMatrix(CompressedPayoffMatrix payoffMatrix)

getStrategies

public java.util.List<Strategy> getStrategies()

getAgents

public java.util.Collection<Agent> getAgents()

getStrategyInitialisers

public java.util.List<StrategyInitialiser> getStrategyInitialisers()

setStrategyInitialisers

public void setStrategyInitialisers(java.util.List<StrategyInitialiser> strategyInitialisers)

getPayoffByStrategy

public PayoffByStrategyReportVariables getPayoffByStrategy()

setPayoffByStrategy

public void setPayoffByStrategy(PayoffByStrategyReportVariables payoffByStrategy)

getCsvFileName

public java.lang.String getCsvFileName()

setCsvFileName

public void setCsvFileName(java.lang.String csvFileName)

getFileNamePrefix

public MutableStringWrapper getFileNamePrefix()

setFileNamePrefix

public void setFileNamePrefix(MutableStringWrapper fileNamePrefix)

getBinFileName

public java.lang.String getBinFileName()

setBinFileName

public void setBinFileName(java.lang.String binFileName)

exportPayoffPatrix

public void exportPayoffPatrix()

initialiseOutput

public void initialiseOutput()

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Overrides:
afterPropertiesSet in class SpringSimulationController
Throws:
java.lang.Exception