[galib] Ellitism

Zyed Bouzarkouna bouzarkouna.zyed at gmail.com
Tue Mar 17 19:10:58 EDT 2009


Hi Michael,

The java code can be downloaded from:
http://sourceforge.net/projects/java-galib/

Best Regards,
Zyed


On Tue, Mar 17, 2009 at 9:29 PM, Kupfer, Michael (ARC-TH)[San Jose State
University Foundation] <michael.kupfer at nasa.gov> wrote:

>  Hello Zyed!
>
>
>
> I read you’re using the Java version of GAlib? Where did you get it from?
> Is it an exact representation of the C++ version (could I translate my C++
> code 1-1 into Java)?
>
>
>
> Best,
>
> Michael.
>
>
>
> *From:* galib-bounces at mit.edu [mailto:galib-bounces at mit.edu] *On Behalf Of
> *Zyed Bouzarkouna
> *Sent:* Tuesday, March 17, 2009 9:13 AM
> *To:* galib at mit.edu
> *Subject:* Re: [galib] Ellitism
>
>
>
> Thanks Robert for your reply.
> In fact, I'm using The java version of GALib.
>
>         //Elitism--fittest chromosome automatically go on to next gen (in 2
> offspring)
>
>
> this.chromNextGen[iCnt].copyChromGenes(this.chromosomes[this.bestFitnessChromIndex]);
>         iCnt++;
>
>
> this.chromNextGen[iCnt].copyChromGenes(this.chromosomes[this.bestFitnessChromIndex]);
>         iCnt++;
>
> And here I don't see any reason to put it twice especially since we don't
> allow any mutation on the best indiv.
>
>  On Tue, Mar 17, 2009 at 4:56 PM, Robert Burbidge <rvb at aber.ac.uk> wrote:
>
> On 17 Mar 2009, at 15:35, Zyed Bouzarkouna wrote:
>
> I was wondering why to apply elitism, GALib choooses the fittest chromosome
> to go automatically to next gen in 2 offspring.
> I don't see why the fittest is put twice in the next generation?
>
>
>
> Hi Zyed,
>
> I assume you are using a simple GA as elitism doesn't make sense for a
> steady state or incremental GA. The relevant code snippet is:
>
> >>>>>>>>
> void
> GASimpleGA::step()
> {
> ...
> // If we are supposed to be elitist, carry the best individual from the old
> // population into the current population.  Be sure to check whether we are
> // supposed to minimize or maximize.
>
>  if(minimaxi() == GAGeneticAlgorithm::MAXIMIZE) {
>    if(el && oldPop->best().score() > pop->best().score())
>      oldPop->replace(pop->replace(&(oldPop->best()), GAPopulation::WORST),
>                      GAPopulation::BEST);
>  }
>  else {
>    if(el && oldPop->best().score() < pop->best().score())
>      oldPop->replace(pop->replace(&(oldPop->best()), GAPopulation::WORST),
>                      GAPopulation::BEST);
>  }
> ...
> }
> <<<<<<<<<<
>
> We can see that the best individual from the old population replaces the
> worst individual in the current population, provided that it is better than
> the best individual in the current population. This only results in one copy
> of the best in the current population.
>
> It is of course possible to obtain more than one copy of the best through
> selection if it happens that it is not crossed over or mutated. Try running
> with pcross = 1.0 and you should only see (at most) one copy of the best in
> the next generation with elitism (except for the hopefully rare case where
> the crossover has no effect).
>
> Rgds,
> Robert
>
>
>
>
> --
> Zyed Bouzarkouna
>
>
>



-- 
Zyed Bouzarkouna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20090318/17df4202/attachment.htm


More information about the galib mailing list