uk.ac.leeds.ccg.andyt.gws.core
Class AdaptiveGWS
java.lang.Object
uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler
uk.ac.leeds.ccg.andyt.gws.core.GWS
uk.ac.leeds.ccg.andyt.gws.core.AdaptiveGWS
- All Implemented Interfaces:
- java.io.Serializable
public class AdaptiveGWS
- extends GWS
TODO:
docs
- See Also:
- Serialized Form
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler |
handleOutOfMemoryErrorFalse, handleOutOfMemoryErrorTrue, memoryReserve |
Method Summary |
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble[] |
getAdaptiveKernelWeights(java.util.HashSet mt0PointIDs,
java.awt.geom.Point2D.Double[] t0Points,
java.util.HashSet mt1PointIDs,
java.awt.geom.Point2D.Double[] t1Points,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDoubleFactory grid2DSquareCellDoubleFactory,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
int numberOfPoints,
int numberOfPointsFactor,
double setDistance,
double weightIntersect,
double weightFactor,
double sumAdaptiveKernelWeights,
int precision)
Returns an Grid2DSquareCellDouble[] The first element of which is
the Adaptive Kernel Weights for t0Points, the second element of which is
the Adaptive Kernel Weights for t1Points (where the width of the kernel
is the radius of the circle which contains at least numberOfPoints in
t0Points AND at least numberOfPoints points in t1Points). |
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble[] |
getAdaptiveKernelWeights(int divisions,
java.awt.geom.Point2D.Double[] t0Points,
java.awt.geom.Point2D.Double[] t1Points,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDoubleFactory grid2DSquareCellDoubleFactory,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
int numberOfPoints,
int numberOfPointsFactor,
double setDistance,
double weightIntersect,
double weightFactor,
double sumAdaptiveKernelWeights,
int precision)
Returns an Grid2DSquareCellDouble[] The first element of which is
the Adaptive Kernel Weights for t0Points, the second element of which is
the Adaptive Kernel Weights for t1Points (where the width of the kernel
is the radius of the circle which contains at least numberOfPoints in
t0Points AND at least numberOfPoints points in t1Points). |
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble |
getAdaptiveKernelWeights(java.awt.geom.Point2D.Double[] t0Points,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDoubleFactory grid2DSquareCellDoubleFactory,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
int numberOfPoints,
double weightIntersect,
double weightFactor,
double sumAdaptiveKernelWeights,
int precision)
Returns an Grid2DSquareCellDouble thats values are the sums of
adaptiveKernelWeights for cells in grid2DSquareCellDouble. |
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble |
getAdaptiveKernelWeights(java.awt.geom.Point2D.Double[] t0Points,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDoubleFactory grid2DSquareCellDoubleFactory,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
int numberOfPoints,
int numberOfPointsFactor,
double weightIntersect,
double weightFactor,
double sumAdaptiveKernelWeights,
int precision,
double setDistance)
Returns a Grid2DSquareCellDouble thats values are the sums of
adaptiveKernelWeights for cells in grid2DSquareCellDouble. |
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble[] |
getAdaptiveKernelWeights(java.awt.geom.Point2D.Double[] t0Points,
java.awt.geom.Point2D.Double[] t1Points,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDoubleFactory grid2DSquareCellDoubleFactory,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
int numberOfPoints,
int numberOfPointsFactor,
double setDistance,
double weightIntersect,
double weightFactor,
double sumAdaptiveKernelWeights,
int precision)
Returns an Grid2DSquareCellDouble[] The first element of which is
the Adaptive Kernel Weights for t0Points, the second element of which is
the Adaptive Kernel Weights for t1Points (where the width of the kernel
is the radius of the circle which contains at least numberOfPoints in
t0Points AND at least numberOfPoints points in t1Points). |
Methods inherited from class uk.ac.leeds.ccg.andyt.gws.core.GWS |
getInDistancePoint2DBigDecimal_DistanceBigDecimal_IDInts, getInDistancePoint2DBigDecimal_DistanceBigDecimal_IDInts, getInDistancePoint2DDouble_DistanceDouble_IDInts, getInDistancePoint2DDouble_DistanceDouble_IDInts, getInDistancePoint2DDouble_DistanceDouble_IDIntsArray, getInDistancePoint2DDouble_DistanceDouble_IDIntsArray, getInDistancePointIDs, getInDistancePointIDs, getNearestPoint2DDouble_DistanceDouble_IDInts, getNearestPoint2DDouble_DistanceDouble_IDInts, getNearestPoint2DDouble_DistanceDouble_IDInts, getNearestPoint2DDouble_DistanceDouble_IDIntsAndOtherInfo, getNearestPoint2DDouble_DistanceDouble_IDIntsAndOtherInfo |
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 |
AdaptiveGWS
public AdaptiveGWS()
getAdaptiveKernelWeights
public uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getAdaptiveKernelWeights(java.awt.geom.Point2D.Double[] t0Points,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDoubleFactory grid2DSquareCellDoubleFactory,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
int numberOfPoints,
double weightIntersect,
double weightFactor,
double sumAdaptiveKernelWeights,
int precision)
- Returns an Grid2DSquareCellDouble thats values are the sums of
adaptiveKernelWeights for cells in grid2DSquareCellDouble. The weights are based on Points
in points in a nearest neighbourhood given by numberOfPoints to each cell
in grid2DSquareCellDouble. The kernel shape is defined by weightIntersect and weightFactor.
The kernel volume is given by sumAdaptiveKernelWeights approximated using
precision. This method can be slow. Each cell in grid is calculated by
going through all t0Points. If this method is too slow then try using
getAdaptiveKernelWeights( Point2D.Double[],
Grid2DSquareCellDoubleFactory,
AbstractGrid2DSquareCellDoube, int, int,
double, double, double, int, double )
- Parameters:
t0Points
- the Point2D.Double[] from which kernel weights are
calculatedgrid2DSquareCellDoubleFactory
- the Grid2DSquareCellDoubleFactory used to
generate the resultgrid
- an Grid2DSquareCellDouble defining the frame and
extent processednumberOfPoints
- the number of points accounted for in each kernel
calculationweightIntersect
- an arbitrary doubleweightFactor
- defines the shape of the kernel distance decaysumAdaptiveKernelWeights
- the volume for the kernelprecision
- the precision with which the kernels volume is
approximated
getAdaptiveKernelWeights
public uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getAdaptiveKernelWeights(java.awt.geom.Point2D.Double[] t0Points,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDoubleFactory grid2DSquareCellDoubleFactory,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
int numberOfPoints,
int numberOfPointsFactor,
double weightIntersect,
double weightFactor,
double sumAdaptiveKernelWeights,
int precision,
double setDistance)
- Returns a Grid2DSquareCellDouble thats values are the sums of
adaptiveKernelWeights for cells in grid2DSquareCellDouble. The weights are based on Points
in points in a nearest neighbourhood given by numberOfPoints to each cell
in grid2DSquareCellDouble. The kernel shape is defined by weightIntersect and weightFactor.
The kernel volume is given by sumAdaptiveKernelWeights approximated using
precision. The parameter setDistance is used to speed up processing by
keeping a memory of what points have recently been examined. If
sufficient then this memory is sometimes (when safe) used to calculate
the weight for the next cell. A more basic way to process would be to go
through the entire points array for each cell as in
getAdaptiveKernelWeights( Point2D.Double[],
Grid2DSquareCellDoubleFactory,
Grid2DSquareCellDoubeAbstract, int, double,
double, double, int )
however this can be slow (especially since a spatial indexing (or a
spatial database) is not being used. This method is a speed up that will
return the same answer as the above mentioned method. The main speed up
comes from keeping a memory of a larger number of nearby points and using
this when it can be guaranteed to work when calculating the adaptive
kernel weight sum. The parameters setDistance and numberOfPointsFactor
control the size of the memory. If setDistance and numberOfPointsFactor
are set too high this method may be slow. Typically: numberOfPointsFactor
will be between 1 and 10 depending on numberOfPoints; and, setDistance
will be greater than the grid cellsize.
- Parameters:
points
- the Point2D.Double[] from which kernel weights are
calculatedgrid2DSquareCellDoubleFactory
- the Grid2DSquareCellDoubleFactory used to
generate the resultgrid
- an Grid2DSquareCellDouble defining the frame and
extent processednumberOfPoints
- the number of points accounted for in each kernel
calculationnumberOfPointsFactor
- a memory controlweightIntersect
- an arbitrary doubleweightFactor
- defines the shape of the kernel distance decaysumAdaptiveKernelWeights
- the volume for the kernelprecision
- the precision with which the kernels volume is
approximatedsetDistance
- a memory control
getAdaptiveKernelWeights
public uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble[] getAdaptiveKernelWeights(java.awt.geom.Point2D.Double[] t0Points,
java.awt.geom.Point2D.Double[] t1Points,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDoubleFactory grid2DSquareCellDoubleFactory,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
int numberOfPoints,
int numberOfPointsFactor,
double setDistance,
double weightIntersect,
double weightFactor,
double sumAdaptiveKernelWeights,
int precision)
- Returns an Grid2DSquareCellDouble[] The first element of which is
the Adaptive Kernel Weights for t0Points, the second element of which is
the Adaptive Kernel Weights for t1Points (where the width of the kernel
is the radius of the circle which contains at least numberOfPoints in
t0Points AND at least numberOfPoints points in t1Points).
- Parameters:
t0Points
- one of the two Point2D.Double[] from which kernel weights
are calculatedt1Points
- one of the two Point2D.Double[] from which kernel weights
are calculatedgrid2DSquareCellDoubleFactory
- the Grid2DSquareCellDoubleFactory used to
generate the resultgrid
- an Grid2DSquareCellDouble defining the frame and
extent processednumberOfPoints
- the number of points accounted for in each kernel
calculationweightIntersect
- an arbitrary doubleweightFactor
- defines the shape of the kernel distance decayxmin
- the minimum x-coordinate for any point consideredymin
- the minimum y-coordinate for any point consideredxmax
- the maximum x-coordinate for any point consideredymax
- the maximum y-coordinate for any point consideredsumAdaptiveKerneWeights
- the volume under the kernel to be
preservedprecision
- the precision with which the kernel volume is estimated
getAdaptiveKernelWeights
public uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble[] getAdaptiveKernelWeights(java.util.HashSet mt0PointIDs,
java.awt.geom.Point2D.Double[] t0Points,
java.util.HashSet mt1PointIDs,
java.awt.geom.Point2D.Double[] t1Points,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDoubleFactory grid2DSquareCellDoubleFactory,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
int numberOfPoints,
int numberOfPointsFactor,
double setDistance,
double weightIntersect,
double weightFactor,
double sumAdaptiveKernelWeights,
int precision)
- Returns an Grid2DSquareCellDouble[] The first element of which is
the Adaptive Kernel Weights for t0Points, the second element of which is
the Adaptive Kernel Weights for t1Points (where the width of the kernel
is the radius of the circle which contains at least numberOfPoints in
t0Points AND at least numberOfPoints points in t1Points).
- Parameters:
t0PointIDs
- this is a HashSet for restricting which of t0Points
need to be used in the calculation.t0Points
- one of the two Point2D.Double[] from which kernel weights
are calculatedt1PointIDs
- this is a HashSet for restricting which of t1Points
need to be used in the calculation.t1Points
- one of the two Point2D.Double[] from which kernel weights
are calculatedgrid2DSquareCellDoubleFactory
- the Grid2DSquareCellDoubleFactory used to
generate the resultgrid
- an Grid2DSquareCellDouble defining the frame and
extent processednumberOfPoints
- the number of points accounted for in each kernel
calculationweightIntersect
- an arbitrary doubleweightFactor
- defines the shape of the kernel distance decayxmin
- the minimum x-coordinate for any point consideredymin
- the minimum y-coordinate for any point consideredxmax
- the maximum x-coordinate for any point consideredymax
- the maximum y-coordinate for any point consideredsumAdaptiveKerneWeights
- the volume under the kernel to be
preservedprecision
- the precision with which the kernel volume is estimated
getAdaptiveKernelWeights
public uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble[] getAdaptiveKernelWeights(int divisions,
java.awt.geom.Point2D.Double[] t0Points,
java.awt.geom.Point2D.Double[] t1Points,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDoubleFactory grid2DSquareCellDoubleFactory,
uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
int numberOfPoints,
int numberOfPointsFactor,
double setDistance,
double weightIntersect,
double weightFactor,
double sumAdaptiveKernelWeights,
int precision)
- Returns an Grid2DSquareCellDouble[] The first element of which is
the Adaptive Kernel Weights for t0Points, the second element of which is
the Adaptive Kernel Weights for t1Points (where the width of the kernel
is the radius of the circle which contains at least numberOfPoints in
t0Points AND at least numberOfPoints points in t1Points).
- Parameters:
divisions
- controls the number of times the problem is dividedt0Points
- one of the two Point2D.Double[] from which kernel weights
are calculatedt1Points
- one of the two Point2D.Double[] from which kernel weights
are calculatedgrid2DSquareCellDoubleFactory
- the Grid2DSquareCellDoubleFactory used to
generate the resultgrid
- an Grid2DSquareCellDouble defining the frame and
extent processednumberOfPoints
- the number of points accounted for in each kernel
calculationweightIntersect
- an arbitrary doubleweightFactor
- defines the shape of the kernel distance decayxmin
- the minimum x-coordinate for any point consideredymin
- the minimum y-coordinate for any point consideredxmax
- the maximum x-coordinate for any point consideredymax
- the maximum y-coordinate for any point consideredsumAdaptiveKerneWeights
- the volume under the kernel to be
preservedprecision
- the precision with which the kernel volume is estimated