Skip to content
Snippets Groups Projects
Commit 9af11d80 authored by Carlos Santos Garcia's avatar Carlos Santos Garcia
Browse files

Minor changes for crazy ants

parent 335b690d
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment