peter-ch / MultiNEAT

Portable NeuroEvolution Library
http://MultiNEAT.com
GNU Lesser General Public License v3.0
327 stars 104 forks source link

Genome::NeuronDepth function gets stuck in infinite recursion #59

Closed jeteon closed 4 years ago

jeteon commented 4 years ago

I have had a number of long running runs seemingly get stuck but with very high CPU usage. Today I tried to debug these and found that it's caused by a (almost) infinite recursive loop where the function Genome::NeuronDepth calls itself. This happens as a result to a call to the Genome::NeuronDepth function. I'm still yet to investigate further though so I can find a minimal reproduction case. I suspect that it may be due to a loop within the genome.

peter-ch commented 4 years ago

This happens when there is a loop in the network. Make sure there aren't any first, with HasLoops().

jeteon commented 4 years ago

Yeah, I eventually, figured that I can't have any recurrence and call the depth function. I was hoping it would still give me some indicator of the depth with loops broken/ignored but I guess there isn't really a sane way to do that. Thanks for replying.