Closed schrum2 closed 2 years ago
The new class has been created similarly to TypeCountFitness. New code has also been added to the constructor of MinecraftShapeTask that I think registers the new fitness function. The code needs to be refactored though, so that it does not repeat the code to count how many blocks of a desired block there are.
The code is now refactored, and the code to count the number of blocks is no longer being repeated unnecessarily. I also forgot to include a new command line parameter, that is now included with this new commit.
Make a class
TypeTargetFitness
in the packageedu.southwestern.tasks.evocraft.fitness
that extendsCheckBlocksInSpaceFitness
in a manner similar toTypeCountFitness
.Then add code in the constructor of
MinecraftShapeTask
that registers the new fitness function. You will need to define a command line parameter to indicate that this fitness function is being used, and a separate command line parameter that identifies the desired target count.