The patch has been committed in r1310103, together with other changes that have been outlined before.
Additionally, I have added two new methods:
- public void addChromosomes(Collection<Chromosome> c)
- protected List<Chromosome> getChromosomeList()
and made setChromosomes deprecated.
The internal state of ListPopulation shall be protected, and shall not be changeable from the outside as it was possible before. When adding chromosomes, the entries are added to the internal list, instead of setting the internal list reference to the provided list.
Derived classes can get access to the internal list via getChromosomeList (we could also make the internal list protected, is there a policy in CM?).
The setters throw appropriate exceptions to keep the internal state consistent, and addChromosome also throws an exception if the population would exceed the population limit.