GMUEClab / ecj

ECJ Evolutionary Computation Toolkit
http://cs.gmu.edu/~eclab/projects/ecj/
123 stars 42 forks source link

SimpleBreeder array bug #11

Closed SigmaX closed 6 years ago

SigmaX commented 6 years ago

Jorge Gomes jorgemcgomes@gmail.com writes:

In SimpleBreeder, in breedPopChunk, when shouldBreedSubpop(...) is false, it goes wrong -- ArrayOutOfBoundsException. The problem is that it tries to use list.set(...) on an empty arraylist. This kind of implementation made sense with arrays (as in ECJ24), but does not work with lists.

Sean suspects that the line

newpop.subpops.get(subpop).individuals.set(ind, state.population.subpops.get(subpop).individuals.get(ind));

should set on the putHere variable instead of newpop.subpops.