lis-epfl / robogen

RoboGen - Robot generation through artificial evolution
http://www.robogen.org
GNU General Public License v3.0
27 stars 16 forks source link

Incorrect position stored for hidden neurons #51

Closed ElteHupkes closed 9 years ago

ElteHupkes commented 9 years ago

In Robot::decodeBrain(), line 381 of Robot.cpp (https://github.com/jauerb/robogen/blob/master/src/Robot.cpp#L381), the index of the hidden neuron is added to the hiddenNeuronIds map. However, the counter for output neurons is used rather than the counter for hidden neurons, causing any hidden neuron position to be calculated incorrectly when connection weights are assigned later on.

My apologies for not having the time to create a pull request at this point, but I believe the line should be changed to:

hiddenNeuronIds.insert(ioPair(neuron.id(),nHidden));
jauerb commented 9 years ago

I think you are correct, let me verify and make the change.

Thanks!