Skip to content
Snippets Groups Projects
Commit 114a4667 authored by Matthieu Oberon's avatar Matthieu Oberon
Browse files

add functionality to record of best_costs in file

parent 3dbd9140
No related branches found
No related tags found
No related merge requests found
......@@ -124,6 +124,9 @@ def ACO(Me, NbP, comm, alpha, rho, Q, nb_ants, tau_0, n_iter, n1_max=256, n2_max
if best_cost < cost_opti:
cost_opti = best_cost
path_opti = best_p
if Me == 0:
with open("cost_opti.txt", 'a') as file:
file.write(f"{cost_opti}\n")
n1 = 256 * (2**(path_opti[0]-1))
n2 = 256 * (2**(path_opti[1]-1))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment