diff --git a/src/genetic_algorithm.py b/src/genetic_algorithm.py index c163779..5221cf0 100644 --- a/src/genetic_algorithm.py +++ b/src/genetic_algorithm.py @@ -82,12 +82,13 @@ def get_matching_genes(parents): def populate_offspring(values): - offspring = DataFrame(columns=["point", "distance"]) + offspring = DataFrame(columns=["point", "distance", "fitness"]) for element in values: - aux = DataFrame(columns=["point", "distance"]) + aux = DataFrame(columns=["point", "distance", "fitness"]) aux["point"] = element offspring = offspring.append(aux) offspring["distance"] = 0 + offspring["fitness"] = 0 offspring = offspring[1:] return offspring