* {@inheritDoc}
*/
@Override
public int performSelection(final Random rnd, final Species species) {
int bestIndex = rnd.nextInt(species.getMembers().size());
Genome best = species.getMembers().get(bestIndex);
BasicEA.calculateScoreAdjustment(best, this.trainer.getScoreAdjusters());
for (int i = 0; i < this.rounds; i++) {
final int competitorIndex = rnd.nextInt(species.getMembers().size());
final Genome competitor = species.getMembers().get(competitorIndex);
// only evaluate valid genomes
if (!Double.isInfinite(competitor.getAdjustedScore())
&& !Double.isNaN(competitor.getAdjustedScore())) {
BasicEA.calculateScoreAdjustment(competitor,
this.trainer.getScoreAdjusters());
if (this.trainer.getSelectionComparator().isBetterThan(
competitor, best)) {
best = competitor;