vendredi 17 juin 2016

How to initialize a genetic algorithm (GA) with a specific population in Python

The following equations show a randomly initial population for a genetic algorithm by Python.
toolbox.register("attr_bool", random.randint, 0, 1)

toolbox.register("individual", tools.initRepeat, creator.Individual, toolbox.attr_bool, 100)

toolbox.register("population", tools.initRepeat, list, toolbox.individual)

The question is how to initialize the population with a specific matrix? I am not interested in starting a GA with randomly initialization.




Aucun commentaire:

Enregistrer un commentaire