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

    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VNContains

      public VNContains(Grid<T> grid)
      Creates a VN contains for the specified grid.
      Parameters:
      grid -
  • Method Details

    • 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 neighborhood
      target - the object to test if it is in the neighborhood
      extent - defines the extents of the neighborhood.
      Returns:
      true if the target is in the Von Neumann neighborhood of the source.