Elitism bug
Closed this issue · 1 comments
Sean wrote:
ECJ 24 traditionally handled elitism by copying the elites to the TOP of the individuals array. It did this first (I think for no good reason) before breeding the rest of the population in the bottom of the array.
ECJ 25 still loaded elites first in its code; but now in the code (modified by Ermo) in SimpleBreeder.loadElites(...), it's using add() rather than set(), so it loaded them to the bottom of the array, and the new individuals got added above them. However in SPEA2 it was using set() to try to set them to the top of the array and that wouldn't work. I modified it so it's adding as well.
But I don't know if SPEA2 elitism is working right though it doesn't bomb any more. For example, qv.params doesn't appear to be optimizing. I need someone to go through the SPEA2 breeder code and verify that it's working as expected. Siggy maybe? Just go through the breeder and compare against known SPEA2 algorithmic description -- you can use the one in my book. And I need someone (Dave?) to compare the 24 results with the (current) 25 results for various moosuite params file, including qv.params.
Another place where loadElites is used is in coevolution. I think that one may be broken. I will try to look at that, as the coevolution code is complex.
Overall I note a number of uses of set() in ECJ that may not be valid and might need to be replaced with add(). Grep reveals the following instances. I need someone (Ermo maybe?) to go through these and see if any of them look problematic.
Sean
individuals.set(x-1, queue[i]);
./coevolve/CompetitiveEvaluator.java
previousPopulation.subpops.get(i).individuals.set(j, (Individual)(state.population.subpops.get(i).individuals.get(j).clone()));
./coevolve/MultiPopCoevolutionaryEvaluator.java
state.population.subpops.get(i).individuals.set(j, previousPopulation.subpops.get(i).individuals.get(j));
./de/DEEvaluator.java
state.population.subpops.get(subpops[i]).individuals.set(counts[subpops[i]]++,inds[i]);
./eval/Slave.java
state.population.subpops.get(x).individuals.set( indices[y] ,immigrants[x][y]);
./exchange/InterPopulationExchange.java
individuals.set(indices[y],mailbox.immigrants[x][y]);
./exchange/IslandExchange.java
newpop.subpops.get(subpop).individuals.set(ind, state.population.subpops.get(subpop).individuals.get(ind));
./simple/SimpleBreeder.java
newpop.subpops.get(subpop).individuals.set(ind, (Individual)(state.population.subpops.get(subpop).individuals.get(ind).clone()));
./spatial/SpatialBreeder.java
population.subpops.get(subpop).individuals.set(deadIndividualIndex, ind);
./steadystate/SteadyStateEvolutionState.java