swarm-support
[Top][All Lists]
Advanced

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

Re: Can a heatbug die?


From: Ken Cline
Subject: Re: Can a heatbug die?
Date: Mon, 4 Aug 1997 13:33:11 -0400 (EDT)

Typically when heatbugs get "too" unhappy, then their Swarm
takes action by scheduling a visit to the heatbug
psychologist, this behavior is implemented in the following
method (see the Heatbug.m file)

    -(void) visitTheShrink: (id) quack at: (timeval_t) t;


Sorry... now for the real answer...

Several swarmers have added death to their simulation.  For
instance in our military model we have a "terminateAgent"
method as well as "isDead" boolean method for confirming the
agent's state.

There are several ways to implement agent death:

       Simple death:
          When an agent dies it just "throws a switch",
          eg isAlive = FALSE.  Then this switch is used to
          suppress the agent's actions where appropriate.
          For example, in Heatbug.m, we could have:

             -step {
                 if ( isAlive == FALSE ) return self;
                     ...
             }

       "Real" death:
          Alternatively, when an agent dies it could
          completely decompose, that is remove any actions
          scheduled for it, remove the agent from any
          lists it is on, and drop the object and any
          sub-objects from the simulation.


The first type of death is much simpler to implement, just
be sure to suppress all interaction between the agent an its
environment (ie you don't want any zombies or ghosts roaming
thru the simulation, right?).  

The second type of death is better programming practice,
that is it removes the objects and frees up memory.  If you
had a long simulation with lots "turn-over" in the
population then "real death" could provide a significant
performance increase.  However, if there is a lot of
"turn-over" and births >= deaths, then you might consider
implementing some way to cache the dead, ie reincarnation.
(I'm not sure what affect instituting reincarnation will
have on the heatbug suicide rate... maybe you could
investigate that?)

Warning: I mentioned "remove the agent from any lists" as if
         this was straight-forward, easy thing to do, but it
         may be quite the opposite.  To get a better idea of
         how to do "death" search the archives with that
         word.

Ken.

PS: We chose to do "simple death" because having all those
    dead bodies lying around served as a reminder to the
    other agents. [grin]

    BTW, if you do decide to do "simple death" in heatbugs
    then consider:

         * what heat value do dead bugs have?

         * do dead bugs occupy space?

         * can a live bug and a dead bug occupy the same
              grid element?

         * how do dead bugs effect the heatspace?

         * do you end the simulation when all the bugs
              are dead?


On Mon, 4 Aug 1997 address@hidden wrote:

> All (and Ken),
> Ok, now that I know how heatbugs would reproduce themselves...would it
> be possible that they commit sucicide if they got too unhappy?
> 
> Thanks,
> Brad.
> 
>                   ==================================
>    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.
>                   ==================================
> 

_________________________________________________________
Ken Cline                             address@hidden
SAIC                                 VOICE (410) 571-0413
Annapolis, MD                          FAX (301) 261-8427


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