org.primordion.xholon.base
Interface IGrid

All Known Subinterfaces:
IPatch
All Known Implementing Classes:
AbstractGrid, GridEntity, Patch

public interface IGrid

A grid is a structure containing M rows and N columns (gridCells). This structure can be either a proper grid or a torus. A torus wraps between left and right, and between top and bottom. Each Xholon node within the grid can have a Von Neumann (4 neighbors) or Moore (8 neighbors) neighborhood.

Specify these parameters in your ClassDetails configuration file:

Gmg Moore neighborhood, Grid

Gmt Moore neighborhood, Torus

Gvg Von Neumann neighborhood, Grid

Gvt Von Neumann neighborhood, Torus

[Update: January 29, 2007] There is a requirement for Hexagonal neighborhoods.

Ghg Hexagonal neighborhood, Grid

Ght Hexagonal neighborhood, Torus

[Update: February 15, 2007] There is a requirement for 1D Cellular Automaton (CA) neighborhoods.

Gcg CA neigborhood, Grid

Gct CA neigborhood, Torus

[Update: January 29, 2007] There are some similarities in the concept of a grid, and the concept of a regular graph. As defined above, a grid is rectangular. According to Rosen (Discrete Mathematics and Its Applications, 4th ed., 1999, McGraw-Hill, p.455), "a simple graph is called regular if every vertex of this graph has the same degree". For practical purposes, I am including Grid and Regular Graph in the same Java interface. I am adding a number of types of special simple regular graphs: (see Rosen, p. 447+)

Gsk Sibling neighborhood, Complete graph (all nodes connected)

Gss Sibling neighborhood, Complete graph including Self (all nodes connected, including connection to self)

Gsc Sibling neighborhood, Cycle

Gsw Sibling neighborhood, Wheel

A Sibling Neighborhood is the neighborhood that includes all siblings of a specified node.

Since:
0.1 (Created on Jul 9, 2005)
Author:
Ken Webb

Field Summary
static int BOUNDARY_GRID
           
static int BOUNDARY_TORUS
           
static int NEIGHBORHOOD_1DCA
           
static int NEIGHBORHOOD_HEXAGONAL
           
static int NEIGHBORHOOD_MOORE
           
static int NEIGHBORHOOD_SIBLING
           
static int NEIGHBORHOOD_VON_NEUMANN
           
static int P_CAFUTURESELF
           
static int P_CALEFTNEIGHBOR
           
static int P_CARIGHTNEIGHBOR
           
static int P_EAST
           
static int P_HEX0
           
static int P_HEX1
           
static int P_HEX2
           
static int P_HEX3
           
static int P_HEX4
           
static int P_HEX5
           
static int P_NORTH
           
static int P_NORTHEAST
           
static int P_NORTHWEST
           
static int P_SOUTH
           
static int P_SOUTHEAST
           
static int P_SOUTHWEST
           
static int P_STAYHERE
           
static int P_WEST
           
static int REGULAR_COMPLETE
           
static int REGULAR_COMPLETE_SELF
           
static int REGULAR_CYCLE
           
static int REGULAR_WHEEL
           
 
Method Summary
 int getNeighType()
          Get the neighborhood type, as defined in IGrid.
 int getNumNeighbors()
          Get the number of neighbors that a grid cell has.
 void moveXholonsToGrid(IXholon xhParent, boolean allowMultiple)
          Move a set of xholons randomly into a grid structure.
 void setCaFuture()
          Set reference to Future Self link, if this is a 1D CA grid.
 void setCaLeft()
          Set reference to Left Neighbor link, if this is a 1D CA grid.
 void setCaRight()
          Set reference to Right Neighbor link, if this is a 1D CA grid.
 void setEast()
          Set reference to east link, if this is a grid.
 void setHex0()
          Set reference to Hex0 (top) link, if this is a hexagonal grid.
 void setHex1()
          Set reference to Hex1 link, if this is a hexagonal grid.
 void setHex2()
          Set reference to Hex2 link, if this is a hexagonal grid.
 void setHex3()
          Set reference to Hex3 link, if this is a hexagonal grid.
 void setHex4()
          Set reference to Hex4 link, if this is a hexagonal grid.
 void setHex5()
          Set reference to Hex5 link, if this is a hexagonal grid.
 void setNorth()
          Set reference to north link, if this is a grid.
 void setNorthEast()
          Set reference to north east link, if this is a grid.
 void setNorthWest()
          Set reference to north west link, if this is a grid.
 void setSiblingsComplete()
          Set references to all siblings, if this is a complete graph.
 void setSiblingsCompleteSelf()
          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()
          Set reference to south link, if this is a grid.
 void setSouthEast()
          Set reference to south east link, if this is a grid.
 void setSouthWest()
          Set reference to south west link, if this is a grid.
 void setWest()
          Set reference to west link, if this is a grid.
 

Field Detail

P_STAYHERE

public static final int P_STAYHERE
See Also:
Constant Field Values

P_NORTH

public static final int P_NORTH
See Also:
Constant Field Values

P_NORTHEAST

public static final int P_NORTHEAST
See Also:
Constant Field Values

P_EAST

public static final int P_EAST
See Also:
Constant Field Values

P_SOUTHEAST

public static final int P_SOUTHEAST
See Also:
Constant Field Values

P_SOUTH

public static final int P_SOUTH
See Also:
Constant Field Values

P_SOUTHWEST

public static final int P_SOUTHWEST
See Also:
Constant Field Values

P_WEST

public static final int P_WEST
See Also:
Constant Field Values

P_NORTHWEST

public static final int P_NORTHWEST
See Also:
Constant Field Values

P_HEX0

public static final int P_HEX0
See Also:
Constant Field Values

P_HEX1

public static final int P_HEX1
See Also:
Constant Field Values

P_HEX2

public static final int P_HEX2
See Also:
Constant Field Values

P_HEX3

public static final int P_HEX3
See Also:
Constant Field Values

P_HEX4

public static final int P_HEX4
See Also:
Constant Field Values

P_HEX5

public static final int P_HEX5
See Also:
Constant Field Values

P_CALEFTNEIGHBOR

public static final int P_CALEFTNEIGHBOR
See Also:
Constant Field Values

P_CARIGHTNEIGHBOR

public static final int P_CARIGHTNEIGHBOR
See Also:
Constant Field Values

P_CAFUTURESELF

public static final int P_CAFUTURESELF
See Also:
Constant Field Values

NEIGHBORHOOD_VON_NEUMANN

public static final int NEIGHBORHOOD_VON_NEUMANN
See Also:
Constant Field Values

NEIGHBORHOOD_MOORE

public static final int NEIGHBORHOOD_MOORE
See Also:
Constant Field Values

NEIGHBORHOOD_HEXAGONAL

public static final int NEIGHBORHOOD_HEXAGONAL
See Also:
Constant Field Values

NEIGHBORHOOD_SIBLING

public static final int NEIGHBORHOOD_SIBLING
See Also:
Constant Field Values

NEIGHBORHOOD_1DCA

public static final int NEIGHBORHOOD_1DCA
See Also:
Constant Field Values

BOUNDARY_GRID

public static final int BOUNDARY_GRID
See Also:
Constant Field Values

BOUNDARY_TORUS

public static final int BOUNDARY_TORUS
See Also:
Constant Field Values

REGULAR_COMPLETE

public static final int REGULAR_COMPLETE
See Also:
Constant Field Values

REGULAR_COMPLETE_SELF

public static final int REGULAR_COMPLETE_SELF
See Also:
Constant Field Values

REGULAR_CYCLE

public static final int REGULAR_CYCLE
See Also:
Constant Field Values

REGULAR_WHEEL

public static final int REGULAR_WHEEL
See Also:
Constant Field Values
Method Detail

setNorth

public void setNorth()
Set reference to north link, if this is a grid.


setNorthEast

public void setNorthEast()
Set reference to north east link, if this is a grid.


setEast

public void setEast()
Set reference to east link, if this is a grid.


setSouthEast

public void setSouthEast()
Set reference to south east link, if this is a grid.


setSouth

public void setSouth()
Set reference to south link, if this is a grid.


setSouthWest

public void setSouthWest()
Set reference to south west link, if this is a grid.


setWest

public void setWest()
Set reference to west link, if this is a grid.


setNorthWest

public void setNorthWest()
Set reference to north west link, if this is a grid.


setHex0

public void setHex0()
Set reference to Hex0 (top) link, if this is a hexagonal grid.


setHex1

public void setHex1()
Set reference to Hex1 link, if this is a hexagonal grid.


setHex2

public void setHex2()
Set reference to Hex2 link, if this is a hexagonal grid.


setHex3

public void setHex3()
Set reference to Hex3 link, if this is a hexagonal grid.


setHex4

public void setHex4()
Set reference to Hex4 link, if this is a hexagonal grid.


setHex5

public void setHex5()
Set reference to Hex5 link, if this is a hexagonal grid.


setCaLeft

public void setCaLeft()
Set reference to Left Neighbor link, if this is a 1D CA grid.


setCaRight

public void setCaRight()
Set reference to Right Neighbor link, if this is a 1D CA grid.


setCaFuture

public void setCaFuture()
Set reference to Future Self link, if this is a 1D CA grid.


setSiblingsComplete

public void setSiblingsComplete()
Set references to all siblings, if this is a complete graph.


setSiblingsCompleteSelf

public void setSiblingsCompleteSelf()
Set references to all siblings and to self, if this is a complete graph including self.


setSiblingsCycle

public void setSiblingsCycle()
Set references to two adjacent siblings, if this is a cycle.


setSiblingsWheel

public void setSiblingsWheel()
Set references to two adjacent siblings, and to parent, if this is a wheel.


getNeighType

public int getNeighType()
Get the neighborhood type, as defined in IGrid.

Returns:
The neighborhood type.

getNumNeighbors

public int getNumNeighbors()
Get the number of neighbors that a grid cell has.

Returns:
The number of neighbors.

moveXholonsToGrid

public void moveXholonsToGrid(IXholon xhParent,
                              boolean allowMultiple)
Move a set of xholons randomly into a grid structure. All immediate children of the parent node will be moved. This method should be called on the grid owner.

Parameters:
xhParent - The parent of the xholons that should be moved.
allowMultiple - Whether multiple xholons are allowed in the same grid cell.