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

Generalize MinecraftBlockEvaluateExperiment for any fitness function #860

Closed schrum2 closed 1 year ago

schrum2 commented 1 year ago

The MinecraftBlockEvaluateExperiment is currently hard-coded to use the ChangeCenterOfMassFitness, but it would be easy to fix this. First, look at he constructor for MinecraftShapeTask and see how the array of fitness functions are filled based on command line parameters. The code that does this in MinecraftShapeTask should be extracted into a helper method that can be used by both MinecraftShapeTask and MinecraftBlockEvaluateExperiment. Once that helper method exists, MinecraftBlockEvaluateExperiment can call it to get a list of fitness functions (based on command line parameters), and apply all of them to the shape rather than just always using ChangeCenterOfMassFitness.

TjRaffert commented 1 year ago

Extracted the helper methods in minecraftShapeTask and updated MinecraftBlockEvaluateExperiment using them.

schrum2 commented 1 year ago

I fixed a typo in this with the "spaceBetweenMinecraftShapes" parameter. I also added "minecraftChangeCenterOfMassFitness:true" as a default fitness to use, but that may need to be changed/generalized. I also added "minecraftAccumulateChangeInCenterOfMass:true"