Add fitness column to individual

This commit is contained in:
coolneng 2021-06-17 22:45:42 +02:00
parent 7c434fb9cd
commit 135d1c48b8
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 3 additions and 2 deletions

View File

@ -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