swarm-support
[Top][All Lists]
Advanced

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

heatbug copy method and happyspace concept...


From: bleydorf
Subject: heatbug copy method and happyspace concept...
Date: Thu, 07 Aug 1997 10:27:53 -0400

(Note: I apologize for the rambling-ness of this email, as I wrote it I
kept thinking of one more thing to ask...)

All,
I did look into the archives and found the discussion thread "copying
protocols and ravioli", and saw the code snipet:

- copy: aZone
{
return [aZone copyIVars: self];
}

If I stick this in heatbug.m and call it in the -step method, or just
put it in a "if statment like:
if (unhappiness < 0.05) {
return [aZone copyIVars: self];
}

Would that work?  To make a functioning copy of a bug?  Am I making a
copy of a "aZone", instead of a "bug"?  What does "copyIVars:" do? (I
would assume copy instance variables), but it still doesnt seem clear to
me...Would I need to point heatbug at any other "core" library to get
these to work?

I was under the impression that the zones were memory space where all
the bugs lived, but, this implies (if Im grasping it right) that each
bug has its own "zone"?  

At this point, I'm just looking for the quickest way to get a bug to
copy itself.  

I will be coming home around 2-3 to check my email again, and then go
back to work..., so if possible reply by then...I hate to put a deadline
on your free help, but unfortunately, its getting down to the wire.  I
haven't even approached the happyspace stuff yet, but probably will give
that a try today...

Questions related to happyspace:
I see in HeatbugObserver that it calls (in the heatDisplay portions) 
[heatDisplay setDiscrete2dToDisplay: [heatbugModelSwarm getHeat]];

And in HeatbugModel the only mention to getHeat is:

-getHeat { return heat; } 

How does this get heat?  I would assume that I would do the equivent for
the happy space,
have a function in Model which would poll each bug for there unhappiness
level (and x/y coordinates), and give that info to Observer so it could
convert each happiness level to a color gradiation, and plot that
happiness level at the bug's x and y.

Another question: It draws the heat and the heatbugs in the same
window...what parts do I need to have a seperate window just for
happiness, you can just say like:
worldRaster = [....

...

heatbugDisplay =[heatbugDisplay createEnd];  

You dont need to include everything in between.  (unless something is
critical in between)

Thanks again for all your help,

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


reply via email to

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