A Python learning project that evolves a population toward a target using a simple genetic algorithm. The included example uses a string model and demonstrates the typical evaluate, select, crossover, and mutate cycle.
test.py creates a Network with a population of string models, then iterates through generations until the target fitness is reached or the generation limit is exhausted. The model and algorithm implementation live under GeneticAlgorithm/.
python3 test.pyThe example prints the best fitness value for each generation and then outputs the final result.
GeneticAlgorithm/Network.py— genetic algorithm orchestration.GeneticAlgorithm/Models/BaseModel.py— base model abstraction.GeneticAlgorithm/Models/StringModel.py— string-based example model.test.py— runnable example.
See LICENSE.