org.primordion.xholon.samples
Class Xh09SpatialGames

java.lang.Object
  extended byorg.primordion.xholon.base.Xholon
      extended byorg.primordion.xholon.base.XholonWithPorts
          extended byorg.primordion.xholon.base.AbstractGrid
              extended byorg.primordion.xholon.samples.Xh09SpatialGames
All Implemented Interfaces:
Ce09SpatialGames, IGrid, IXholon

public class Xh09SpatialGames
extends AbstractGrid
implements Ce09SpatialGames

This is the detailed behavior of a sample Xholon application. Source of model concept: Nowak, Martin A. (2006). Evolutionary Dynamics: Exploring the equations of life. Cambridge, MA: Belknap/Harvard. chapter 9 - Spatial Games

Since:
0.7 (Created on September 16, 2007)
Author:
Ken Webb
See Also:
http://www.univie.ac.at/virtuallabs/ VirtualLabs in evolutionary game theory, by Christoph Hauert

Field Summary
static int LAYOUT_RANDOM
           
static int LAYOUT_SINGLE_DEFECTOR
           
 
Fields inherited from class org.primordion.xholon.base.AbstractGrid
P_BEHAVIOR, P_NEXT, P_PREVIOUS
 
Fields inherited from class org.primordion.xholon.base.XholonWithPorts
port
 
Fields inherited from class org.primordion.xholon.base.Xholon
DEFAULT_LEVEL, interaction, interactionsEnabled
 
Fields inherited from interface org.primordion.xholon.samples.Ce09SpatialGames
CwasCCE, CwasDCE, DwasCCE, DwasDCE, GridCellCE, RowCE, SpatialGameCE, XholonClassCE
 
Fields inherited from interface org.primordion.xholon.base.IGrid
BOUNDARY_GRID, BOUNDARY_TORUS, NEIGHBORHOOD_1DCA, NEIGHBORHOOD_HEXAGONAL, NEIGHBORHOOD_MOORE, NEIGHBORHOOD_SIBLING, NEIGHBORHOOD_VON_NEUMANN, P_CAFUTURESELF, P_CALEFTNEIGHBOR, P_CARIGHTNEIGHBOR, P_EAST, P_HEX0, P_HEX1, P_HEX2, P_HEX3, P_HEX4, P_HEX5, P_NORTH, P_NORTHEAST, P_NORTHWEST, P_SOUTH, P_SOUTHEAST, P_SOUTHWEST, P_STAYHERE, P_WEST, REGULAR_COMPLETE, REGULAR_COMPLETE_SELF, REGULAR_CYCLE, REGULAR_WHEEL
 
Fields inherited from interface org.primordion.xholon.base.IXholon
DEFAULT_SIZE_MSG_Q, NINCLUDE_PSC, NINCLUDE_PSx, NINCLUDE_PxC, NINCLUDE_Pxx, NINCLUDE_xSC, NINCLUDE_xSx, NINCLUDE_xxC, NINCLUDE_xxx
 
Constructor Summary
Xh09SpatialGames()
          Constructor.
 
Method Summary
 void act()
          Do some action during this time step.
static int getLayout()
           
static double getPAYOFF_c()
           
 void initialize()
          Initialize the tree node.
 void postConfigure()
          Perform some action, typically once at start up; MAY be overridden.
 void preAct()
          Do any setup required before doing the main action during a time step.
static void setLayout(int layoutArg)
           
static void setPAYOFF_c(double payoffC)
           
 java.lang.String toString()
           
 
Methods inherited from class org.primordion.xholon.base.AbstractGrid
configure, getNeighType, getNumNeighbors, moveXholonsToGrid, postReconfigure, preReconfigure, reconfigure, setCaFuture, setCaLeft, setCaRight, setEast, setHex0, setHex1, setHex2, setHex3, setHex4, setHex5, setNorth, setNorthEast, setNorthWest, setSiblingsComplete, setSiblingsCompleteSelf, setSiblingsCycle, setSiblingsWheel, setSouth, setSouthEast, setSouthWest, setWest
 
Methods inherited from class org.primordion.xholon.base.XholonWithPorts
configure, getMaxPorts, getPort, isActiveObject, isBound, isContainer, isPassiveObject, setMaxPorts, setPorts, terminate
 
Methods inherited from class org.primordion.xholon.base.Xholon
appendChild, appendChild, appendChild, cleanup, createStructure, decVal, decVal, depth, draw, getChildNodes, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, getName, getNeighbors, getNextId, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumSiblings, getParentNode, getPreviousSibling, getRoleName, getRootNode, getSiblings, getSizeMessageQ, getUid, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXhType, handleNodeSelection, hasAncestor, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, height, incVal, incVal, initStatics, inOrderPrint, insertAfter, insertBefore, insertFirstChild, isExternal, isInternal, isLeaf, isRootNode, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postOrderPrint, preConfigure, preOrderPrint, print, println, processMessageQ, processReceivedMessage, remove, removeChild, resetNextId, sendMessage, sendMessage, sendMessage, setAttributeVal, setFactory, setFirstChild, setId, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setRoleName, setSizeMessageQ, setUid, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVariableValue, setXhc, swapNode, treeSize, writeXml
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LAYOUT_RANDOM

public static final int LAYOUT_RANDOM
See Also:
Constant Field Values

LAYOUT_SINGLE_DEFECTOR

public static final int LAYOUT_SINGLE_DEFECTOR
See Also:
Constant Field Values
Constructor Detail

Xh09SpatialGames

public Xh09SpatialGames()
Constructor.

Method Detail

getPAYOFF_c

public static double getPAYOFF_c()
Returns:

setPAYOFF_c

public static void setPAYOFF_c(double payoffC)
Parameters:
payoffC -

getLayout

public static int getLayout()
Returns:

setLayout

public static void setLayout(int layoutArg)
Parameters:
layoutArg -

initialize

public void initialize()
Description copied from interface: IXholon
Initialize the tree node. Typically this is only used to re-initialize a node, such as when it is reused through the TreeNodeFactoryStatic.

Specified by:
initialize in interface IXholon
Overrides:
initialize in class AbstractGrid

postConfigure

public void postConfigure()
Description copied from interface: IXholon
Perform some action, typically once at start up; MAY be overridden. Recursive; application should call this only for root.

Specified by:
postConfigure in interface IXholon
Overrides:
postConfigure in class AbstractGrid

preAct

public void preAct()
Description copied from interface: IXholon
Do any setup required before doing the main action during a time step.

Specified by:
preAct in interface IXholon
Overrides:
preAct in class Xholon

act

public void act()
Description copied from interface: IXholon
Do some action during this time step. Typically all nodes in the tree will do their pre-actions (optional), then all will do their actions, and then all will do their post-actions (optional).

Specified by:
act in interface IXholon
Overrides:
act in class Xholon

toString

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