I have a genetic algorithm program, everything is allocated dynamically using vectors. Nowhere is the number of generations or individuals per generation set at compile time.
I tried it using 500, 1000, 2000 generations, it runs perfect. Then I tried 10,000 generations. It gave me debug assertion failed, vector subscript out of range at generation 4966.
I tried again twice with the same parameters, 10,000 generations, it ran fine.
I tried it once more, I got the error at generation 7565.
It's strange that sometimes it works perfectly, sometimes I get the error. Especially considering that everything is done using vectors.
Any ideas on where could the problem come from? Maybe the debug mode is buggy for some reason?