bug report

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug report

umut akdemir
bug report:
1. it seems like there is another bug inside Genotype.java inside function evolve():
    // Reset fitness value of genetically operated Chromosomes.
    // --------------------------------------------------------
    int originalPopSize = getPopulation().size();
    int size = getPopulation().size();
    for (int i = originalPopSize; i < size; i++) {
      Chromosome chrom = getPopulation().getChromosome(i);
      chrom.m_fitnessValue = FitnessFunction.NO_FITNESS_VALUE;
    }
Although I am not absolutely sure about this, I strongly believe the originalPopSize initialization was supposed to be just after the first application of natural selectors prior to genetic operators.
 
2. Similar to Chromosome's toString method Genotype's toString Method was also having the exact same problem having the line;
buffer.append(getPopulation().getChromosome(i).getFitnessValue());
I simply deleted that line as a temporary solution. For future consistent solutions though I would suggest changing the function getFitnessValue to be a consistent get without calling of additional functions, it can easily confuse programmers with the well assumed concept of getters and setters.
 
I would also go through all other toString() methods to check if those kinds of symptoms occur again.
 
Thanks,
Umut
Loading...