swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Real Space


From: Sven N. Thommesen
Subject: Re: Real Space
Date: Wed, 11 Apr 2001 13:42:44 -0500

At 01:10 PM 4/11/2001 -0500, you wrote:
"Marcus G. Daniels" wrote:
> One way to avoid having agents reason in absolute space is to have all
> agents inherit from an abstract base class that does these collection
> procedures in one place, e.g. a getNeighbor (radius), method.  That
> way you can hide the coordinate system of the space from the derived
> classes.

"Darren Schreiber" wrote:
"While I illustrate that with the canvas and graph, the search of the
space is
done by parsing through the lists of agents and is independent of the
display issues."

Suppose I wanted to create a Grid2dContinous class, with basically the
same interface as Grid2d, except inside there I want to use a "better
faster" collection object into which the objects are placed.  I want to
more quickly find all agents within r units of (x,y).
getNeighbor(radius) is terribly slow if it has to cycle through a whole
list of agents (as Darren can probably testify).
At least, we want to take some subset of the agents before checking if
they are within r units.

If I remember correctly, what I did in my old SvenSpaces was to pre-load each cell with a list of pointers to cells within a given radius of the current cell. Only useful if the neighborhood size (vision length) is a fixed parameter for the simulation, obviously. And we trade memory for speed, as usual.

Sven


                 ==================================
  Swarm-Support is for discussion of the technical details of the day
  to day usage of Swarm.  For list administration needs (esp.
  [un]subscribing), please send a message to <address@hidden>
  with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]