this.numberGoodsInLastTournament = 0;
this.numberGoodsInPopBeforeLastSelection = 0;
this.selectionTookPlace = false;
for (AbstractAgent2D<?> r : this.getEnvironment().getAgents()) {
try {
JasmineRobotWithoutMutationRegularSelection jasRob = (JasmineRobotWithoutMutationRegularSelection) r;
if (jasRob.isGood()) {
this.numberGoodsInPopBeforeLastSelection++;
}
} catch (Exception e) {
}
}
if (jasmineList.size() >= tournamentGroesse) {
this.selectionTookPlace = true;
while (jasmineList.size() > tournamentGroesse) {
jasmineList.remove(rand.nextInt(jasmineList.size()));
}
// Gute Agenten in Turnier zählen.
try {
for (Evolvable<AbstractEvolvableAgent2D<AbstractEnvironment2D<?>>> r : jasmineList) {
JasmineRobotWithoutMutationRegularSelection jasRob = (JasmineRobotWithoutMutationRegularSelection) r;
if (jasRob.isGood()) {
this.numberGoodsInLastTournament++;
}
}
} catch (Exception e) {
}