Package repast.simphony.space.grid
Class VNContains<T>
java.lang.Object
repast.simphony.space.grid.VNContains<T>
Determines whether or not a particular target object is in the Von Neumann
neighborhood of a particular source. This works with 1D, 2D and 3D grids
only.
- Version:
- $Revision$ $Date$
- Author:
- Nick Collier
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isNeighbor
(T source, T target, int... extent) Checks if the specified target is within the Von Neumann neighborhood of the specified source.
-
Constructor Details
-
VNContains
Creates a VN contains for the specified grid.- Parameters:
grid
-
-
-
Method Details
-
isNeighbor
Checks if the specified target is within the Von Neumann neighborhood of the specified source. The neighborhood is defined by the extent argument which contains the extent of the neighborhood in the relevant dimensions.- Parameters:
source
- the source object of the neighborhoodtarget
- the object to test if it is in the neighborhoodextent
- defines the extents of the neighborhood.- Returns:
- true if the target is in the Von Neumann neighborhood of the source.
-