innovationID + 1);
}
} else if (section.getSectionName().equals("NEAT-POPULATION")
&& section.getSubSectionName().equals("SPECIES")) {
NEATGenome lastGenome = null;
BasicSpecies lastSpecies = null;
for (final String line : section.getLines()) {
final List<String> cols = EncogFileSection
.splitColumns(line);
if (cols.get(0).equalsIgnoreCase("s")) {
lastSpecies = new BasicSpecies();
lastSpecies.setPopulation(result);
lastSpecies.setAge(Integer.parseInt(cols.get(1)));
lastSpecies.setBestScore(CSVFormat.EG_FORMAT.parse(cols
.get(2)));
lastSpecies.setGensNoImprovement(Integer.parseInt(cols
.get(3)));
result.getSpecies().add(lastSpecies);
} else if (cols.get(0).equalsIgnoreCase("g")) {
final boolean isLeader = lastGenome == null;
lastGenome = new NEATGenome();
lastGenome.setInputCount(result.getInputCount());
lastGenome.setOutputCount(result.getOutputCount());
lastGenome.setSpecies(lastSpecies);
lastGenome.setAdjustedScore(CSVFormat.EG_FORMAT
.parse(cols.get(1)));
lastGenome.setScore(CSVFormat.EG_FORMAT.parse(cols
.get(2)));
lastGenome.setBirthGeneration(Integer.parseInt(cols
.get(3)));
lastSpecies.add(lastGenome);
if (isLeader) {
lastSpecies.setLeader(lastGenome);
}
} else if (cols.get(0).equalsIgnoreCase("n")) {
final NEATNeuronGene neuronGene = new NEATNeuronGene();
final int geneID = Integer.parseInt(cols.get(1));
neuronGene.setId(geneID);