def generational_replacement(random, population, parents, offspring, args):
    num_elites = args.setdefault('num_elites', 0)
    population.sort(reverse=True)
    offspring.extend(population[:num_elites])
    offspring.sort(reverse=True)
    survivors = offspring[:len(population)]
    return survivors
Performs generational replacement with optional weak elitism.
dataset/ETHPy150Open aarongarrett/inspyred/inspyred/ec/replacers.py/generational_replacement