Add fitness column to individual
This commit is contained in:
parent
7c434fb9cd
commit
135d1c48b8
|
@ -82,12 +82,13 @@ def get_matching_genes(parents):
|
||||||
|
|
||||||
|
|
||||||
def populate_offspring(values):
|
def populate_offspring(values):
|
||||||
offspring = DataFrame(columns=["point", "distance"])
|
offspring = DataFrame(columns=["point", "distance", "fitness"])
|
||||||
for element in values:
|
for element in values:
|
||||||
aux = DataFrame(columns=["point", "distance"])
|
aux = DataFrame(columns=["point", "distance", "fitness"])
|
||||||
aux["point"] = element
|
aux["point"] = element
|
||||||
offspring = offspring.append(aux)
|
offspring = offspring.append(aux)
|
||||||
offspring["distance"] = 0
|
offspring["distance"] = 0
|
||||||
|
offspring["fitness"] = 0
|
||||||
offspring = offspring[1:]
|
offspring = offspring[1:]
|
||||||
return offspring
|
return offspring
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue