swarm-support
[Top][All Lists]
Advanced

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

Re: Multiple Value2dDisplay's on a single Raster


From: Ken Cline
Subject: Re: Multiple Value2dDisplay's on a single Raster
Date: Wed, 22 Apr 1998 00:15:06 -0400 (EDT)

On Tue, 21 Apr 1998, Doug Donalson wrote:

> If I understand what you need correctly, I don't think
> you need to subclass.
> 
> Why not create a "cell" object that's id goes into the 2D
> grid.  Set up 3 (or however many) color intensities like
> heatbugs does for red. Let each cell keep track of it's
> type and have the type correlasted with a color.  Say blue
> 0-15 red 16-31 green 32-47. 
>
> I do this and then put all the cells in a list so I can
> display with a "for each" statement.  Also, I am not
> guarenteed that I know the real range of my resource
> (number of agents) so I put a variable into the model
> swarm I would be able to adjust the range real time. I
> also put in a single "maxed-out" value so I could see when
> range adjustments might need to be made.
> 
> For example:
> 
> -drawNumberOfJuvenileRedScale: (Raster *) r
> {
> Color color;
> //Check if cell is being used
>    if( !active )
>       color=34;
> //check if  "maxed-out"
>    else if( numberOfJuvenileRedScale > [myModel getMaxJuvenileRedScale] )
>        color=33;
> //calculate color intensity
>    else
>       color=(Color)((numberOfJuvenileRedScale*32)/
>                                                                    [myModel
> getMaxJuvenileRedScale]);
>    [r drawPointX: x Y: y Color: color-1];
>    return self;
> }
> 
> I don't know whether this addresses your problem or if it's any use but
> for what it's worth...

This also sounds like a good solution.

One (almost philosophical) point would be whether deciding
how to display the values is a property of the cell or some
external object.

Hmmm... this might matter is your display function is
mapping multiple cells to a single pixel, ie contraction
mapping.

One potential problem that I have is handling large data
sets with different resolutions.  In this case, the cell
size would have to accomodate the highest resolution, which
pushes up the memory requirements.  Currently though, we are
just using one large data set, but it does have different
resolutions along each axis.

BTW, because of the resolution problem, I've choosen to
communicate between objects using only distances (measured
in meters) from a fixed point.  However, this means the
agents don't know where in the grid they're stored nor
where on the rasters to draw themselves.  I not saying they
can't figure that stuff out, in fact they do.  However, I
might argue that maybe they shouldn't care. But, yet again,
I've digressed from the issue at hand...

Later,

Ken.


_________________________________________________________
Ken Cline                             address@hidden
SAIC                                 VOICE (410) 571-0413
Annapolis, MD                          FAX (301) 261-8427


                  ==================================
   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]