|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Problem with adding a chromosome containing values equal zeroHi!
I use the JGAP library. For my optimization problem, I use the DefaultConfiguration and invoke gaConf.setSampleChromosome(sampleChromosome); where sampleChromosome is IChromosome sampleChromosome = new Chromosome(gaConf, new IntegerGene(gaConf, 0, 89), chromeSize); I want the program to add a solution chromosome to the population. I do it this way for genes with allele equal zero: Gene[] genes = new Gene[chromeSize]; for (int i = 0; i < chromeSize; i++) { Gene gene = new IntegerGene(gaConf); Integer integerValue = new Integer(0); gene.setAllele(integerValue); genes[i] = gene; } genotype.getPopulation().addChromosome(new Chromosome(gaConf, genes)); Here is my problem: -If I set the allele value for all genes in the chromosome to zero, I get in the method evaluate() in the input array sometimes a negative entry, namely -1 , although I have configured the value range (0,89) of the genes' alleles. If I add a solution with gene alleles all different from zero, the problem doesn't appear, the evaluate method gets values only from 0 to 89. It does not matter, whether I keep the population size constant or not. Is the described problem a bug in JGAP? Did I implement or understand something wrong? Thank you for your answer. Best wishes, Vladimir Neykov
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ jgap-users mailing list jgap-users@... https://lists.sourceforge.net/lists/listinfo/jgap-users |
|
|
Re: Problem with adding a chromosome containing valuesequal zeroVladimir,
I wonder if you get a -1 as a fitness value or -1 as gene
value. You mentioned an evaluate() method. What is done
there?
Why do you want to add a solution chromosome and when do
you do this (before evolving, during...)?
Best
------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ jgap-users mailing list jgap-users@... https://lists.sourceforge.net/lists/listinfo/jgap-users |
| Free Forum Powered by Nabble | Forum Help |