def _selectAndReproduce(self, pop, fits):
        """ apply selection and reproduction to host population, according to their fitness."""
        # combine population with their fitness, then sort, only by fitness
        s = list(zip(fits, pop))
        shuffle(s)
        s.sort(key=lambda x:-x[0])
        # select...
        selected = [x[1] for x in s[:self._numSelected()]]
        # ... and reproduce
        if self.elitism:
            newpop = self._extendPopulation(selected, self.populationSize)
            if 1 < self.parentChildAverage:
                self._averageWithParents(newpop, self.parentChildAverage)
        else:
            newpop = self._extendPopulation(selected, self.populationSize
                                            + self._numSelected()) [self._numSelected():]
            if self.parentChildAverage < 1:
                self._averageWithParents(newpop[self._numSelected():], self.parentChildAverage)
        return newpop
dataset/ETHPy150Open pybrain/pybrain/pybrain/optimization/populationbased/coevolution/coevolution.py/Coevolution._selectAndReproduce/swapped operands of `<`