Package repast.simphony.space.grid
Class VNContains<T>
- java.lang.Object
-
- repast.simphony.space.grid.VNContains<T>
-
public class VNContains<T> extends Object
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
Constructors Constructor Description VNContains(Grid<T> grid)
Creates a VN contains for the specified grid.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isNeighbor(T source, T target, int... extent)
Checks if the specified target is within the Von Neumann neighborhood of the specified source.
-
-
-
Method Detail
-
isNeighbor
public boolean isNeighbor(T source, T target, int... extent)
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.
-
-