swarm-support
[Top][All Lists]
Advanced

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

Re: "zone" or "getZone"? and one additiona question.


From: Jae Chan Oh
Subject: Re: "zone" or "getZone"? and one additiona question.
Date: Sat, 15 Mar 1997 14:05:33 -0500 (EST)

> 
> joh> (1) In an older version of GA lib. by Merelo, they use "zone" for
> joh> the argument for createBegin. i.e. as follows: gen =
> joh> [BinChromosome createBegin: zone];
> 
> joh> Instead, I would like to use: gen = [BinChromosome createBegin:
> joh> [self getZone]]
> 
> joh> What are the differences? (I'm using "zone" for my current
> joh> version since I'm using old version of GA lib but...)
> 
> jmerelo> That's probably the correct way of doing it now. I don't
> jmerelo> think there is a big difference, though, as far as zone =
> jmerelo> [self getZone].
> 
> Just to add to JJ's comments.  When "zone" is used, it means
> that there's been some variable (zone) that points to a valid
> zone in which you may allocate new things.  We've been leaning
> away from doing that because it distances the programmer from
> where that varialble was set, making it difficult to keep track
> of which zone it actually points to.  So, using [self getZone]
> is more "Swarm-Style."  However, I'd like to point out that 
> each [self getZone] *is* another message call and carries with
> it the respective overhead.  So, it might be wise to have, say
> inside an agent, something called "zoneImIn" that can be used.
> (Mind you, I picked "zoneImIn" instead of something dangerous
> like "myZone" so that the coder can delineate easily between
> zones owned and operated by the agent and the zone in which the
> agent sits.)
> 

Hi,
Thanks for clarifying that. There's one thing that has been bothering me 
though.I have read swarm doc. couldn't find satisfactory answer.

In my Model Swarm, I create Person swarm initially -- say 10 of them.
This time, I use,  person = [Person createBegin: [self getZone]];
notice that here, "self" is model swarm.

Then when I create Person swarm on-the-fly, say by mating, I do that
in Person swarm. This time I use:
         child = [Person createBegin: createBegin: [self getZone]];

Now notice that "self" is person swarm.

This seems to introduce inconsistancies that some person swarm are created
by sending message getZone to model swarm, and some are created by sending
the message to person swarm. Is it a problem or does it matter?


My sencod question is related the "death in swarm".
To intorduce death, in swarm, one of the suggestions in the swarm mailing list 
archive suggest to use a reaperQueue. Now do you think I would need to do that
for birth as well? What I'm doing now is to create new child within Person
swarm and add the child to the list of Person within Person swarm.
Now, I could create a queue, say birthQueue, and do the similar things
as in the case of death. i.e. add the new borns to the birthQueue but
do not add it to the list of Person yet. Then when model swarm takes over,
it add all new borns from birthQueue to the list of Person.
Which method do you recommend?
May be what I'm doing now causes all inconsitencies and core dump since
I'm modifying the list of Person without letting Model Swarm know about it.





reply via email to

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