I am trying to implement a genetic algorithm in python. I have a list of 100 objects, sorted, and I need to access the top 30 plus 20 random others. My method is:
random.shuffle(list[30:]) #keep top 30, shuffle the rest
for x in range (50):
list[x].do_stuff
This doesn't work, the list is unchanged. Is my syntax wrong or is my entire method impossible? thanks
Aucun commentaire:
Enregistrer un commentaire