Skip to content

Instantly share code, notes, and snippets.

@gsurma
Created December 23, 2018 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gsurma/545d4d1eb1f6a54e10f9fc1c3c46aaa5 to your computer and use it in GitHub Desktop.
Save gsurma/545d4d1eb1f6a54e10f9fc1c3c46aaa5 to your computer and use it in GitHub Desktop.
def _pair(self, parents):
total_parents_score = sum([x[1] for x in parents])
pick = random.uniform(0, total_parents_score)
pair = [self._roulette_selection(parents, pick), self._roulette_selection(parents, pick)]
return pair
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment