Closed schrum2 closed 2 years ago
Do #794 before this
A command line parameter was made in issue #796 that can allow the user to use the efficiency made in this issue or not, which is dependent on how they want to evaluate the fitness functions. When used, it works pretty quickly in general.
A lot of shapes don't move at all, and we should be able to detect this quickly and not waste time evaluating them.
In ChangeCenterOfMassFitness, instead of waiting for a long time and checking the positions of the shapes before an after, have an option to calculate the check differently (but make sure that doing it the current way with a fixed waiting time is still an option).
The new version has a loop, and waits for a shorter amount of time inside the loop. After waiting for the short amount of time, the space is read and the center of mass is compared to the old center of mass. If it does not change, then stop looping. If the number changed, then remember the new center of mass and keep looping as long as the shape seems to be moving, or until the large time limit is reached.