public abstract class AbstractGrid extends XholonWithPorts implements IGrid
AbstractGrid is an abstract class that your detailed behavior class (ex: XhGameOfLife) should extend if it contains a grid superimposed on some portion of the tree.
IGrid
,
Xholon Project website,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
P_BEHAVIOR |
static int |
P_NEXT |
static int |
P_PREVIOUS |
port
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
DEFAULT_SIZE_MSG_Q, DEFAULT_SIZE_SYSTEM_MSG_Q, GETNAME_DEFAULT, GETNAME_LOCALPART_ID, GETNAME_NOROLENAME, GETNAME_ROLENAME_OR_CLASSNAME, GETNAME_ROLENAMESEP_, GETNAME_SIZE_TEMPLATE, NINCLUDE_PSC, NINCLUDE_PSx, NINCLUDE_PxC, NINCLUDE_Pxx, NINCLUDE_xSC, NINCLUDE_xSx, NINCLUDE_xxC, NINCLUDE_xxx, XHOLON_ID_DEFAULT, XHOLON_ID_NULL
Constructor and Description |
---|
AbstractGrid()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
configure(java.lang.String instructions,
int instructIx)
Configure something based on a configure instruction.
|
java.util.List<PortInformation> |
getAllPorts()
Get a list of all ports exiting from this xholon.
|
int |
getMaxPorts()
Get the number of ports in this type of grid.
|
int |
getNeighType()
Get the neighborhood type, as defined in IGrid.
|
int |
getNumNeighbors()
Get the number of neighbors that a grid cell has.
|
void |
initialize()
Initialize the tree node.
|
void |
moveXholonsToGrid(IXholon xhParent,
boolean allowMultiple)
Move a set of xholons randomly into a grid structure.
|
void |
postConfigure()
Perform some action, typically once at start up; MAY be overridden.
|
void |
postReconfigure()
Post-reconfigure.
|
void |
preReconfigure()
Pre-Reconfigure, such as at the start of a new GP generation.
|
void |
reconfigure()
Reconfigure, such as at the start of a new GP generation.
|
java.util.List<IXholon> |
searchForReferencingNodes()
Search for instances of Xholon with ports that reference this instance.
|
void |
setCaFuture(int row,
int col,
int boundType)
Set reference to Future Self link, if this is a 1D CA grid.
|
void |
setCaLeft(int row,
int col,
int boundType)
Set reference to Left Neighbor link, if this is a 1D CA grid.
|
void |
setCaRight(int row,
int col,
int boundType)
Set reference to Right Neighbor link, if this is a 1D CA grid.
|
void |
setEast(int row,
int col,
int boundType)
Set reference to east link, if this is a grid.
|
void |
setHex0(int row,
int col,
int boundType)
Set reference to Hex0 (top) link, if this is a hexagonal grid.
|
void |
setHex1(int row,
int col,
int boundType)
Set reference to Hex1 link, if this is a hexagonal grid.
|
void |
setHex2(int row,
int col,
int boundType)
Set reference to Hex2 link, if this is a hexagonal grid.
|
void |
setHex3(int row,
int col,
int boundType)
Set reference to Hex3 link, if this is a hexagonal grid.
|
void |
setHex4(int row,
int col,
int boundType)
Set reference to Hex4 link, if this is a hexagonal grid.
|
void |
setHex5(int row,
int col,
int boundType)
Set reference to Hex5 link, if this is a hexagonal grid.
|
void |
setNorth(int row,
int col,
int boundType)
Set reference to north link, if this is a grid.
|
void |
setNorthEast(int row,
int col,
int boundType)
Set reference to north east link, if this is a grid.
|
void |
setNorthWest(int row,
int col,
int boundType)
Set reference to north west link, if this is a grid.
|
void |
setPorts()
Set ports, by creating an array of ports.
|
void |
setSiblingsComplete(int numNeighbors)
Set references to all siblings, if this is a complete graph.
|
void |
setSiblingsCompleteSelf(int numNeighbors)
Set references to all siblings and to self, if this is a complete graph including self.
|
void |
setSiblingsCycle()
Set references to two adjacent siblings, if this is a cycle.
|
void |
setSiblingsWheel()
Set references to two adjacent siblings, and to parent, if this is a wheel.
|
void |
setSouth(int row,
int col,
int boundType)
Set reference to south link, if this is a grid.
|
void |
setSouthEast(int row,
int col,
int boundType)
Set reference to south east link, if this is a grid.
|
void |
setSouthWest(int row,
int col,
int boundType)
Set reference to south west link, if this is a grid.
|
void |
setWest(int row,
int col,
int boundType)
Set reference to west link, if this is a grid.
|
configure, configurePorts, getPort, getPort, isActiveObject, isBound, isContainer, isPassiveObject, setPort, setPort, terminate, toString
act, actNr, appendChild, appendChild, appendChild, appendsOwnChildren, bindPorts, cleanup, compareTo, consoleLog, decVal, decVal, depth, doAction, equals, findFirstChildWithXhClass, findFirstChildWithXhClass, forwardMessage, forwardSyncMessage, getActionList, getAnnotation, getApp, getAttributeNodeXh, getAttributeXh, getChildNodes, getClassNode, getClassNode, getFactory, getFirstChild, getFirstSibling, getId, getInteraction, getInteractionsEnabled, getIQueueImplName, getLastChild, getLastSibling, getLogger, getMsgQ, getName, getName, getNeighbors, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumLevels, getNumSiblings, getParentNode, getPreviousSibling, getRoleName, getRootNode, getSelfAndSiblings, getSelfAndSiblingsIndex, getService, getSiblings, getSystemMsgQ, getUid, getUri, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXholon2Xml, getXhType, getXml2Xholon, getXPath, handleNodeSelection, handleNodeSelection, hasAncestor, hasAnnotation, hasAttributeXh, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, hasSiblingNodes, height, incVal, incVal, initStatics, inOrderPrint, insertAfter, insertAfter, insertAfter, insertBefore, insertBefore, insertBefore, insertFirstChild, isAttributeHandler, isExternal, isInternal, isLeaf, isRootNode, isUniqueSibling, isUniqueSiblingRoleName, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postOrderPrint, preAct, preConfigure, preOrderPrint, print, println, processMessageQ, processReceivedMessage, processReceivedSyncMessage, processSystemMessageQ, registerMessageForwardee, remove, removeAttributeNodeXh, removeAttributeXh, removeChild, replaceNode, searchForReferencingNodesRecurse, sendMessage, sendMessage, sendMessage, sendSyncMessage, sendSyncMessage, sendSyncMessage, sendSystemMessage, sendSystemMessage, setActionList, setAnnotation, setApp, setAttributeNodeXh, setAttributeVal, setAttributeXh, setFirstChild, setId, setName, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setRoleName, setUid, setUri, setVal_boolean, setVal_byte, setVal_char, setVal_double, setVal_float, setVal_int, setVal_long, setVal_Object, setVal_short, setVal_String, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setXhc, showAnnotation, swapNode, toXml, toXmlAttribute, toXmlAttributes, toXmlText, treeSize, visit
public static final int P_BEHAVIOR
public static final int P_NEXT
public static final int P_PREVIOUS
public void initialize()
IXholon
initialize
in interface IXholon
initialize
in class XholonWithPorts
public int getNeighType()
IGrid
getNeighType
in interface IGrid
public int getNumNeighbors()
IGrid
getNumNeighbors
in interface IGrid
public int configure(java.lang.String instructions, int instructIx)
IXholon
public void postConfigure()
IXholon
postConfigure
in interface IXholon
postConfigure
in class XholonWithPorts
public void preReconfigure()
IXholon
preReconfigure
in interface IXholon
preReconfigure
in class Xholon
public void reconfigure()
IXholon
reconfigure
in interface IXholon
reconfigure
in class Xholon
public void postReconfigure()
IXholon
postReconfigure
in interface IXholon
postReconfigure
in class Xholon
public void setNorth(int row, int col, int boundType)
IGrid
public void setSouth(int row, int col, int boundType)
IGrid
public void setWest(int row, int col, int boundType)
IGrid
public void setEast(int row, int col, int boundType)
IGrid
public void setNorthEast(int row, int col, int boundType)
IGrid
setNorthEast
in interface IGrid
public void setSouthEast(int row, int col, int boundType)
IGrid
setSouthEast
in interface IGrid
public void setSouthWest(int row, int col, int boundType)
IGrid
setSouthWest
in interface IGrid
public void setNorthWest(int row, int col, int boundType)
IGrid
setNorthWest
in interface IGrid
public void setHex0(int row, int col, int boundType)
IGrid
public void setHex1(int row, int col, int boundType)
IGrid
public void setHex2(int row, int col, int boundType)
IGrid
public void setHex3(int row, int col, int boundType)
IGrid
public void setHex4(int row, int col, int boundType)
IGrid
public void setHex5(int row, int col, int boundType)
IGrid
public void setCaLeft(int row, int col, int boundType)
IGrid
public void setCaRight(int row, int col, int boundType)
IGrid
setCaRight
in interface IGrid
public void setCaFuture(int row, int col, int boundType)
IGrid
setCaFuture
in interface IGrid
public void setSiblingsComplete(int numNeighbors)
IGrid
setSiblingsComplete
in interface IGrid
public void setSiblingsCompleteSelf(int numNeighbors)
IGrid
setSiblingsCompleteSelf
in interface IGrid
public void setSiblingsCycle()
IGrid
setSiblingsCycle
in interface IGrid
public void setSiblingsWheel()
IGrid
setSiblingsWheel
in interface IGrid
public void moveXholonsToGrid(IXholon xhParent, boolean allowMultiple)
IGrid
moveXholonsToGrid
in interface IGrid
xhParent
- The parent of the xholons that should be moved.allowMultiple
- Whether multiple xholons are allowed in the same grid cell.public int getMaxPorts()
public void setPorts()
IXholon
setPorts
in interface IXholon
setPorts
in class XholonWithPorts
public java.util.List<PortInformation> getAllPorts()
IXholon
getAllPorts
in interface IXholon
getAllPorts
in class Xholon
public java.util.List<IXholon> searchForReferencingNodes()
IXholon
searchForReferencingNodes
in interface IXholon
searchForReferencingNodes
in class Xholon