'Update the hall of fame with the *population* by replacing the
worst individuals in it by the best individuals present in
*population* (if they are better). The size of the hall of fame is
kept constant.
:param population: A list of individual with a fitness attribute to
update the hall of fame with.'

def update(self, population):

    if ((len(self) == 0) and (self.maxsize != 0)):
        self.insert(population[0])
    for ind in population:
        if ((ind.fitness > self[(-1)].fitness) or (len(self) < self.maxsize)):
            for hofer in self:
                if self.similar(ind, hofer):
                    break
            else:
                if (len(self) >= self.maxsize):
                    self.remove((-1))
                self.insert(ind)
