This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
helloevolve.py implements a genetic algorithm that starts with a base | |
population of randomly generated strings, iterates over a certain number of | |
generations while implementing 'natural selection', and prints out the most fit | |
string. | |
The parameters of the simulation can be changed by modifying one of the many | |
global variables. To change the "most fit" string, modify OPTIMAL. POP_SIZE | |
controls the size of each generation, and GENERATIONS is the amount of | |
generations that the simulation will loop through before returning the fittest |