schrum2 / MM-NEAT

Modular Multiobjective (Hyper) Neuro-Evolution of Augmenting Topologies + MAP-Elites: Java code for evolving intelligent agents in Ms. Pac-Man, Tetris, and more, as well as code for Procedural Content Generation in Mario, Zelda, Minecraft, and more!
http://people.southwestern.edu/~schrum2/re/mm-neat.php
Other
50 stars 20 forks source link

More efficient ChangeCenterOfMassFitness #790

Closed schrum2 closed 2 years ago

schrum2 commented 2 years ago

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.

schrum2 commented 2 years ago

Do #794 before this

richeyme commented 2 years ago

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.