Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def select(lineups, elite_rate=0.1):
- num_elite = int(len(lineups)*0.1)
- # sort lineups according to score
- scores = [lineup.score for lineup in lineups]
- order = np.argsort(scores)
- sorted_lineups = [lineups[i] for i in order]
- # get 10% elite and 80% mutation pool
- elite = sorted_lineups[len(lineups)-num_elite:]
- mutation_pool = sorted_lineups[num_elite:len(lineups)-num_elite]
- return elite, mutation_pool
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement