|
RePast v. 2.0 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--uchicago.src.sim.space.AbsMulti2DGrid
|
+--uchicago.src.sim.space.AbsMulti2DTorus
|
+--uchicago.src.sim.space.AbsMulti2DHexagonalTorus
Base class for hexagonal torii whose cells can hold more that one occupant. The actual object held in the grid cell is a Cell object.
The hexagonal cells are referenced by x, y coordinates as follows:
_
_ / 1 \ _
/ 0 \ _ / 2 \
\ _ / 4 \ _ /
/ 3 \ _ / 5 \
\ _ / 7 \ _ /
/ 6 \ _ / 8 \
\ _ / \ _ /
Here we have a 3 x 3 hexagonal grid. The first row of cells is 0,
1, 2 such that 0,0 refers to cell 0, and 0,2 refers to cell 2. The
next row of cells is 3, 4, 5, so 1,0 refers to cell 3 and so
on. The last row of cells is 6, 7, and 8, so 2, 0 refers to cell 6.
The ring of neighbors with radius one that surrounds cell 4 is
composed of 1, 2, 5, 7, 3, and 0. The grid wraps as a toriod such
that cell -1, 0 refers to cell 2 and cell 0, -1 is cell 6.
| Field Summary |
| Fields inherited from class uchicago.src.sim.space.AbsMulti2DGrid |
matrix, roIter, roList, xSize, ySize |
| Fields inherited from interface uchicago.src.sim.space.Discrete2DSpace |
MOORE, VON_NEUMANN |
| Constructor Summary | |
AbsMulti2DHexagonalTorus(int xSize,
int ySize,
boolean sparse)
Creates this AbsMulti2DHexagonalGrid with the specified dimensions. |
|
| Method Summary | |
ArrayList |
getMooreNeighbors(int x,
int y,
boolean returnNulls)
The notion of Moore neighbors is incoherent on a Hexagonal grid. |
ArrayList |
getMooreNeighbors(int x,
int y,
int xExtent,
int yExtent,
boolean returnNulls)
The notion of Moore neighbors is incoherent on a Hexagonal grid. |
ArrayList |
getMooreNeighborsLoc(int x,
int y,
boolean returnNulls)
The notion of Moore neighbors is incoherent on a Hexagonal grid. |
ArrayList |
getMooreNeighborsLoc(int x,
int y,
int xExtent,
int yExtent,
boolean returnNulls)
The notion of Moore neighbors is incoherent on a Hexagonal grid. |
ArrayList |
getNeighbors(int x,
int y,
boolean returnNulls)
Returns the ring of neighbors with a radius of 1 surrounding the object at x, y. |
ArrayList |
getNeighbors(int x,
int y,
int extent,
boolean returnNulls)
Returns the rings of neighbors surrounding the cell at x, y. |
ArrayList |
getNeighborsLoc(int x,
int y,
boolean returnNulls)
Returns the ring of neighbors with a radius of 1 surrounding the object at x, y. |
ArrayList |
getNeighborsLoc(int x,
int y,
int extent,
boolean returnNulls)
Returns the rings of neighbors surrounding the cell at x, y. |
ArrayList |
getVNNeighbors(int x,
int y,
boolean returnNulls)
The notion of VonNeumann neighbors is incoherent on a Hexagonal grid. |
ArrayList |
getVNNeighbors(int x,
int y,
int xExtent,
int yExtent,
boolean returnNulls)
The notion of VonNeumann neighbors is incoherent on a Hexagonal grid. |
ArrayList |
getVNNeighborsLoc(int x,
int y,
boolean returnNulls)
The notion of VonNeumann neighbors is incoherent on a Hexagonal grid. |
ArrayList |
getVNNeighborsLoc(int x,
int y,
int xExtent,
int yExtent,
boolean returnNulls)
The notion of VonNeumann neighbors is incoherent on a Hexagonal grid. |
| Methods inherited from class uchicago.src.sim.space.AbsMulti2DTorus |
clear, getCellAt, getCellSizeAt, getIteratorAt, getMatrix, getObjectAt, getObjectsAt, getValueAt, putObjectAt, putValueAt, removeObjectAt, trim, xnorm, ynorm |
| Methods inherited from class uchicago.src.sim.space.AbsMulti2DGrid |
getSize, getSizeX, getSizeY, rangeCheck |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AbsMulti2DHexagonalTorus(int xSize,
int ySize,
boolean sparse)
xSize - the number of columns in the gridySize - the number of rows in the gridsparse - whether the grid will be sparsely populated or not| Method Detail |
public ArrayList getNeighbors(int x,
int y,
int extent,
boolean returnNulls)
x - the x coordinate of the celly - the y coordinate of the cellextent - the number of neighbor rings to returnreturnNulls - whether or not the returned list should return
null when a neighbor cell is empty
public ArrayList getNeighbors(int x,
int y,
boolean returnNulls)
x - the x coordinate of the celly - the y coordinate of the cellreturnNulls - whether or not the returned list should return
null when a neighbor cell is empty
public ArrayList getNeighborsLoc(int x,
int y,
int extent,
boolean returnNulls)
x - the x coordinate of the celly - the y coordinate of the cellextent - the number of neighbor rings to returnreturnNulls - whether or not the returned list should return
null when a neighbor cell is empty
public ArrayList getNeighborsLoc(int x,
int y,
boolean returnNulls)
x - the x coordinate of the celly - the y coordinate of the cellreturnNulls - whether or not the returned list should return
null when a neighbor cell is empty
public ArrayList getVNNeighborsLoc(int x,
int y,
boolean returnNulls)
getNeighborsLoc method.
getVNNeighborsLoc in class AbsMulti2DTorusx - the x coordinate of the objecty - the y coordinate of the objectreturnNulls - whether nulls (nothing at x,y) should be returned
UnsupportedOperationException - when called.ObjectLocation
public ArrayList getVNNeighborsLoc(int x,
int y,
int xExtent,
int yExtent,
boolean returnNulls)
getNeighborsLoc method.
getVNNeighborsLoc in class AbsMulti2DTorusx - the x coordinate of the objecty - the y coordinate of the objectxExtent - the extension of the neighborhood in the x directionyExtent - the extension of the neighborhood in the y directionreturnNulls - whether nulls should be returned
UnsupportedOperationException - when called.ObjectLocation
public ArrayList getMooreNeighborsLoc(int x,
int y,
boolean returnNulls)
getNeighborsLoc method.
getMooreNeighborsLoc in class AbsMulti2DTorusx - the x coordinate of the objecty - the y coordinate of the objectreturnNulls - should the returned Vector contain null objects
UnsupportedOperationException - when called.ObjectLocation
public ArrayList getMooreNeighborsLoc(int x,
int y,
int xExtent,
int yExtent,
boolean returnNulls)
getNeighborsLoc method.
getMooreNeighborsLoc in class AbsMulti2DTorusx - the x coordinate of the objecty - the y coordinate of the objectxExtent - the extension of the neighborhood in the x directionyExtent - the extension of the neighborhood in the y directionreturnNulls - should the returned ArrayList contain null objects
UnsupportedOperationException - when called.ObjectLocation
public ArrayList getVNNeighbors(int x,
int y,
boolean returnNulls)
getVNNeighbors in class AbsMulti2DTorusx - the x coordinate of the objecty - the y coordinate of the objectreturnNulls - whether nulls (nothing at x,y) should be returned
UnsupportedOperationException - when called.
public ArrayList getVNNeighbors(int x,
int y,
int xExtent,
int yExtent,
boolean returnNulls)
getVNNeighbors in class AbsMulti2DTorusx - the x coordinate of the objecty - the y coordinate of the objectxExtent - the extension of the neighborhood in the x directionyExtent - the extension of the neighborhood in the y directionreturnNulls - whether nulls should be returned
UnsupportedOperationException - when called.
public ArrayList getMooreNeighbors(int x,
int y,
boolean returnNulls)
getMooreNeighbors in class AbsMulti2DTorusx - the x coordinate of the objecty - the y coordinate of the objectreturnNulls - should the returned ArrayList contain null objects
UnsupportedOperationException - when called.
public ArrayList getMooreNeighbors(int x,
int y,
int xExtent,
int yExtent,
boolean returnNulls)
getMooreNeighbors in class AbsMulti2DTorusx - the x coordinate of the objecty - the y coordinate of the objectxExtent - the extension of the neighborhood in the x directionyExtent - the extension of the neighborhood in the y directionreturnNulls - should the returned ArrayList contain null objects
UnsupportedOperationException - when called.
|
RePast v. 2.0 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||