Zaktualizuj 'genetic_route.py'

This commit is contained in:
Jakub Damiński 2020-06-15 01:35:00 +00:00
parent ee0bf1cb2e
commit 0b6b08f7ae

View File

@ -90,7 +90,7 @@ def genetic_trace_route(graph_map, packages):
population = copy.deepcopy(new_population) population = copy.deepcopy(new_population)
scores = score_all(graph_map, population) scores = score_all(graph_map, population)
scores.sort(key=lambda x: x[1]) scores.sort(key=lambda x: x[1])
print("Best route of all population in iteration " + i + 1) print("Best route of all population in iteration " + str(i + 1))
print(scores[0][1]) print(scores[0][1])
scores = score_all(graph_map, population) scores = score_all(graph_map, population)