

def test_starting_population_fitness_ordered(self):
    '\n        Ensures that the starting population as returned by the GA is ordered\n        according to the fitness function.\n        '
    start_pop = [1, 2, 3]

    def fitness(genome):
        '\n            For illustrative purposes.\n            '
        return (genome * genome)
    ga = genetic_algorithm(start_pop, fitness, None, None)
    expected = [3, 2, 1]
    actual = start_pop.next()
    self.assertEqual(actual, expected, ('Actual: %r Expected: %r' % (actual, expected)))

dataset/ETHPy150Open ntoll/foox/test/test_ga.py TestGeneticAlgorithm.test_starting_population_fitness_ordered/VarMisuse@66/136 `ga`->`start_pop`