[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swarm-Support] Heatbug code question
From: |
Doug Donalson |
Subject: |
Re: [Swarm-Support] Heatbug code question |
Date: |
Sun, 14 Nov 2004 21:48:41 -0500 |
It actually makes a bit of sense that the cell does the work. A bug moves
around the space at random. It would be quite inefficiant to have to update
the bug with new neighbor cells at each time instance. It is much easier to
just initialize each cell with its neighbors and then share the results with
visiting bugs. The real question that should be asked, and it may be your
actual question, is whether a "bug" can have immediate knowledge of the
characteristics of all the surrounding cells simply by asking its present
cell or whether it should actually have to physically (virtually?) visit the
cells to know what their "environment" is like. That has to be decided
depending on what you are actually simulating. I would assume that a drop
of water would generally follow the steapest path and so it would not need
to visit all surrounding cells. It would just "ask" its present cell for
the neighbow cell with the lowest elevation adn move htere. In contrast, I
am working on a simulation of an endangered bird right now and my present
grid/cell size is 500X500 meters (the resolution of my hydrology map).
Because this is a large spatial scale compared to how the birds view their
environment, the sparrows must actually move into a neighbor cell before
they can determine its characteristics. However, they do get the "address"
of the new cell from their present cell.
For what it's worth,
Doug Donalson
----- Original Message -----
From: "Crile Doscher" <address@hidden>
To: <address@hidden>
Sent: Sunday, November 14, 2004 7:52 PM
Subject: [Swarm-Support] Heatbug code question
Hi there,
This question relates to the logic of the Heatbug code, specifically why
a method is
implemented where it is. If that sounds like you, read on!
I'm putting together a simulation of braided rivers where water objects
(originally
called drops until I realised that that name was special...) flow over a
river bed and find
their way by moving in the direction of the steepest slope. I've been
paying attention to
how Heatbug implements bug movement and wonder why it is that the actual
method
that looks at the eight cell neighbourhood around a particular cell
(findExtremeType) is
implemented in HeatSpace.m rather than in Heatbug.m. The Heatbug then
determines
which cell it will move to, but HeatSpace does the work of figuring out
which cell would
be the best to move to. This is part of the process of getting my head
around Objective
C. Any thoughts? Thanks -
Crile
Dr Crile Doscher
Natural Resources Engineering
Lincoln University
New Zealand
_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support