org.primordion.ealontro.app
Class XhAntTrail

java.lang.Object
  extended byorg.primordion.xholon.base.Xholon
      extended byorg.primordion.xholon.base.XholonWithPorts
          extended byorg.primordion.xholon.base.AbstractGrid
              extended byorg.primordion.ealontro.app.XhAntTrail
All Implemented Interfaces:
CeAntTrail, IActivity, IGrid, IXholon

public class XhAntTrail
extends AbstractGrid
implements IActivity, CeAntTrail

ECJ Ant Trail.

Since:
0.3 (Created on June 7, 2006)
Author:
Ken Webb

Field Summary
static int direction
           
static java.lang.String[] directionName
           
static int P_FOOD
           
static int P_GRID
           
 java.lang.String roleName
           
static java.lang.String trailFile
           
 int val
           
static int VAL_EMPTY
           
static int VAL_EMPTY_ANT
           
static int VAL_EMPTY_VISITED
           
static int VAL_FOOD
           
static int VAL_FOOD_ANT
           
static int VAL_FOOD_VISITED
           
static int VAL_TRAIL
           
static int VAL_TRAIL_ANT
           
static int VAL_TRAIL_VISITED
           
 
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.ealontro.app.CeAntTrail
AntCE, BehaviorCE, EcjAntTrailSystemCE, FoodCE, GeneticProgramCE, GridCE, GridCellCE, NonTerminalCE, PfIfFoodAheadCE, PfLeftCE, PfMoveCE, PfProgn2CE, PfProgn3CE, PfProgn4CE, PfProgn5CE, PfProgn6CE, PfProgn7CE, PfRightCE, PfWrapperCE, PopulationCE, PrimitiveCE, ProblemCE, RowCE, StructureCE, TerminalCE, TrailCE, 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
XhAntTrail()
          Constructor.
 
Method Summary
 void act()
          Do some action during this time step.
 void decVal(double decAmount)
          Decrement an internal double value by a specified amount.
 java.lang.String getRoleName()
          Get name of the role played by this Xholon within a specific context.
 double getVal()
          Get the value of a "double" maintained by this xholon instance.
 void incVal(double incAmount)
          Increment an internal double value by a specified amount.
 void initialize()
          Initialize the tree node.
 void performVoidActivity(IXholon activity)
          Perform an activity including the entire activity subtree.
 void postConfigure()
          Perform some action, typically once at start up; MAY be overridden.
 void setRoleName(java.lang.String roleName)
          Set name of the role played by this Xholon within a specific context.
 void setVal(int val)
          Set the value of a "int" maintained by this xholon instance.
 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, depth, draw, getChildNodes, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, getName, getNeighbors, getNextId, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumSiblings, getParentNode, getPreviousSibling, getRootNode, getSiblings, getSizeMessageQ, getUid, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getXhc, getXhcId, getXhcName, getXhType, handleNodeSelection, hasAncestor, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, height, incVal, initStatics, inOrderPrint, insertAfter, insertBefore, insertFirstChild, isExternal, isInternal, isLeaf, isRootNode, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, postAct, postOrderPrint, preAct, preConfigure, preOrderPrint, print, println, processMessageQ, processReceivedMessage, remove, removeChild, resetNextId, sendMessage, sendMessage, sendMessage, setAttributeVal, setFactory, setFirstChild, setId, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setSizeMessageQ, setUid, 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

P_GRID

public static final int P_GRID
See Also:
Constant Field Values

P_FOOD

public static final int P_FOOD
See Also:
Constant Field Values

VAL_EMPTY

public static final int VAL_EMPTY
See Also:
Constant Field Values

VAL_TRAIL

public static final int VAL_TRAIL
See Also:
Constant Field Values

VAL_FOOD

public static final int VAL_FOOD
See Also:
Constant Field Values

VAL_EMPTY_ANT

public static final int VAL_EMPTY_ANT
See Also:
Constant Field Values

VAL_TRAIL_ANT

public static final int VAL_TRAIL_ANT
See Also:
Constant Field Values

VAL_FOOD_ANT

public static final int VAL_FOOD_ANT
See Also:
Constant Field Values

VAL_EMPTY_VISITED

public static final int VAL_EMPTY_VISITED
See Also:
Constant Field Values

VAL_TRAIL_VISITED

public static final int VAL_TRAIL_VISITED
See Also:
Constant Field Values

VAL_FOOD_VISITED

public static final int VAL_FOOD_VISITED
See Also:
Constant Field Values

val

public int val

roleName

public java.lang.String roleName

direction

public static int direction

directionName

public static java.lang.String[] directionName

trailFile

public static java.lang.String trailFile
Constructor Detail

XhAntTrail

public XhAntTrail()
Constructor.

Method Detail

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

getVal

public double getVal()
Description copied from interface: IXholon
Get the value of a "double" maintained by this xholon instance. If a class that implements this interface does not maintain such a value, it should return 0.0 This method can be used in place of getVal_double()

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

setVal

public void setVal(int val)
Description copied from interface: IXholon
Set the value of a "int" maintained by this xholon instance.

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

incVal

public void incVal(double incAmount)
Description copied from interface: IXholon
Increment an internal double value by a specified amount. This is a convenience method.

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

decVal

public void decVal(double decAmount)
Description copied from interface: IXholon
Decrement an internal double value by a specified amount. This is a convenience method.

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

setRoleName

public void setRoleName(java.lang.String roleName)
Description copied from interface: IXholon
Set name of the role played by this Xholon within a specific context.

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

getRoleName

public java.lang.String getRoleName()
Description copied from interface: IXholon
Get name of the role played by this Xholon within a specific context.

Specified by:
getRoleName in interface IXholon
Overrides:
getRoleName 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

performVoidActivity

public void performVoidActivity(IXholon activity)
Description copied from interface: IXholon
Perform an activity including the entire activity subtree. This is intended to be used in Behavior encoded as an Activity subtree, and in GP and other evolutionary computation such as ECJ integration with Xholon. This will typically be a side effect, instead of computing and returning a value.

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

toString

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