MASON-INTEREST-L Archives

August 2012

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Subject:
From:
Chris Hollander <[log in to unmask]>
Date:
Thu, 9 Aug 2012 13:08:54 -0400
Content-Type:
text/plain; charset=ISO-8859-1
MIME-Version:
1.0
Reply-To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Parts/Attachments:
text/plain (18 lines)
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

ATOM RSS1 RSS2