Cosmetics (synch with MK branch)
This commit is contained in:
parent
1220e81039
commit
24e57f68ed
@ -1005,6 +1005,24 @@ public class Population extends ArrayList implements PopulationInterface, Clonea
|
|||||||
return pop;
|
return pop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method returns the n current worst individuals from the population, where
|
||||||
|
* the sorting criterion is delivered by an AbstractEAIndividualComparator.
|
||||||
|
* There are less than n individuals returned if the population is smaller than n.
|
||||||
|
* If n is <= 0, then all individuals are returned and effectively just sorted
|
||||||
|
* by fitness.
|
||||||
|
* This does not check constraints!
|
||||||
|
*
|
||||||
|
* @param n number of individuals to look out for
|
||||||
|
* @return The m worst individuals, where m <= n
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public Population getWorstNIndividuals(int n, int fitIndex) {
|
||||||
|
Population pop = new Population(n);
|
||||||
|
getSortedNIndividuals(n, false, pop, new AbstractEAIndividualComparator(fitIndex));
|
||||||
|
return pop;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns a clone of the population instance with sorted individuals, where
|
* This method returns a clone of the population instance with sorted individuals, where
|
||||||
* the sorting criterion is delivered by a Comparator.
|
* the sorting criterion is delivered by a Comparator.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user