}
// check the population
for (final Genome obj : getPopulation().getGenomes()) {
if (!(obj instanceof NEATGenome)) {
throw new TrainingError(
"Population can only contain objects of NEATGenome.");
}
final NEATGenome neat = (NEATGenome) obj;
if ((neat.getInputCount() != this.inputCount)
|| (neat.getOutputCount() != this.outputCount)) {
throw new TrainingError(
"All NEATGenome's must have the same input and output sizes as the base network.");
}
neat.setGeneticAlgorithm(this);
}