swarm-support
[Top][All Lists]
Advanced

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

Re: Agent Death in Java


From: Marcus G. Daniels
Subject: Re: Agent Death in Java
Date: 20 Jul 2000 10:46:25 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "B" == Benedikt Stefansson <address@hidden> writes:

B> If killing an agent is what you want you need to send the agent a
B> drop message and remove him from the linked list - otherwise when
B> the schedule iterates over the collection it will hit a null; do
B> the drop before the beginning of a time step, it is often easiest
B> to create a 'reaper list' which collects the agents due to die
B> during a timestep and then drops them all in an orderly fashion.

I've updated the SDG example to show exactly how Benedikt's suggestion
plays out.  The Organization class has the reaper queue, and all
subclasses of Agent2d can put things on it by calling `remove'.

`remove' takes the agent out of the space, informs the Organization it
is about to say goodbye (by scheduling a cleanup event for the next
timestep), and then Blammo!

  ftp://ftp.swarm.org/pub/swarm/src/users-contrib/eval/SDG-0.1.tar.gz

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