uchicago.src.sim.space
Class HexNeighborhooder
java.lang.Object
uchicago.src.sim.space.AbstractNeighborhooder
uchicago.src.sim.space.HexNeighborhooder
- All Implemented Interfaces:
- Neighborhooder
public class HexNeighborhooder
- extends AbstractNeighborhooder
|
Method Summary |
protected void |
addXY(java.util.Vector v,
int x,
int y)
|
java.util.Vector |
getNeighbors(int x,
int y,
boolean returnNull)
Returns the ring of neighbors with a radius of 1 surrounding the
cell at x, y. |
java.util.Vector |
getNeighbors(int x,
int y,
int[] extents,
boolean returnNull)
Returns the rings of neighbors surrounding the cell at x, y. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HexNeighborhooder
public HexNeighborhooder(Discrete2DSpace space)
getNeighbors
public java.util.Vector getNeighbors(int x,
int y,
boolean returnNull)
- Returns the ring of neighbors with a radius of 1 surrounding the
cell at x, y.
- Parameters:
x - the x coordinate of the celly - the y coordinate of the cell
- Returns:
- an array of doubles in clockwise order starting with the
north or "12" neighboring cell
getNeighbors
public java.util.Vector getNeighbors(int x,
int y,
int[] extents,
boolean returnNull)
- Returns the rings of neighbors surrounding the cell at x, y. The number
of rings is specified by the radius parameter.
- Parameters:
x - the x coordinate of the celly - the y coordinate of the cellextents - the number of neighbor rings to return
- Returns:
- an array of doubles beginning with the outermost ring of
neighbors, starting with the north or "12 o'clock" neighboring cell,
continuing clockwise and spiraling inwards
addXY
protected void addXY(java.util.Vector v,
int x,
int y)