Minor refactor in results report
This commit is contained in:
parent
1cf8a2696a
commit
98a86a97c0
|
@ -15,7 +15,6 @@ def get_first_solution(n, data):
|
||||||
)
|
)
|
||||||
furthest_index = distance_sum["distance"].astype(float).idxmax()
|
furthest_index = distance_sum["distance"].astype(float).idxmax()
|
||||||
furthest_row = distance_sum.iloc[furthest_index]
|
furthest_row = distance_sum.iloc[furthest_index]
|
||||||
furthest_row["distance"] = 0
|
|
||||||
return furthest_row
|
return furthest_row
|
||||||
|
|
||||||
|
|
||||||
|
@ -105,10 +104,10 @@ def execute_algorithm(choice, n, m, data):
|
||||||
|
|
||||||
def show_results(solutions, time_delta):
|
def show_results(solutions, time_delta):
|
||||||
distance_sum = solutions["distance"].sum()
|
distance_sum = solutions["distance"].sum()
|
||||||
duplicates = solutions.duplicated()
|
duplicates = solutions.duplicated().any()
|
||||||
print(solutions)
|
print(solutions)
|
||||||
print("Total distance: " + str(distance_sum))
|
print("Total distance: " + str(distance_sum))
|
||||||
if solutions[duplicates].empty:
|
if not duplicates:
|
||||||
print("No duplicates found")
|
print("No duplicates found")
|
||||||
print("Execution time: " + str(time_delta))
|
print("Execution time: " + str(time_delta))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue