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

Refactor ChangeCenterOfMassFitness so that it can extend TimedEvaluationMinecraftFitnessFunction #875

Closed schrum2 closed 1 year ago

schrum2 commented 1 year ago

ChangeCenterOfMassFitness has a lot of garbage code in it. It had some code for computing and then remembering previously computed results in a synchronized HashMap purely for the sake of being able to determine the direction that shapes were moving in. However, this code didn't even work, and was messy. There was also code for double checking if a machine was really flying, but it never ran.

All of this is now removed or in the process of being removed, but these fixes have revealed other bits of messy code. This all needs to be cleaned up, with the end goal of eventually making ChangeCenterOfMassFitness work by extending TimedEvaluationMinecraftFitnessFunction, though some modifications/additions to TimedEvaluationMinecraftFitnessFunction will still be needed to make that possible.

Specifically, ChangeCenterOfMassFitness has options for ending early if either the shape isn't moving or it escapes the evaluation area. TimedEvaluationMinecraftFitnessFunction needs to have special cases like this, but generalized to work with any fitness function.

schrum2 commented 1 year ago

ChangeCenterOfMassFitness has been thoroughly refactored to extend TimedEvaluationMinecraftFitnessFunction.

Also, the unit tests for ChangeCenterOfMassFitness still seem to work, so I'm closing the issue