diff --git a/src/AI/GA.py b/src/AI/GA.py index ce1c6e2..ee9b42f 100644 --- a/src/AI/GA.py +++ b/src/AI/GA.py @@ -65,7 +65,7 @@ def geneticAlgorithm(map, iter, solutions, mutationAmount=0.05, multithread=Fals # Add info to logfile with open("results.txt", "a") as f: f.write("Population: {}\n".format(i)) - f.write("Best fitness: {}\n".format(fitness[0])) + f.write("Best fitness: {}\n".format(max(fitness))) f.write("Best offspring: " + str(offspring[0])) f.write("\n\n")