Re: [jgap-users] Problem with CrossoverOperator
Brought to you by:
klausikm
From: Klaus M. <jg...@kl...> - 2008-01-22 17:20:29
|
Zahir, thanx a lot for your clarification and correction! I think WeightedRouletteSelector needs some adaption. Or even better: JGAP should be restructured to keep the cloning issue and other things like this away from the selectors. Best Klaus www.klaus-meffert.com > -----Original Message----- > From: Zahir Bishnani [mailto:zbi...@al...] > Sent: Monday, January 21, 2008 6:55 PM > To: 'Klaus Meffert'; jga...@li... > Subject: RE: [jgap-users] Problem with CrossoverOperator > > Hi Klaus, > > Thanks for the quick fix. I just gave it a try but it didn't > work! I couldn't see where it actually calls isXoverNewAge()... > > I changed line 76 from: > > if (chrom1.getAge() < 1 && chrom2.getAge() < 1) { > > to: > > if (!isXoverNewAge() && chrom1.getAge() < 1 && > chrom2.getAge() < 1) { > > and now it works... > > > Also, WeightedRouletteSelector uses a cloned chromosome only > if it has been selected already for the new population. If > not, it just uses the old instance. So Crossover did work > occasionally but not correctly. > > Cheers, > > Zahir. > > > -----Original Message----- > From: Klaus Meffert [mailto:jg...@kl...] > Sent: 20 January 2008 09:49 > To: 'Zahir Bishnani'; jga...@li... > Subject: RE: [jgap-users] Problem with CrossoverOperator > > Zahir, > > good information detail! I could not see why > WeightedRouletteSelector shouldn't use cloning, I think it > does (maybe in an older version it does not). > However, I enhanced class Crossover and checked it in to CVS. > Now you can either use a new constructor with parameter > a_xoverNewAge. Or you can use > setXoverNewAge(true) after constructing your configuration. > In case you use a DefaultConfiguration, please proceed as > shown, e.g., in class DynamicMutationExample, where default > genetic operators are replaced or reconfigured. > > Best > > Klaus > www.klaus-meffert.com > > > > -----Original Message----- > > From: jga...@li... > > [mailto:jga...@li...] On Behalf > Of Zahir > > Bishnani > > Sent: Friday, January 18, 2008 8:02 PM > > To: jga...@li... > > Subject: [jgap-users] Problem with CrossoverOperator > > > > Hi, > > > > I'm having a problem with CrossoverOperator. Using the > > DefaultConfiguration I can't get it to function. > > > > After applying the BestChromosomesSelector, all current chromosomes > > copied across to the next generation have their age reset to 0. It > > appears they are being cloned to new ones. > > > > CrossoverOperator.select() then ignores all these newly created > > chromosomes under the assumption that it is not beneficial to > > crossover new ones. > > > > This cloning doesn't occur when using a WeightedRouletteSelector so > > crossover does work here. > > > > I also noticed a problem with setPreservFittestIndividual > as mentioned > > in a previous mail. > > > > Cheers, > > > > Zahir. > > > > ------------------------------ > > > > Message: 8 > > Date: Thu, 10 Jan 2008 14:18:28 -0500 > > From: "Oscar Miguel Alonso M" <oma...@gm...> > > Subject: [jgap-users] Problem with setPreservFittestIndividual > > To: jga...@li... > > Message-ID: > > <35c...@ma...> > > Content-Type: text/plain; charset=ISO-8859-1 > > > > Hello!! > > > > I had problems with the option setPreservFittestIndividual() of the > > Configuration class. Although I set it to true, sometimes > the fitness > > of the fittest individual decreases from one generation to the next > > one. I browsed the source code and I think that there is a > bug in the > > class GABreeder, in line 45. > > > > It is > > > > fittest = pop.determineFittestChromosome(0, originalPopSize - 1); > > > > and I think it should be > > > > fittest = pop.determineFittestChromosome(0, pop.size() - 1); > > > > because the fittest individual is added by the breeder at > the end of > > the population, and the current population size may be greater than > > the one defined in the configuration. > > > > Manually adding the fittest individual at the beginning of the > > population solved my problem. Please tell me if I am right > or if there > > is a better way of ensuring that the best individual is > preserved for > > the next generation. > > > > Best regards, > > Oscar M > > > > > > > > ------------------------------ > > > > -------------------------------------------------------------- > > ----------- > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for just about anything > > Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.n > > et/marketplace > > > > ------------------------------ > > > > _______________________________________________ > > jgap-users mailing list > > jga...@li... > > https://lists.sourceforge.net/lists/listinfo/jgap-users > > > > > > End of jgap-users Digest, Vol 19, Issue 1 > > ***************************************** > > > > > > ______________________________________________________________ > > __________ > > Alaric Systems Ltd. Registered in England No. 3314005 Registered > > Office: > > 108 Linton House, 164-180 Union Street, London SE1 0LH > > > > ______________________________________________________________ > > __________ > > This e-mail has been scanned for all known viruses by Star. > > The service is powered by MessageLabs. > > > > -------------------------------------------------------------- > > ----------- > > This SF.net email is sponsored by: Microsoft Defy all challenges. > > Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > jgap-users mailing list > > jga...@li... > > https://lists.sourceforge.net/lists/listinfo/jgap-users > > > > ______________________________________________________________ > __________ > Alaric Systems Ltd. Registered in England No. 3314005 > Registered Office: > 108 Linton House, 164-180 Union Street, London SE1 0LH > > ______________________________________________________________ > __________ > This e-mail has been scanned for all known viruses by Star. > The service is powered by MessageLabs. |