uk.ac.leeds.ccg.andyt.gws.core
Class GWS

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler
      extended by uk.ac.leeds.ccg.andyt.gws.core.GWS
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AdaptiveGWS, FixedGWS

public class GWS
extends uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler

TODO: docs

See Also:
Serialized Form

Nested Class Summary
protected  class GWS.Point2DBigDecimal_DistanceBigDecimal_IDInt
          A basic class for holding a Point2DBigDecimal a BigDecimal and an int.
protected  class GWS.Point2DDouble_DistanceDouble_IDInt
          A basic class for holding a Point2D.Double a double and an int in a single object TODO: documentation
 
Field Summary
protected  double cellsizeDouble
           
protected  long col
           
protected  uk.ac.leeds.ccg.andyt.grids.process.Grid2DSquareCellProcessor grid2DSquareCellProcessor
           
protected  long row
           
protected  double weightFactor
           
protected  double weightIntersect
           
 
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler
handleOutOfMemoryErrorFalse, handleOutOfMemoryErrorTrue, memoryReserve
 
Constructor Summary
GWS()
           
 
Method Summary
protected  java.util.HashSet getInDistancePoint2DBigDecimal_DistanceBigDecimal_IDInts(java.util.HashSet pointIDsHashSet, Point2DBigDecimal[] points, Point2DBigDecimal point, java.math.BigDecimal distanceBigDecimal, int decimalPlaces)
          Returns a HashSet of Point2DDouble_DistanceDouble_IDInt objects comprised of those Points from points that are withing distance of point Only those points with IDs in IDsHashSet are necessarily tested.
protected  java.util.HashSet getInDistancePoint2DBigDecimal_DistanceBigDecimal_IDInts(Point2DBigDecimal[] points, Point2DBigDecimal point, java.math.BigDecimal distanceBigDecimal, int decimalPlaces)
          Returns a HashSet of Point2DDouble_DistanceDouble_IDInt objects comprised of those Points from points that are withing distance of point
protected  java.util.HashSet getInDistancePoint2DDouble_DistanceDouble_IDInts(java.util.HashSet pointIDsHashSet, java.awt.geom.Point2D.Double[] points, java.awt.geom.Point2D.Double point, double distance)
          Returns a HashSet of Point2DDouble_DistanceDouble_IDInt objects comprised of those Points from points that are withing distance of point Only those points with IDs in IDsHashSet are necessarily tested.
protected  java.util.HashSet getInDistancePoint2DDouble_DistanceDouble_IDInts(java.awt.geom.Point2D.Double[] points, java.awt.geom.Point2D.Double point, double distance)
          Returns a HashSet of Point2DDouble_DistanceDouble_IDInt objects comprised of those Points from points that are withing distance of point
protected  GWS.Point2DDouble_DistanceDouble_IDInt[] getInDistancePoint2DDouble_DistanceDouble_IDIntsArray(java.util.HashSet pointIDsHashSet, java.awt.geom.Point2D.Double[] points, java.awt.geom.Point2D.Double point, double distance)
          Returns a Point2DDouble_DistanceDouble_IDInt[] containing Point2DDouble_DistanceDouble_IDInt objects - those points from points that are withing distance of point.
protected  GWS.Point2DDouble_DistanceDouble_IDInt[] getInDistancePoint2DDouble_DistanceDouble_IDIntsArray(java.awt.geom.Point2D.Double[] points, java.awt.geom.Point2D.Double point, double distance)
          Returns a Point2DDouble_DistanceDouble_IDInt[] comprised of those Points from points that are within distance of point.
protected  java.util.HashSet getInDistancePointIDs(java.util.HashSet pointIDsHashSet, java.awt.geom.Point2D.Double[] points, java.awt.geom.Point2D.Double point, double distance)
           
protected  java.util.HashSet getInDistancePointIDs(java.awt.geom.Point2D.Double[] points, java.awt.geom.Point2D.Double point, double distance)
           
protected  GWS.Point2DDouble_DistanceDouble_IDInt[] getNearestPoint2DDouble_DistanceDouble_IDInts(GWS.Point2DDouble_DistanceDouble_IDInt[] point2DDouble_DistanceDouble_IDInts, java.awt.geom.Point2D.Double[] points, java.awt.geom.Point2D.Double point, int numberOfPoints, int numberOfPointsFactor, double checkDistance)
          Returns a Point2DDouble_DistanceDouble_IDInt[] thats points are the closest numberOfPoints in pointsDistanceIDs to point.
protected  GWS.Point2DDouble_DistanceDouble_IDInt[] getNearestPoint2DDouble_DistanceDouble_IDInts(java.util.HashSet pointIDs, java.awt.geom.Point2D.Double[] points, java.awt.geom.Point2D.Double point, int numberOfPoints, int numberOfPointsFactor)
          Returns a Point2DDouble_DistanceDouble_IDInt[] thats points are the closest numberOfPoints in points to point.
protected  GWS.Point2DDouble_DistanceDouble_IDInt[] getNearestPoint2DDouble_DistanceDouble_IDInts(java.awt.geom.Point2D.Double[] points, java.awt.geom.Point2D.Double point, int numberOfPoints, int numberOfPointsFactor)
          Returns a Point2DDouble_DistanceDouble_IDInt[] thats points are the closest numberOfPoints in points to point.
protected  java.lang.Object[] getNearestPoint2DDouble_DistanceDouble_IDIntsAndOtherInfo(java.util.HashSet pointIDsHashSet, java.awt.geom.Point2D.Double[] points, java.awt.geom.Point2D.Double point, int numberOfPoints, int numberOfPointsFactor, double setDistance)
          Returns an Object[] result result[ 0 ] is a Point2DDouble_DistanceDouble_IDInt[] thats points are the closest numberOfPoints in points to point.
protected  java.lang.Object[] getNearestPoint2DDouble_DistanceDouble_IDIntsAndOtherInfo(java.awt.geom.Point2D.Double[] points, java.awt.geom.Point2D.Double point, int numberOfPoints, int numberOfPointsFactor, double setDistance)
          Returns an Object[] result result[ 0 ] is a Point2DDouble_DistanceDouble_IDInt[] thats points are the closest numberOfPoints in points to point.
 
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler
clearMemoryReserve, initMemoryReserve, initMemoryReserve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

grid2DSquareCellProcessor

protected uk.ac.leeds.ccg.andyt.grids.process.Grid2DSquareCellProcessor grid2DSquareCellProcessor

row

protected long row

col

protected long col

cellsizeDouble

protected double cellsizeDouble

weightIntersect

protected double weightIntersect

weightFactor

protected double weightFactor
Constructor Detail

GWS

public GWS()
Method Detail

getNearestPoint2DDouble_DistanceDouble_IDInts

protected GWS.Point2DDouble_DistanceDouble_IDInt[] getNearestPoint2DDouble_DistanceDouble_IDInts(java.awt.geom.Point2D.Double[] points,
                                                                                                 java.awt.geom.Point2D.Double point,
                                                                                                 int numberOfPoints,
                                                                                                 int numberOfPointsFactor)
Returns a Point2DDouble_DistanceDouble_IDInt[] thats points are the closest numberOfPoints in points to point. The returned array is ordered such that the closest point is the first element and the furthest point is the final element.


getNearestPoint2DDouble_DistanceDouble_IDInts

protected GWS.Point2DDouble_DistanceDouble_IDInt[] getNearestPoint2DDouble_DistanceDouble_IDInts(java.util.HashSet pointIDs,
                                                                                                 java.awt.geom.Point2D.Double[] points,
                                                                                                 java.awt.geom.Point2D.Double point,
                                                                                                 int numberOfPoints,
                                                                                                 int numberOfPointsFactor)
Returns a Point2DDouble_DistanceDouble_IDInt[] thats points are the closest numberOfPoints in points to point. The returned array is ordered such that the closest point is the first element and the furthest point is the final element. Only those IDs in IDsHashSet need be tested. It is assumed that all IDs in IDHashSet are greater than 0 and less than points.length.

Parameters:
pointIDs - a HashSet containing IDs of Points in points which are considered
points - the entire set of Points being considered
point - the Point of the location being analysed
numberOfPoints - the least number of Points in points for which Point2DDouble_DistanceDouble_IDInts are returned
numberOfPointsFactor - a factor which when multiplied by

getNearestPoint2DDouble_DistanceDouble_IDInts

protected GWS.Point2DDouble_DistanceDouble_IDInt[] getNearestPoint2DDouble_DistanceDouble_IDInts(GWS.Point2DDouble_DistanceDouble_IDInt[] point2DDouble_DistanceDouble_IDInts,
                                                                                                 java.awt.geom.Point2D.Double[] points,
                                                                                                 java.awt.geom.Point2D.Double point,
                                                                                                 int numberOfPoints,
                                                                                                 int numberOfPointsFactor,
                                                                                                 double checkDistance)
Returns a Point2DDouble_DistanceDouble_IDInt[] thats points are the closest numberOfPoints in pointsDistanceIDs to point. The returned array is ordered such that the closest point is the first element and the furthest point is the final element. Only those IDs in IDsHashSet need be tested. It is assumed that all IDs in IDHashSet are greater than 0 and less than points.length.

Parameters:
point2DDouble_DistanceDouble_IDInts -
points -
point -
numberOfPoints -
numberOfPointsFactor, -
checkDistance - XXXX Strangely no longer used!!!

getNearestPoint2DDouble_DistanceDouble_IDIntsAndOtherInfo

protected java.lang.Object[] getNearestPoint2DDouble_DistanceDouble_IDIntsAndOtherInfo(java.awt.geom.Point2D.Double[] points,
                                                                                       java.awt.geom.Point2D.Double point,
                                                                                       int numberOfPoints,
                                                                                       int numberOfPointsFactor,
                                                                                       double setDistance)
Returns an Object[] result result[ 0 ] is a Point2DDouble_DistanceDouble_IDInt[] thats points are the closest numberOfPoints in points to point. result[ 1 ] is a HashSet of Integer IDs of all Points in points that are within setDistance of point result[ 0 ] is ordered such that the closest point is the first element and the furthest point is the final element. NB It is possible that result[ 1 ] is empty.


getNearestPoint2DDouble_DistanceDouble_IDIntsAndOtherInfo

protected java.lang.Object[] getNearestPoint2DDouble_DistanceDouble_IDIntsAndOtherInfo(java.util.HashSet pointIDsHashSet,
                                                                                       java.awt.geom.Point2D.Double[] points,
                                                                                       java.awt.geom.Point2D.Double point,
                                                                                       int numberOfPoints,
                                                                                       int numberOfPointsFactor,
                                                                                       double setDistance)
Returns an Object[] result result[ 0 ] is a Point2DDouble_DistanceDouble_IDInt[] thats points are the closest numberOfPoints in points to point. result[ 1 ] is a HashSet of Integer IDs of all Points in points that are within setDistance of point result[ 0 ] is ordered such that the closest point is the first element and the furthest point is the final element. Warning: It is possible that result[ 1 ] is empty.


getInDistancePointIDs

protected java.util.HashSet getInDistancePointIDs(java.awt.geom.Point2D.Double[] points,
                                                  java.awt.geom.Point2D.Double point,
                                                  double distance)
See Also:
uk.ac.leeds.ccg.gws.Utilities.getInDistancePointIDs

getInDistancePointIDs

protected java.util.HashSet getInDistancePointIDs(java.util.HashSet pointIDsHashSet,
                                                  java.awt.geom.Point2D.Double[] points,
                                                  java.awt.geom.Point2D.Double point,
                                                  double distance)
See Also:
uk.ac.leeds.ccg.gws.Utilities.getInDistancePointIDs

getInDistancePoint2DDouble_DistanceDouble_IDInts

protected java.util.HashSet getInDistancePoint2DDouble_DistanceDouble_IDInts(java.awt.geom.Point2D.Double[] points,
                                                                             java.awt.geom.Point2D.Double point,
                                                                             double distance)
Returns a HashSet of Point2DDouble_DistanceDouble_IDInt objects comprised of those Points from points that are withing distance of point


getInDistancePoint2DBigDecimal_DistanceBigDecimal_IDInts

protected java.util.HashSet getInDistancePoint2DBigDecimal_DistanceBigDecimal_IDInts(Point2DBigDecimal[] points,
                                                                                     Point2DBigDecimal point,
                                                                                     java.math.BigDecimal distanceBigDecimal,
                                                                                     int decimalPlaces)
Returns a HashSet of Point2DDouble_DistanceDouble_IDInt objects comprised of those Points from points that are withing distance of point


getInDistancePoint2DDouble_DistanceDouble_IDInts

protected java.util.HashSet getInDistancePoint2DDouble_DistanceDouble_IDInts(java.util.HashSet pointIDsHashSet,
                                                                             java.awt.geom.Point2D.Double[] points,
                                                                             java.awt.geom.Point2D.Double point,
                                                                             double distance)
Returns a HashSet of Point2DDouble_DistanceDouble_IDInt objects comprised of those Points from points that are withing distance of point Only those points with IDs in IDsHashSet are necessarily tested. It is assumed that all IDs in IDsHashSet are greater than 0 and less than points.length. The IDs are the positions in the array points given as Integers.


getInDistancePoint2DBigDecimal_DistanceBigDecimal_IDInts

protected java.util.HashSet getInDistancePoint2DBigDecimal_DistanceBigDecimal_IDInts(java.util.HashSet pointIDsHashSet,
                                                                                     Point2DBigDecimal[] points,
                                                                                     Point2DBigDecimal point,
                                                                                     java.math.BigDecimal distanceBigDecimal,
                                                                                     int decimalPlaces)
Returns a HashSet of Point2DDouble_DistanceDouble_IDInt objects comprised of those Points from points that are withing distance of point Only those points with IDs in IDsHashSet are necessarily tested. It is assumed that all IDs in IDsHashSet are greater than 0 and less than points.length. The IDs are the positions in the array points given as Integers.


getInDistancePoint2DDouble_DistanceDouble_IDIntsArray

protected GWS.Point2DDouble_DistanceDouble_IDInt[] getInDistancePoint2DDouble_DistanceDouble_IDIntsArray(java.awt.geom.Point2D.Double[] points,
                                                                                                         java.awt.geom.Point2D.Double point,
                                                                                                         double distance)
Returns a Point2DDouble_DistanceDouble_IDInt[] comprised of those Points from points that are within distance of point. The returned array is ordered such that the closest point is the first element and the furthest point is the final element.


getInDistancePoint2DDouble_DistanceDouble_IDIntsArray

protected GWS.Point2DDouble_DistanceDouble_IDInt[] getInDistancePoint2DDouble_DistanceDouble_IDIntsArray(java.util.HashSet pointIDsHashSet,
                                                                                                         java.awt.geom.Point2D.Double[] points,
                                                                                                         java.awt.geom.Point2D.Double point,
                                                                                                         double distance)
Returns a Point2DDouble_DistanceDouble_IDInt[] containing Point2DDouble_DistanceDouble_IDInt objects - those points from points that are withing distance of point. The returned array is ordered such that the closest point is the first element and the furthest point is the final element. Only those IDs in IDsHashSet need be tested. It is assumed that all IDs in IDsHashSet are greater than 0 and less than points.length. The IDs are the positions in the array points given as Integers.