evolutionSimulator
evolutionSimulator copied to clipboard
Elitism doesn't work as it should
Originally discussed at https://github.com/adityathebe/evolutionSimulator/pull/4#discussion_r379882416
After introducing elitism which pushed bestHuman from the previous generation as the first element of the new one, I would expect the first human in the list always to have the score not worse than the best score of the previous generation. However, it's not happening.
I blamed it on the motorNoise but after reducing it to zero the incorrect behavior of the system still persisted.
Can it be some floating point errors? Any bugs in BOX2D?
I am suspecting it's due to the variance in the time the creatures actually start to walk in each new generation.
The creatures spawn in the air (little bit above the ground). While it's in the air it starts moving. It's not guaranteed that in the next generation the best creature will start moving in the exact same position. This inconsistency, while small, can have multiplying effect I think.
A solution would be to first let the creatures settle down and then make them walk so that the seed environment remains consistent.
I am not sure if I made that concise 😕
Understood.
But why should there be a variance if every human in every generation is initialised at config.initialPosition.x
and config.initialPosition.y
?