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

Binning scheme for piston orientations #822

Closed schrum2 closed 2 years ago

schrum2 commented 2 years ago

We know that piston orientation is the main factor influencing the direction something moves. This binning scheme can break things down into three dimensions:

  1. count of north or south pistons,
  2. count of east or west pistons,
  3. count of up or down pistons

Note that pistons should also include sticky pistons. As with most binning schemes, you will need to define fitness functions to calculate the scores. Make one fitness function that counts pistons (of both types) with a specified orientation (orientation specified at construction), then the three child classes can simply provide different orientation combos to the constructor.

For each axis, the numbers should be allows to be 0, 1, 2, 3, 4, 5 or more. That puts the archive size at 36, which I think is reasonable.

schrum2 commented 2 years ago

Anyone can work on this, and it doesn't necessarily need to be together. Whoever has time should work on it

alejmedinajr commented 2 years ago

Finished writing the fitness functions for each of the orientation pairs.

schrum2 commented 2 years ago

@richeyme should work on #823 instead. @alejmedinajr can work on this with @MuellMark

schrum2 commented 2 years ago

@richeyme is back!

alejmedinajr commented 2 years ago

The new binning scheme has been created, and it will start to be tested (it seems to be working).

alejmedinajr commented 2 years ago

Started a test run for the new binning scheme, will leave it running overnight.

alejmedinajr commented 2 years ago
Exception in thread "Thread-5" java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 4146
        at java.util.Vector.get(Unknown Source)
        at edu.southwestern.evolution.mapelites.Archive.getElite(Archive.java:296)
        at edu.southwestern.evolution.mapelites.Archive.getBinScore(Archive.java:306)
        at edu.southwestern.tasks.evocraft.MinecraftLonerShapeTask.placeArchiveInWorld(MinecraftLonerShapeTask.java:313)
        at edu.southwestern.tasks.evocraft.MinecraftLonerShapeTask.placeArchiveInWorld(MinecraftLonerShapeTask.java:298)
        at edu.southwestern.tasks.evocraft.MinecraftLonerShapeTask.oneEval(MinecraftLonerShapeTask.java:283)
        at edu.southwestern.tasks.NoisyLonerTask.evaluate(NoisyLonerTask.java:126)
        at edu.southwestern.evolution.mapelites.MAPElites.newIndividual(MAPElites.java:598)
        at edu.southwestern.evolution.mapelites.MAPElites.newIndividual(MAPElites.java:549)
        at edu.southwestern.experiment.evolution.SteadyStateExperiment$1.run(SteadyStateExperiment.java:51)
Experiment finished
done: 173.65365 minutes

This happened.

MuellMark commented 2 years ago

Exception in thread "Thread-6" java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 4113 at java.util.Vector.get(Unknown Source) at edu.southwestern.evolution.mapelites.Archive.getElite(Archive.java:296) at edu.southwestern.evolution.mapelites.Archive.getBinScore(Archive.java:306) at edu.southwestern.tasks.evocraft.MinecraftLonerShapeTask.placeArchiveInWorld(MinecraftLonerShapeTask.java:313) at edu.southwestern.tasks.evocraft.MinecraftLonerShapeTask.placeArchiveInWorld(MinecraftLonerShapeTask.java:298) at edu.southwestern.tasks.evocraft.MinecraftLonerShapeTask.oneEval(MinecraftLonerShapeTask.java:283) at edu.southwestern.tasks.NoisyLonerTask.evaluate(NoisyLonerTask.java:126) at edu.southwestern.evolution.mapelites.MAPElites.newIndividual(MAPElites.java:598) at edu.southwestern.evolution.mapelites.MAPElites.newIndividual(MAPElites.java:549) at edu.southwestern.experiment.evolution.SteadyStateExperiment$1.run(SteadyStateExperiment.java:51) Experiment finished done: 5161.414433333333 minutes

Issue is still not resolved

MuellMark commented 2 years ago

I ran three tests with this, and they all crashed at different times/ indexes. One crashed at index 4133 (as seen above), one at 4197, and the other at 4163. I believe either the amount of bins needs to be calculated a different way, or we may need to discard shapes with too many pistons (as a shape made of only pistons won't fly anyway.

schrum2 commented 2 years ago

I think this works. We've made changes to account for possible array bounds errors, and so far I'm not noticing a return of the error. We'll keep an eye on it.