I see. I was confused by the term "neighbor" in the documentation and method name, which I now understand simply means a "location in the grid close to some reference point" rather than any object at any of those locations. I didn't see any method called "getNeighborsAndCorrespondingPositionsMaxDistance" in the ClassDoc, which probably contributed to my confusion. I'll try it. Russ On 8/9/12 4:44 PM, "Sean Luke" <[log in to unmask]> wrote: > 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