diff --git a/deap/base.py b/deap/base.py index f9d84ba6..3fd2a518 100644 --- a/deap/base.py +++ b/deap/base.py @@ -232,10 +232,10 @@ def __hash__(self): return hash(self.wvalues) def __gt__(self, other): - return not self.__le__(other) + return self.wvalues > other.wvalues def __ge__(self, other): - return not self.__lt__(other) + return self.wvalues >= other.wvalues def __le__(self, other): return self.wvalues <= other.wvalues diff --git a/deap/tools/support.py b/deap/tools/support.py index 2f7433bd..95948f70 100644 --- a/deap/tools/support.py +++ b/deap/tools/support.py @@ -522,10 +522,12 @@ def update(self, population): update the hall of fame with. """ for ind in population: + if ind.fitness.values[0] != ind.fitness.values[0]: + continue if len(self) == 0 and self.maxsize != 0: # Working on an empty hall of fame is problematic for the # "for else" - self.insert(population[0]) + self.insert(ind) continue if ind.fitness > self[-1].fitness or len(self) < self.maxsize: for hofer in self: