'Update the Pareto front hall of fame with the *population* by adding
the individuals from the population that are not dominated by the hall
of fame. If any individual in the hall of fame is dominated it is
removed.
:param population: A list of individual with a fitness attribute to
update the hall of fame with.'

def update(self, population):

    for ind in population:
        is_dominated = False
        dominates_one = False
        has_twin = False
        to_remove = []
        for (i, hofer) in enumerate(self):
            if ((not dominates_one) and hofer.fitness.dominates(ind.fitness)):
                is_dominated = True
                break
            elif ind.fitness.dominates(hofer.fitness):
                dominates_one = True
                to_remove.append(i)
            elif ((ind.fitness == hofer.fitness) and self.similar(ind, hofer)):
                has_twin = True
                break
        for i in reversed(to_remove):
            self.remove(i)
        if ((not is_dominated) and (not has_twin)):
            self.insert(ind)
