PytLab / gaft

A Genetic Algorithm Framework in Python (not for production level)
http://gaft.readthedocs.io/
GNU General Public License v3.0
739 stars 218 forks source link

How to initial population with a specified solution #50

Open yasser9372 opened 5 years ago

yasser9372 commented 5 years ago

Hi. I want to add an specific solution in first population. for example in this population:

# Define population.
indv_template = BinaryIndividual(ranges=[(-2, 2), (-2, 2)], eps=0.001)
population = Population(indv_template=indv_template, size=50).init()

i want to add a solution like [-1, 1] in first population. I tried this but i got error: https://github.com/PytLab/gaft/blob/0fb7547752d443a3722916db02cf0a2cfb03026d/gaft/components/individual.py#L82 how can i do this?? thanks