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

fix broadcast of tau

parent 6d074bbe
Branches
No related tags found
No related merge requests found
......@@ -45,7 +45,7 @@ def ACO(Me, NbP, comm, alpha, rho, Q, nb_ants, tau_0, n_iter, n1=256, n2=256, n3
n_cbx = n1//16
n_cby = n2
n_cbz = n3
tau = np.zeros((n_cbx + n_cby + 1, n_cbx + n_cby + n_cbz + 1))
tau = np.zeros((n_cbx + n_cby + 1, n_cbx + n_cby + n_cbz + 1), dtype="float64")
tau[0, 1:n_cbx+1] = tau_0
tau[1:n_cbx+1, n_cbx+1:n_cbx+n_cby+1] = tau_0
tau[n_cbx+1:n_cbx+n_cby+1, n_cbx+n_cby+1:n_cbx+n_cby+n_cbz+1] = tau_0
......@@ -75,9 +75,7 @@ def ACO(Me, NbP, comm, alpha, rho, Q, nb_ants, tau_0, n_iter, n1=256, n2=256, n3
if best_cost < cost_opti:
cost_opti = best_cost
path_opti = best_p
tau = comm.Bcast(tau, root=0)
print("P:", Me, " --> Tab received: ", tau[0, 1:17])
comm.Bcast(tau, root=0)
if Me == 0:
path_opti[0] *= 16
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment