swarm-support
[Top][All Lists]
Advanced

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

Re: [Swarm-Support] Button Problem


From: Paul E Johnson
Subject: Re: [Swarm-Support] Button Problem
Date: Wed, 09 Apr 2003 17:42:45 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020918

Dear Patrick

This is an interesting problem and I have not done this, but I believe something like this would work.

I think you need a separate class that might be called "ProbeMaker". The ProbeMaker would be created and be informed about all the grids.

Create a ProbeMaker object, and write an "makeProbeAtX:Y:" method in there, then have it sort though the grids to find whichever object you think you need.

the button would be set like

 [worldRaster setButton: ButtonRight
                Client: probeMaker
 Message: M(makeProbeAtX:Y:)];


luo pi wrote:
Hi! With Swarm, I want to carry out the following problem:
there are three kinds of individual---red, yellow and
green, each 50, scattering uniformly in the space at
the beginning.  In the simulation process, the number
of red individual decreases, yellow one increases, and
each kind individual will aggregate together.

First, I let three individuals live in a world, and
use the same worldRaster, but I find that the
increased yellow one can not be seen in worldRaster,
whereas in the yellowList, the number of yellow one
increased. However, red one is normal.
Then I let them live in three worlds, and also use the
same worldRaster, the above problem can be solved, but
I get a new trouble, looking at the following source
code:

individualredDisplay = [Object2dDisplay createBegin:
self];
  [individualredDisplay setDisplayWidget:
worldRaster];
individualredDisplay = [inindividual1Display
createEnd];
[worldRaster setButton: ButtonRight
               Client: individualredDisplay
Message: M(makeProbeAtX:Y:)];
individualyellowDisplay = [Object2dDisplay
createBegin: self];
  [individualyellowDisplay setDisplayWidget:
worldRaster];
individualyellowDisplay = [inindividualyellowDisplay
createEnd];
[worldRaster setButton: ButtonRight
               Client: individualyellowDisplay
Message: M(makeProbeAtX:Y:)];
…
I find that with mouse right button in the
worldRaster, only the information of individualyellow
can be gotten, but individual1 can not. If delete the
setButton command of individualyellow, individualred
can.
Some persons tell me a few days ago, let them use the
different wolrdRaster. I try it, it is okey! Whereas I
can see three worldRasters in the screen, which
possess their own individual. However, I hope them
stay in the same worldRster.

This problem bothers me a lot. Maybe someone can give
me a whole solution or some advices.
Thank you very much!
Patrick.L



--
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ku.edu/~pauljohn
1541 Lilac Lane, Rm 504
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66044-3177           FAX: (785) 864-5700



reply via email to

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