Subject: | |
From: | |
Reply To: | |
Date: | Thu, 9 Aug 2012 13:08:54 -0400 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
So, I'm not sure if this is a bug or intended... and it's been around
for a LONG time, so it might be fixed already on the SVN... but when
you call getNeighborsMaxDistance with a sufficiently large distance
(say, the size of the grid width or height), you get duplicates in the
returned bag.
So if I have 10 agents with a unique ID 1, 2, .. 10 on a 10x10 grid
and I call getNeighborsMaxDistance with a radius of 10, I'll get back
a bag that has multiple copies of each agent... which means I can't
exactly iterate over the raw bag. Of course, this is easy enough to
handle by simply dumping all the elements in the bag in to a set, but
should that have to be done? Shouldn't the returned list of neighbors
be guaranteed to not contain duplicates?
Christopher Hollander
University of Central Florida
|
|
|