org.primordion.xholon.samples
Class XhCollisions

java.lang.Object
  extended byorg.primordion.xholon.base.Xholon
      extended byorg.primordion.xholon.base.XholonWithPorts
          extended byorg.primordion.xholon.samples.XhCollisions
All Implemented Interfaces:
IXholon

public class XhCollisions
extends XholonWithPorts

Collisions. This is the detailed behavior of a sample Xholon application.

Since:
0.1 (Created on August 11, 2005)
Author:
Ken Webb

Field Summary
 int avgVehicleKilometers
           
 float proportionLicensed
           
 float rate
           
 java.lang.String roleName
           
 int 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.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
XhCollisions()
          Constructor.
 
Method Summary
 void act()
          Do some action during this time step.
 void configure()
          Perform some action, typically once at start up; MAY be overridden.
 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 initialize()
          Initialize the tree node.
static void main(java.lang.String[] args)
          main
 void preAct()
          Do any setup required before doing the main action during a time step.
 int setAttributeVal(java.lang.String attrName, java.lang.String attrVal)
          Set the value of an attribute, given it's name.
 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.XholonWithPorts
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, 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, incVal, initStatics, inOrderPrint, insertAfter, insertBefore, insertFirstChild, isExternal, isInternal, isLeaf, isRootNode, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postOrderPrint, postReconfigure, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, processReceivedMessage, reconfigure, remove, removeChild, resetNextId, sendMessage, sendMessage, sendMessage, 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

val

public int val

rate

public float rate

proportionLicensed

public float proportionLicensed

avgVehicleKilometers

public int avgVehicleKilometers

roleName

public java.lang.String roleName
Constructor Detail

XhCollisions

public XhCollisions()
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(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

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

setAttributeVal

public int setAttributeVal(java.lang.String attrName,
                           java.lang.String attrVal)
Description copied from interface: IXholon
Set the value of an attribute, given it's name. The default implementation of this should handle any variable with the name "val". Concrete subclasses may handle any other variables, which would be required if using JavaMicro reflection.

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

configure

public void configure()
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:
configure in interface IXholon
Overrides:
configure in class XholonWithPorts

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

main

public static void main(java.lang.String[] args)
main

Parameters:
args - none