org.primordion.ealontro.app
Class XhTutorial4

java.lang.Object
  extended byorg.primordion.xholon.base.Xholon
      extended byorg.primordion.xholon.base.XholonWithPorts
          extended byorg.primordion.ealontro.app.XhTutorial4
All Implemented Interfaces:
CeTutorial4, IActivity, IXholon

public class XhTutorial4
extends XholonWithPorts
implements IActivity, CeTutorial4

ECJ Tutorial 4.

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

Field Summary
static int P_BEHAVIOR
           
static int P_EXPECTED_RESULT
           
static int P_RESULT
           
static int P_XVARIABLE
           
static int P_YVARIABLE
           
 java.lang.String roleName
           
 double val
           
 
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.CeTutorial4
BehaviorCE, EcjTutorial4SystemCE, ExpectedResultCE, GeneticProgramCE, MultiValuedRegressionCE, NonTerminalCE, PfAddCE, PfMulCE, PfSubCE, PfWrapperCE, PfXCE, PfYCE, PopulationCE, PrimitiveCE, ProblemCE, ResultCE, StructureCE, TerminalCE, XholonClassCE, XVariableCE, YVariableCE
 
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
XhTutorial4()
          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.
 double performDoubleActivity(IXholon activity)
          Perform an activity including the entire activity subtree.
 void setRoleName(java.lang.String roleName)
          Set name of the role played by this Xholon within a specific context.
 void setVal(double val)
          Set the value of a "double" maintained by this xholon instance.
 java.lang.String toString()
           
 
Methods inherited from class org.primordion.xholon.base.XholonWithPorts
configure, getMaxPorts, getPort, isActiveObject, isBound, isContainer, isPassiveObject, postConfigure, setMaxPorts, setPorts, terminate
 
Methods inherited from class org.primordion.xholon.base.Xholon
appendChild, appendChild, appendChild, cleanup, configure, 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, performGuard, performVoidActivity, postAct, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, processReceivedMessage, reconfigure, 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_BEHAVIOR

public static final int P_BEHAVIOR
See Also:
Constant Field Values

P_XVARIABLE

public static final int P_XVARIABLE
See Also:
Constant Field Values

P_YVARIABLE

public static final int P_YVARIABLE
See Also:
Constant Field Values

P_RESULT

public static final int P_RESULT
See Also:
Constant Field Values

P_EXPECTED_RESULT

public static final int P_EXPECTED_RESULT
See Also:
Constant Field Values

val

public double val

roleName

public java.lang.String roleName
Constructor Detail

XhTutorial4

public XhTutorial4()
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 XholonWithPorts

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(double val)
Description copied from interface: IXholon
Set the value of a "double" 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

performDoubleActivity

public double performDoubleActivity(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.

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

toString

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