glob2-devel
[Top][All Lists]
Advanced

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

Re: [glob2-devel] Pheramonal-Directional Algorithm


From: Andrew Sayers
Subject: Re: [glob2-devel] Pheramonal-Directional Algorithm
Date: Tue, 8 Nov 2005 19:10:15 +0000
User-agent: Mutt/1.5.11

On Mon, Nov 07, 2005 at 04:06:41AM -0500, Andrii Zvorygin wrote:
(snip)
> 
>    (12*2)*128^2+(2*4*9)*(128^2/2)
>    we have a result of 983 040
>    1.0 MB

Remember that the figure of 12 bytes for an empty vector is not
portable.  It's very likely that different implementations (even future
or past versions of GCC) will have larger or smaller values.

>    now if we decide to have non-directional pheramones as well (to indicate
>    danger zones and length of time since last viewing) then we can have that
>    in the following way
>    vectorOfTeams<type[2]> nonDirectionalPheramones
>    so if it's initalized it will have both types put there
>    so
>    12*128^2+1*128^2
>    which is 212 992
>    so 0.2 MB

Why not bundle these together with the directional pheramones?  There's
already a vector of information for each team, for each square on the
map.  You only need add variables to the structure:

class TeamCellData
{
        // ...
        Phearmone directionalPheramones[4];
        Pheramone nonDirectionalPheramones[2];
}

Also, how do you intend to handle globs that can/can't swim?  Obviously,
trails that cross water can't be followed by non-swimming globs, but
globs that can swim won't necessarily swim during a particular
expedition, and could lay down a non-swim trail if they wanted.

        - Andrew




reply via email to

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