swarm-support
[Top][All Lists]
Advanced

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

Re: Implementing vision in Swarm


From: Randall Gray
Subject: Re: Implementing vision in Swarm
Date: Thu, 14 Nov 96 21:42:34 EDT

[Concerning Alex's "Bugverse"]

I know that this doesn't exactly answer to Alex's question(s), but it
*is* somehow relevant.

I've implemented something somewhat like what he describes, though not
in swarm.  Our program simulated a simple marine ecosystem with an
environment made up of bathymetry, temperature, and a "contaminant".
The simulated organisms were of several varieties and the big fish
preyed on the smaller fish (and so ad infinitum).  

I found that the most expensive parts of the whole thing were the
"hill climbing" to evade inhospitable environments and searching for
prey or predators.  I made the (brutal) decision that to speed up the
hill climbing each entity could move one of four directions (based on
the most favourable gradient) but the orientation of those four with
respect to the compass was randomised at each step.  Thus, I replaced
arbitrarily many calls to "calculate the environmental gradient in
this direction" with "generate a random angle".  Made a huge
difference, and (I hope) didn't degrade the simulation too badly.

With respect to searching for neighbours, I restricted the search to
n nearest neighbours (the list of beasties was kept sorted on one of
the ordinates).  Helped some, but it was still expensive.  If anyone
knows a really good way of dealing with such things, I'd happily
grovel for a hint.

"Vision" per se is really a matter of some probability function based
on distance, environment, the length of the time step and the nature
of the bugs.

Ah, yes.  Our model worked in "double^3" rather than "int^2" -- there
was just no way to do what we wanted in a strongly pixelated
universe since the scales of movement in the various species we
simulated were grossly different.

Our model was almost finished when swarm started hitting beta sites --
bit of a shame we were inventing another round wheel, but then ours is
a paddle wheel rather than a tyre ;-)

BTW: where are you?

Cheers from Tassie,

        Randall


reply via email to

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