'Evolve the population by a single generation
Returns
x : ndarray
The best solution from the solver.
fun : float
Value of objective function obtained from the best solution.'

def __next__(self):

    if np.all(np.isinf(self.population_energies)):
        self._calculate_population_energies()
    if (self.dither is not None):
        self.scale = ((self.random_number_generator.rand() * (self.dither[1] - self.dither[0])) + self.dither[0])
    for candidate in range(self.num_population_members):
        if (self._nfev > self.maxfun):
            raise StopIteration
        trial = self._mutate(candidate)
        self._ensure_constraint(trial)
        parameters = self._scale_parameters(trial)
        energy = self.func(parameters, *self.args)
        self._nfev += 1
        if (energy < self.population_energies[candidate]):
            self.population[candidate] = trial
            self.population_energies[candidate] = energy
            if (energy < self.population_energies[0]):
                self.population_energies[0] = energy
                self.population[0] = trial
    return (self.x, self.population_energies[0])
