Mentions légales du service

Skip to content
Snippets Groups Projects
Commit acd4a805 authored by Mathurin Videau's avatar Mathurin Videau
Browse files

Update GPRL/utils/gp_utils.py

parent ad0fda5f
No related branches found
No related tags found
No related merge requests found
......@@ -67,7 +67,7 @@ def mutate(individual, expr=None, pset=None, mode="one", mu=0, std=1):#mutate th
return gp.mutUniform(individual, expr=expr, pset=pset)
def selQDRandom(grid, k, cellSelection=random.choice):
idxs = [k for k, v in grid._solutions.items() if v]
idxs = [key for key, v in grid._solutions.items() if v]
return [cellSelection(grid._solutions[random.choice(idxs)]) for _ in range(k)]
def selFitProp(individuals, fit_attr="fitness"):#cell fitness proportionnal selection
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment