evolutionSimulator icon indicating copy to clipboard operation
evolutionSimulator copied to clipboard

Elitism doesn't work as it should

Open leshchenko1979 opened this issue 5 years ago • 2 comments

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?

leshchenko1979 avatar Feb 16 '20 15:02 leshchenko1979

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 😕

adityathebe avatar Feb 17 '20 07:02 adityathebe

Understood.

But why should there be a variance if every human in every generation is initialised at config.initialPosition.x and config.initialPosition.y?

leshchenko1979 avatar Feb 17 '20 11:02 leshchenko1979