Minor bugfix, synch with MK branch.

This commit is contained in:
Marcel Kronfeld 2010-08-23 12:13:28 +00:00
parent 2b7303d35c
commit 500366d036

View File

@ -1000,6 +1000,7 @@ public class Population extends ArrayList implements PopulationInterface, Clonea
*
*/
public Population getBestNIndividuals(int n, int fitIndex) {
if (n<=0 || (n>super.size())) n=super.size();
Population pop = new Population(n);
getSortedNIndividuals(n, true, pop, new AbstractEAIndividualComparator(fitIndex));
return pop;