peter-ch / MultiNEAT

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

Stuck in an infinity loop in Genome::Genome(std::ifstream &a_DataFile) #64

Open ClarkyMacLeod opened 3 years ago

ClarkyMacLeod commented 3 years ago

I saved my previous population with Genome::Save(FILE *a_file) and stopped the evolution. When I tried to resume where I left, the program froze and threw a Runtime Error.

After some digging and debugging, I found the Bug. In the Genome constructor, Genome.cpp, row 3467 is a do-while loop, which runs forever, when the file format given as an argument uses commas instead of dots as decimal separator.

The workaround is to change the language format in the OS-settings.

Steps to reproduce the issue:

Change your formats for numbers etc. so it uses commas for decimal separators: 3,14 instead of 3.14. Let population evolve and interrupt the process after a couple generations and save your progress with Genome::Save(FILE *a_file). Then load your previously evolved population with NEAT.Population(a_file)