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

Add back early termination with low fitness to machines that don't move #901

Closed schrum2 closed 1 year ago

schrum2 commented 1 year ago

Somehow the change center of mass fitness lost this condition when it was moved to timed evaluation. Check back in the master branch to see how it was before, and add the early termination condition.

schrum2 commented 1 year ago

Actually, looking at the old version of ChangeCenterOfMassFitness seems to indicate that there was no early termination except for flying machines: https://github.com/schrum2/MM-NEAT/blob/master/src/main/java/edu/southwestern/tasks/evocraft/fitness/ChangeCenterOfMassFitness.java

Still, it makes sense to end early if the shape isn't moving, so this should be added.

schrum2 commented 1 year ago

@JoannaBlatt This will require modifying the fitness function to terminate early if the shape is completely still, but new unit tests will also be needed. A completely still shape with not movement is easy to test (fitness of 0). It would be nice if the unit test could verify that the evaluation time is shorter.

For a shape that has some minimal movement, such as a single piston push before remaining still, the fitness is not 0. You would get whatever fitness you would normally get from running the final score calculation, but you would be safe to run that calculation earlier, since a lack of movement would not accumulate any additional fitness (HOWEVER, if "minecraftRewardFastFlyingMachines" is being used, then you cannot end early ... you have to run to the end no matter what)

JoannaBlatt commented 1 year ago

so, there is some code for ending early but it doesn't do anything either way it runs. Currently debugging. Code is in: ChangeCenterOfMassFitness - earlyEvaluationTerminationResult TimedEvaluationFitness - multipleFitnessScores - wait time and log section. Should be divided up probably?

schrum2 commented 1 year ago

As far as I can tell, the currently existing code for early termination only applies to cases where a flying machine has been discovered.

What I'm asking for here is a case where it is clear that there is no chance of the fitness improving at all, since the machine is stationary.

The purpose of the flying machine case is both to assign an appropriately high fitness and to not waste time evaluating a successful flying machine. The purpose of the new case would only be to save time by not needlessly evaluating shapes that have no chance of improving their fitness further.

schrum2 commented 1 year ago

@JoannaBlatt Please provide a progress update in the issue thread for this

JoannaBlatt commented 1 year ago

Currently for ChangeCenterOfMassFitness it seems like early termination for both flying and non-flying is working correctly, but I do feel like maybe it should be tested more thoroughly, but I'm not sure how.

schrum2 commented 1 year ago

I think the test of the GECCO batch file and the continued passing of unit tests make this issue closed.