Code from Pacman available at https://pacmancode.com/
The possible range for random initialization of DNA weights.
[a,b] -> a,b are positive floats.
Chance of crossover occurring.
n -> float between (and including) 0 and 1.
Alpha for arithmetic combination crossover. Only used when 2 parents are selected for crossover.
α -> float between (and including) 0 and 1. Choosing 0 means that only the genes from the second parent will be chosen and 1 the opposite.
Size of the generated offspring.
n -> positive int (must be less or equal the population size).
The crossover type.
"simple": replaces only one gene.
"normal": randomly selects a gene at the k position, and replaces k+1 until the final gene.
"complete": replaces the entire DNA.
Chance of mutation occurring.
n -> float between (and including) 0 and 1.
Population's size.
n -> positive int.
The selected individuals from the population to participate into tournament.
n -> positive int (must be less than the population size).
The number of parents selected from the tournament.
n -> positive int.
The survival selection type.
"elitist": merges the offspring with the population and selects only the best.
"replace": replaces the parents with the offspring.
The number of generations to be created.
n -> positive int.
Early stopping's maximum number of iterations to check if the score doesn't increase.
n -> positive int (must be less than the number of generations).
Recreate and run a individual. For the best individual's DNA, run the code, and get it on the "data" folder inside an study's "best.pacw" file.
[normal],[power] -> the individual's dna.
This code uses Python 3.10 or newer.
We recommend you to create a virtual environment for running the studies. On the local repository's root path:
pip install -r requirements.txt
Configure the parameters on: Pacman_Complete/params.json
Go to "Pacman_Complete" and run:
python run.py
The PyGame window will appear with the study running and the log will be on the console. Also, an "data" folder containing further study data will appear on the "Pacman_Complete" path with the folder named with the datetime that the study started.