|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.generation5.bio.CellularAutomata
org.generation5.demos.SpatialIPD
Implements a spatial version of the iterated prisoner's dilemma. Five different strategies are placed randomly within the world and are pitted against each other. The five strategies and their corresponding colours are:
| Field Summary | |
protected PrisonersDilemmaAgent[][] |
ipdAgents
The agents used in the world. |
protected double |
noiseRate
The noise rate. |
protected int |
trialRuns
The number of trail per agent, per neighbour, per iteration. |
| Fields inherited from class org.generation5.bio.CellularAutomata |
bufferPosition, bufferSize, caSize, caWorld, caWorld_x, caWorld_y, clrBackground, clrGrid, clrWorld, DOUBLE_BUFFERING, doubleBuffering, drawGrid, ENCLOSED, geometryType, INFINITE, TORODIAL, X_AXIS, Y_AXIS |
| Constructor Summary | |
SpatialIPD()
Creates a new instance of SpatialIPD |
|
SpatialIPD(int size_x,
int size_y)
Creates a new instance with world size information. |
|
| Method Summary | |
void |
doStep()
Advance the Spatial IPD one timestep. |
double |
getNoiseRate()
Retrieve the noise rate. |
void |
init()
Initialize the world to a random collection of strategies. |
static void |
main(java.lang.String[] args)
|
void |
setNoiseRate(double nr)
Set the noise rate to be used within the world. |
void |
setWorldSize(int size_x,
int size_y)
Set the world size. |
| Methods inherited from class org.generation5.bio.CellularAutomata |
clearWorld, drawGrid, flipBuffer, getBackgroundColor, getCASize, getGeometry, getSizeX, getSizeY, getWorldAt, iterateCA, iterateCA, render, reset, setBackgroundColor, setCASize, setGeometry, setWorldAt, setWorldAtEx, setWorldAtRelative, setWorldColors, setWorldColour, translateGeometry, writeImage |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int trialRuns
protected double noiseRate
protected PrisonersDilemmaAgent[][] ipdAgents
| Constructor Detail |
public SpatialIPD()
public SpatialIPD(int size_x,
int size_y)
size_x - the x-size of the world.size_y - the y-size of the world.| Method Detail |
public void setNoiseRate(double nr)
nr - the noise rate.public double getNoiseRate()
public void setWorldSize(int size_x,
int size_y)
setWorldSize in class CellularAutomatasize_x - the x-size of the world.size_y - the y-size of the world.public static void main(java.lang.String[] args)
args - the command line arguments passed to iterateCA.public void doStep()
doStep in interface SteppabledoStep in class CellularAutomatapublic void init()
init in interface Steppableinit in class CellularAutomata
|
This documentation is part of the Generation5 JDK.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||