glob2-devel
[Top][All Lists]
Advanced

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

Re: [glob2-devel] More Map code improvements


From: Bradley Arsenault
Subject: Re: [glob2-devel] More Map code improvements
Date: Wed, 5 Sep 2007 16:44:14 -0400

On 9/5/07, Kai Antweiler <address@hidden> wrote:
> I might look into algorithmic improvements next; I just hope that I've
> understood the purpose correctly. Oh, lookit that, there's some
> documentation on gradients - I'd better go read that then.

We use the words "field", "area" and "circuit" synonymously.

gradient values:
0:     inaccessable area
1:     lowest (real) gradient value
2:     lowest gradient value that can spread to an adjacent area
255: resource (i.e: source of the gradient for a specific resource)
and highest value

We have two gradients for each resource: one for the globs that can swim and one
for those who can't.  Same is true for other gradients

A gradient map is filled with 0's 1's and 255's depending of what kind
of field we are
looking.  The sources (255) we write into a queue.

We pull from the queue a field.  For every adjacent field with
positive gradient value
we check whether its value is at least as high as the value of the
field we pulled
minus 1.  If it is not this value is written to that field an it is
pushed to the queue.
Now, pull the next field.

That is the simplest algorithm.
The others use geometric structures, but of course produce the same result.
--
Kai Antweiler

Ressources aren't the gradients that are causing problems. Those are just two, the building gradients are the ones that cause problems.



--
Extra cheese comes at a cost. Bradley Arsenault.
reply via email to

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