Print

Print


On Aug 9, 2012, at 8:12 PM, Russell Thomas wrote:

> I have a separate bug to report in "getNeighborsMaxDistance" and related
> methods.
> 
> The methods include two mutable IntBags "xPos" and "yPos" that are supposed
> to be filled with "each x and y value of these locations in the provided
> IntBags xPos and yPos, clearing the bags first" (quoted from the ClassDoc).
> 
> The bug is that these bags are filled with EVERY x and y location within the
> range of maxDistance, not just the x and y locations of objects found in the
> grid.

This isn't a bug -- it's how the methods are supposed to work.  All <x,y> locations neighboring a given location are put into the IntBags.  Then all the objects lying within those locations are put into the result Bag.  Where did you see documentation stating otherwise?  

There is another function called getNeighborsAndCorrespondingPositionsMaxDistance(...) which does what you want I think (and hope).

Sean