You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Until the pull request get merged, you can try something like
defcreate_individual(seed_data):
""" Create a candidate solution representation e.g. for a bit array representation: """iflen(seed_data['starting points']) >0:
print('Got individual from data')
returnseed_data['starting points'].pop(0)
print('Gen new individual')
return [random.randint(0, 1) for_inrange(len(seed_data['genes_num']))]
ga=pyeasyga.GeneticAlgorithm({'starting points':[[1, 0],[0, 0]],
'genes_num': 2}, # Input seed data#some other parameters
)
ga.create_individual=create_individual## the reset of the implementationga.run()
Is there a way to include a few individuals (likely good solutions, starting points) to the initial population, while leaving the rest of them random?
The text was updated successfully, but these errors were encountered: