Data Structure for Spatial Agent Based Modeling [closed]
What are some good data structures for keeping track of agents in a two-dimensional, spatial simulation? I've seen some references to quadtrees (which I understand) and kd-trees (which I don't understand very well). I'm looking for something through which an agent can efficiently say, "I know my location, and I would like to know which agents are near me (within a certain radius of myself)." Examples (pseudo-code is fine) would be greatly appreciated. I'm working in Java. Well, I'm not sure exactly how it is implemented, but the MASON toolkit uses a discretization algorithm that places agents