final List<NEATNeuron> neurons = new ArrayList<NEATNeuron>();
for (final Gene gene : getNeurons().getGenes()) {
final NEATNeuronGene neuronGene = (NEATNeuronGene) gene;
final NEATNeuron neuron = new NEATNeuron(
neuronGene.getNeuronType(), neuronGene.getId(), neuronGene
.getSplitY(), neuronGene.getSplitX(), neuronGene
.getActivationResponse());
neurons.add(neuron);
}
// now to create the links.
for (final Gene gene : getLinks().getGenes()) {
final NEATLinkGene linkGene = (NEATLinkGene) gene;
if (linkGene.isEnabled()) {
int element = getElementPos(linkGene.getFromNeuronID());
final NEATNeuron fromNeuron = neurons.get(element);
element = getElementPos(linkGene.getToNeuronID());
if( element==-1 ) {
System.out.println("test");
}
final NEATNeuron toNeuron = neurons.get(element);
final NEATLink link = new NEATLink(linkGene.getWeight(),
fromNeuron, toNeuron, linkGene.isRecurrent());
fromNeuron.getOutputboundLinks().add(link);
toNeuron.getInboundLinks().add(link);
}
}
NEATNetwork network = new NEATNetwork(inputCount,