diff --git a/Appli-iso3dfd/ACO.py b/Appli-iso3dfd/ACO.py index 377064882c90e2b36df7b62864e37112afbde47d..f3b9af62a01b6787cabae6824662c0140e8b843b 100644 --- a/Appli-iso3dfd/ACO.py +++ b/Appli-iso3dfd/ACO.py @@ -57,7 +57,7 @@ def ACO(Me, NbP, comm, alpha, rho, Q, nb_ants, tau_0, n_iter, n1_max=256, n2_max paths = [] costs = [] for k in range(nb_ants//NbP): - path = compute_path.compute_path(tau, alpha, n1_size, n2_size, n3_size) + path = compute_path.compute_path(tau, alpha, n1_size, n2_size, n3_size, fancy_strategy=fancy_strategy) n1 = 256 * (2**(path[0]-1)) n2 = 256 * (2**(path[1]-1)) n3 = 256 * (2**(path[2]-1)) @@ -72,7 +72,7 @@ def ACO(Me, NbP, comm, alpha, rho, Q, nb_ants, tau_0, n_iter, n1_max=256, n2_max paths = np.array(paths, dtype="int32") costs = np.array(costs, dtype="float64") - if fancy_strategy == 'AS' or fancy_strategy == 'ElitistAS': + if fancy_strategy == 'AS' or fancy_strategy == 'ElitistAS' or fancy_strategy == 'crazy': #we initialize the best path with the ants already in this process best_cost = np.amin(costs) best_p = paths[np.argmin(costs), :] @@ -149,10 +149,10 @@ if __name__ == "__main__": alpha = 1 rho = 0.1 Q = 0.1 - nb_ants = 2 + nb_ants = 32 tau_0 = Q*300 - n_iter = 1 - fancy_strategy = "AS" + n_iter = 200 + fancy_strategy = "crazy" # Parameters for compilation and execution of iso3dfd nb_threads = 8