def run(self, size, max_iter=100):
    ' Let life begin\n        '
    population = self.init(size)
    res = []
    for _ in tqdm(range(max_iter)):
        pop_fitness = [self.get_fitness(o) for o in population]
        best_indiv = np.argpartition(pop_fitness, (- 2))[(- 2):]
        (mom, dad) = population[best_indiv]
        child = self.crossover(mom, dad)
        worst_indiv = np.argmin(pop_fitness)
        population[worst_indiv] = child
        mut = (lambda o: (self.mutate(o) if (random.random() < self.mutation_probability) else o))
        population = np.array([mut(o) for o in population])
        res.append((np.mean(population, axis=0), np.var(population, axis=0)))
    return res
Let life begin
def run(self, size, max_iter=100):
    ' \n        '
    population = self.init(size)
    res = []
    for _ in tqdm(range(max_iter)):
        pop_fitness = [self.get_fitness(o) for o in population]
        best_indiv = np.argpartition(pop_fitness, (- 2))[(- 2):]
        (mom, dad) = population[best_indiv]
        child = self.crossover(mom, dad)
        worst_indiv = np.argmin(pop_fitness)
        population[worst_indiv] = child
        mut = (lambda o: (self.mutate(o) if (random.random() < self.mutation_probability) else o))
        population = np.array([mut(o) for o in population])
        res.append((np.mean(population, axis=0), np.var(population, axis=0)))
    return res