schrum2 / EvoCraft-SCOPE

0 stars 0 forks source link

Each fitness function knows its own "fitness_threshold" #41

Closed schrum2 closed 2 years ago

schrum2 commented 2 years ago

The NEAT config requires that a fitness threshold be specified. This is the value at which evolution will terminate in success, and is generally the maximum possible fitness. We need to make it so that each fitness function can tell the simulation what the fitness_threshold is. It is currently specified in evolution.py as 1000, but this only works for the type_count function, and ONLY when the shape is 10 by 10 by 10!

Make it so that all fitness functions, starting with type_count, return their maximum fitness threshold if the client parameter is None. This means you can call whatever the fitness function is (which will be able to vary once #39 is resolved) with a None for the client (though you will still need to provide accurate position_information) and it will return the fitness_threshold for you (assign it in evolution.py).

Basically, each fitness function just starts with an if statement that returns the max value if client is None:

alejmedinajr commented 2 years ago

Now the type_countworks with values other than 1000 (when the RANGES are values other than 10). As for type_target, I tested it twice with two different values and different dimensions and it also seemed to work. The fitness_thresholdseemed to accurately change to match the changes made with different command line parameter values.