swarm-support
[Top][All Lists]
Advanced

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

Birth/Death


From: glen e. p. ropella
Subject: Birth/Death
Date: Tue, 12 Nov 1996 10:01:11 -0700

Steve, 
It was pointed out to me that you might be asking a simpler question
about passing pointers instead of birth/death in general.

All you have to do to is put a method in your bugs similar to:

   -setPreyList: (id) aListPointer {
       theListImOn = aListPointer;
       return self;
    }

where "theListImOn" would be declared in the bug with something like:

   id theListImOn;

Execute the setPreyList in the ModelSwarm when the bugs are created.
Then when you want to send a message to the list, it would take the
form:

  [theListImOn addFirst: child];


CAUTION:  This will allow your bugs to manipulate
the list.  However, if you're using an actionGroup with
an action on it of the form:

    [modelActions createActionForEach: preyList message: M(step)];

And one of the bugs on that list removes itself, this could
result in schedule problems.

But, in general, it's OK to pass the bugs a pointer to things
defined in the ModelSwarm.

glen


reply via email to

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