Minor bugfix, synch with MK branch.
This commit is contained in:
parent
2b7303d35c
commit
500366d036
@ -1000,6 +1000,7 @@ public class Population extends ArrayList implements PopulationInterface, Clonea
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Population getBestNIndividuals(int n, int fitIndex) {
|
public Population getBestNIndividuals(int n, int fitIndex) {
|
||||||
|
if (n<=0 || (n>super.size())) n=super.size();
|
||||||
Population pop = new Population(n);
|
Population pop = new Population(n);
|
||||||
getSortedNIndividuals(n, true, pop, new AbstractEAIndividualComparator(fitIndex));
|
getSortedNIndividuals(n, true, pop, new AbstractEAIndividualComparator(fitIndex));
|
||||||
return pop;
|
return pop;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user