Bladeren bron

Ajout constante

Arthur Brandao 6 jaren geleden
bovenliggende
commit
fa7739e023

+ 2 - 2
Partie_2/EMA/ControlBandit.cpp

@@ -25,9 +25,9 @@ ControlBandit::ControlBandit() {
 	}
 	//Ini method
 	alphaStatic = true;
-	alpha = 0.5;
+	alpha = ALPHA_STATIC;
 	method = MT_EMA;
-	epsilon = 10;
+	epsilon = EPSILON_DEFAULT;
 	//Ini random
 	srand(getpid());
 }

+ 1 - 0
Partie_2/EMA/ControlBandit.hpp

@@ -11,6 +11,7 @@
 #define NB_HEURISTIC 7
 #define MT_EMA 0
 #define MT_EPS 1
+#define EPSILON_DEFAULT 10
 #define ALPHA_STEP 0.001
 #define ALPHA_MIN 0.4
 #define ALPHA_MAX 0.6

+ 1 - 1
Partie_2/EMA/Main.cpp

@@ -8,7 +8,7 @@
 using namespace std;
 
 void help(char* prog) {
-    fprintf(stderr, "usage: %s -i file.cnf [-t int] [-s] [-e double] [-d]\n\t-i CNF file to solve\n\t-t Number of threads to use\n\t-s Silent mode\n\t-e Use epsilon greedy method with the value (0 <= value <= 1)\n\t-d Use dynamic alpha (default is static alpha = 0.5)\n", prog);
+    fprintf(stderr, "usage: %s -i file.cnf [-t int] [-s] [-e double] [-d]\n\t-i CNF file to solve\n\t-t Number of threads to use\n\t-s Silent mode\n\t-e Use epsilon greedy method with the value (0 <= value <= 1)\n\t-d Use dynamic alpha (default is static alpha = %.1f)\n", prog, ALPHA_STATIC);
     exit(1);
 }
 

+ 1 - 1
Partie_2/Moyenne/ControlBandit.cpp

@@ -27,7 +27,7 @@ ControlBandit::ControlBandit() {
 	}
 	//Ini method
 	method = MT_AVG;
-	epsilon = 10;
+	epsilon = EPSILON_DEFAULT;
 	//Ini random
 	srand(getpid());
 }

+ 1 - 0
Partie_2/Moyenne/ControlBandit.hpp

@@ -11,6 +11,7 @@
 #define NB_HEURISTIC 7
 #define MT_AVG 0
 #define MT_EPS 1
+#define EPSILON_DEFAULT 10
 
 /* --- Structure --- */
 typedef struct {