java.lang.Object
repast.simphony.query.space.projection.SpatialPredicate
repast.simphony.query.space.projection.Within
All Implemented Interfaces:
ProjectionPredicate

public class Within extends SpatialPredicate
Predicate that evalutes whether one object is within some distance of another in a projection.
Version:
$Revision$ $Date$
Author:
Nick Collier
  • Constructor Details

    • Within

      public Within(Object obj1, Object obj2, double distance)
      Creates a Within predicate that will evaluate whether or not the first object is within (<=) a specified path length of the other.
      Parameters:
      obj1 -
      obj2 -
  • Method Details

    • evaluate

      public boolean evaluate(Network network)
      Description copied from class: SpatialPredicate
      Evaluates the Network against this predicate.
      Specified by:
      evaluate in interface ProjectionPredicate
      Overrides:
      evaluate in class SpatialPredicate
      Parameters:
      network - the network to evaluate against.
      Returns:
      true if the path length from the first object to the second in the specified Network is less than or equal to the specified value.
    • evaluate

      public boolean evaluate(ContinuousSpace space)
      Evaluates against the specified space testing if the the two objects are within some distance of each other in that space.
      Specified by:
      evaluate in interface ProjectionPredicate
      Overrides:
      evaluate in class SpatialPredicate
      Parameters:
      space - the space to evaluate against
      Returns:
      true if the two are objects are within the specified distance of each other.
    • evaluate

      public boolean evaluate(Grid grid)
      Evaluates against the specified space testing if the the two objects are within some distance of each other in that space.
      Specified by:
      evaluate in interface ProjectionPredicate
      Overrides:
      evaluate in class SpatialPredicate
      Parameters:
      grid - the grid to evaluate against
      Returns:
      true if the two are objects are within the specified distance of each other.
    • evaluate

      public boolean evaluate(Projection projection)
      Description copied from class: SpatialPredicate
      Evaluates the projection against this predicate. This is the default for any Projections not specifically named below.
      Specified by:
      evaluate in interface ProjectionPredicate
      Overrides:
      evaluate in class SpatialPredicate
      Parameters:
      projection - the projection to evaluate against.
      Returns:
      false
    • getObj1

      public Object getObj1()
    • getObj2

      public Object getObj2()
    • getDistance

      public double getDistance()
    • getDistanceSq

      public double getDistanceSq()