Class GridCellNgh<T>

java.lang.Object
repast.simphony.query.space.grid.GridCellNgh<T>

public class GridCellNgh<T> extends Object
Retrieves the MooreNeighborhood around a particular GridPoint. The neighborhood is represented as a List of GridCell-s.
Author:
Nick Collier
  • Field Details

    • grid

      protected Grid<? extends Object> grid
    • extent

      protected int[] extent
    • dims

      protected GridDimensions dims
    • mins

      protected int[] mins
    • maxs

      protected int[] maxs
    • clazz

      protected Class<T> clazz
  • Constructor Details

    • GridCellNgh

      public GridCellNgh(Grid<? extends Object> grid, GridPoint point, Class<T> clazz, int... extent)
      Creates a GridCellNgh using the specified grid, point, type and extent.
      Parameters:
      grid - the grid that contains the neighborhood
      point - the central point of the neighborhood
      clazz - the type of objects we want to get in the neighborhood. Objects not of this type will not be in the neighborhood list
      extent - the extent of the neighborhood in each dimension
  • Method Details

    • getNeighborhood

      public List<GridCell<T>> getNeighborhood(boolean includeCenter)
      Gets the neighborhood of GridCells.
      Parameters:
      includeCenter - if true then the center, i.e the point GridCell will also be returned.
      Returns:
      a list of GridCells that make up the neighborhood.