Evoman is a video game playing framework to be used as a testbed for optimization algorithms.
A demo can be found here: https://www.youtube.com/watch?v=ZqaMjd1E4ZI
In test_deap.py is a minimal example hooked up with the engine. The main() function is the entry point of execution of the algorithm, as is, it will run a set number of generatios and then at the end show you the execution in normal time of the best
individual accross generation. It will also print statistics each generation.
Currently the setup takes into account both off these methods (both will have a chance to be applied),
for now the step size is constants but that can be modified by looking at NEAT documentation. To change
either method the toolbox class needs to be used:
- Declare your new mutation function. ex.
def mutate_ex(ind, step):
for v, i in enumerate(ind):
ind[i] = v + v*step
return ind
- Register this function in the
toolboxunder the name mutate and give it a parameter value to your static parameters:
toolbox.register("mutate", mutate_ex, step=0.5)
-
(Optional) Change the probability of mutation (MUTPB) or the probability of crossover (CXPB) in the code
-
Execute
python3 test_deap.py -
Make sure your function is under
deap_algorithms.pyand if the implenmentation required changes totest_deap.pymake a copy and put your solution there to avoid merge conflicts
Selection and replacement aren't mutually exclusive but we can choose to only use selection in the replacement strategy. As it is right now selection is a part of the offspring selection but it could also be implenmented in parent selection (as part of mutation ?)