Hi,
There is no such thing as an explicit elitism operator in DEAP. However, this is intended, since it can be very easily achieved because of the use of the Python language (unlike OpenBeagle). Say your population is in 'pop' :
from deap import tools
pop = tools.selBest(pop, int(0.1*len(pop))) + tools.selTournament(pop, len(pop)-int(0.1*len(pop)), tournsize=3)
will do the job. Note that this method keep the best individual for the tournament selection.
If you want to simplify your code, you can create an operator which will do just that :
def selElitistAndTournament(individuals, k_elitist, k_tournament, tournsize):
return tools.selBest(individuals, k_elitist) + tools.selTournament(individuals, k_tournament, tournsize=3)
and then register it as your selection operator :
toolbox.register("select", selElitistAndTournament, k_elitist=int(0.1*POP_SIZE), k_tournament=POP_SIZE - int(0.1*POP_SIZE), tournsize=3)
And then it will work with any boxed algorithm.
Have fun with DEAP,
Marc-André