Class GridWithin<T>

java.lang.Object
repast.simphony.query.WithinDistance<T>
repast.simphony.query.space.grid.GridWithin<T>
All Implemented Interfaces:
Query<T>

public class GridWithin<T> extends WithinDistance<T>
A within type query over a grid space. This query will return all the objects that are within a specified distance of a specified object in either all the grid spaces in a context or in a specific grid space. "Within" includes the distance, so within 10 means all the objects from a distance of 0 to 10 including 10.
Version:
$Revision$ $Date$
Author:
Nick Collier
  • Field Summary

    Fields inherited from class repast.simphony.query.WithinDistance

    distance, distanceSq, EMPTY, obj
  • Constructor Summary

    Constructors
    Constructor
    Description
    GridWithin(Context<T> context, T obj, double distance)
    Creates a GridWithin query that will find all the objects within the specified distance of the specified object in all the grid spaces in the specified context.
    GridWithin(Grid<T> space, T obj, double distance)
    Creates a GridWithin query that will find all the objects within the specified distance of the specified object in the specified space.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Iterable<T>
    Creates an iterable over all the objects within the specified distance in the space.
    protected Iterable<T>
    Creates an iterable over all the objects within the specified distance in all the continuoous spaces in the context.

    Methods inherited from class repast.simphony.query.WithinDistance

    query, query

    Methods inherited from class java.lang.Object

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

    • GridWithin

      public GridWithin(Context<T> context, T obj, double distance)
      Creates a GridWithin query that will find all the objects within the specified distance of the specified object in all the grid spaces in the specified context.
      Parameters:
      context -
      obj -
      distance -
    • GridWithin

      public GridWithin(Grid<T> space, T obj, double distance)
      Creates a GridWithin query that will find all the objects within the specified distance of the specified object in the specified space.
      Parameters:
      space -
      obj -
      distance -
  • Method Details

    • createIterable

      protected Iterable<T> createIterable()
      Creates an iterable over all the objects within the specified distance in the space.
      Specified by:
      createIterable in class WithinDistance<T>
      Returns:
      an iterable over all the objects within the specified distance in the space.
    • createIterable

      protected Iterable<T> createIterable(Context<T> context)
      Creates an iterable over all the objects within the specified distance in all the continuoous spaces in the context.
      Specified by:
      createIterable in class WithinDistance<T>
      Parameters:
      context -
      Returns:
      an iterable over all the objects within the specified distance in all the continuoous spaces in the context.