From 9af11d801aaa27387821be6c67aefe8285735011 Mon Sep 17 00:00:00 2001
From: Carlos Santos Garcia <carlos.santos@student-cs.fr>
Date: Sat, 3 Apr 2021 12:13:56 +0000
Subject: [PATCH] Minor changes for crazy ants

---
 Appli-iso3dfd/ACO.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Appli-iso3dfd/ACO.py b/Appli-iso3dfd/ACO.py
index 3770648..f3b9af6 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
-- 
GitLab