swarm-support
[Top][All Lists]
Advanced

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

Re: Problems with Value2dDisplay


From: James Marshall
Subject: Re: Problems with Value2dDisplay
Date: Fri, 31 Jul 1998 15:08:45 GMT

Hi,
  here's all the relevant code from my buildObjects method in my 
observer swarm, as requested by Alex. I hope someone can help me on 
this because I really want to use the results from my Swarm sim in a 
paper I'm currently writing!
        James

-buildObjects
{
  populationColourMap=[Colormap create: globalZone];
  [populationColourMap setColor: 0 ToName: "blue"];
  for (l1=1; l1<=10; l1++)
  {
    [populationColourMap setColor: l1 ToGrey: (double)l1/10];
  }

  populationRaster=[ZoomRaster create: globalZone];
  [populationRaster setColormap: populationColourMap];
  [populationRaster setZoomFactor: (500/[epdSwarm getWorldXSize])];
  [populationRaster setWidth: [epdSwarm getWorldXSize] Height:
  [epdSwarm getWorldYSize]]; [populationRaster setWindowTitle: "EPD
  Population"]; [populationRaster drawSelf]; [populationRaster pack];

  populationDisplay=[Value2dDisplay createBegin: [self getZone]];
  [populationDisplay setDisplayWidget: populationRaster colormap:
  populationColourMap]; [populationDisplay setDiscrete2dToDisplay:
  [epdSwarm getWorldDisplay]]; populationDisplay=[populationDisplay
  createEnd]; [populationDisplay setDisplayMappingM: 1 C: 0];

  return self;
}

> >>>>> "JM" == James Marshall <address@hidden> writes:
> 
> JM> [populationDisplay putValue:
> JM> (long)(((double)localPopulation/maxAgents)*10+1) atX: x Y: y];
> JM> printf("%i\n",(int)[populationDisplay getValueAtX: x Y: y]);
> 
> Can you post the code where you set up your Colormap as well?  I
> suspect that's maybe where you are running into problems.  In fact try
> and post all the relevant bits from your -buildObjects method in your
> ObserverSwarm (assuming that's where you set up your GUI widgets).
> 
> Alex
 
--
James Marshall - Postgraduate Research Student (MPhil/PhD)
Artificial Intelligence Group - Department of Computer and Information Sciences
De Montfort University - Milton Keynes Campus
Web:- http://www.mk.dmu.ac.uk/~jmarshall/

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