swarm-support
[Top][All Lists]
Advanced

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

[Swarm-Support] How to prevent sending a message to a dropped object?


From: martijn cox
Subject: [Swarm-Support] How to prevent sending a message to a dropped object?
Date: Mon, 1 Aug 2005 17:03:19 +0200

Hi,

Im new here so if I break any form of etiquette, please forgive me :)

I've been working on a (very simple) swarm-based simulation of evolution,
and have come accross the following problem. Female animals can have babies,
after impregnation by a male. This impregnation is a combining of the neural
networks of the parents, and this new neural network is stored in the
female. during here. During her pregnancy, the female can die, and carry her
unborn child with her (*sob*).

The problem is, that I'd like to have the pregnancy scheduled by the model
by the following ActionCreateTo:
--------------------------------------------
-scheduleBirthFromMother: (id) mother__
{
*snip*
[lifeMutationSchedule at: (time + (int) ( 0.25 * DAYSPERYEAR *
MINUTESPERDAY ))
   createActionTo: mother__
   message: M(haveChild)];
*snip*
}
--------------------------------------------
and if the female dies somewhere between impregnation and giving birth, this
message is send to a voided reference (because the female has long and gone
been dispatched of by a reaperQueue).
The final result is that every call subsequent call to create sends my
program crashing to its segmentation faulty damnedness, I presume because a
method has been called on with self = nil and as a consequence, the stack
has become corrupt.

A short term solution I've been using so far, is to not wipe the
reaperqueue, but keep all agents in cryostatis for the length of the
simulation (so the speak). Another solution would be to undo the
ActionCreateTo, but I see no way in all documentation I've searched through
how this can be done.

If no one can help me, I will probably resort to waiting untill after the
message has been sent to the dead agent before I wipe it from memory, but I
don't think that would be a very clean solution.

Kind regards,

Martijn Cox

ps: my gratitude for supplying the incredibly usefull environment to anyone
who has ever contributed to swarm! :)


reply via email to

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