Commit bb732361 authored by wcancino's avatar wcancino Committed by Waldo Cancino
Browse files

Improve bbob template

parent b99dcf89
...@@ -6,7 +6,9 @@ Selection operator: Tournament ...@@ -6,7 +6,9 @@ Selection operator: Tournament
__________________________________________________________*/ __________________________________________________________*/
\User declarations : \User declarations :
#define SIZE 100 #define SIZE 2
#define BBOB_FUNCTION_ID 1
#define BBOB_INSTANCE_ID 1
#define X_MIN -5. #define X_MIN -5.
#define X_MAX 5. #define X_MAX 5.
#define ITER 120 #define ITER 120
...@@ -18,10 +20,10 @@ __________________________________________________________*/ ...@@ -18,10 +20,10 @@ __________________________________________________________*/
float pMutPerGene=0.1; float pMutPerGene=0.1;
int DIM = 2; int DIM = SIZE;
int trialid = 1; int trialid = BBOB_INSTANCE_ID;
int funcId = 2; //passed by parameter int funcId = BBOB_FUNCTION_ID; //passed by parameter
int instanceId = 1; int instanceId = BBOB_INSTANCE_ID;;
double * peaks; double * peaks;
double * Xopt; /*Initialized in benchmarkhelper.c*/ double * Xopt; /*Initialized in benchmarkhelper.c*/
...@@ -74,12 +76,13 @@ float gauss() ...@@ -74,12 +76,13 @@ float gauss()
\end \end
\Before everything else function: \Before everything else function:
int a = setVariable("POP_SIZE",10);
printf("population size %d\n", a);
fgeneric_initialize(); fgeneric_initialize();
\end \end
\After everything else function: \After everything else function:
//cout << "After everything else function called" << endl; //cout << "After everything else function called" << endl;
fgeneric_finalize();
\end \end
\At the beginning of each generation function: \At the beginning of each generation function:
...@@ -96,8 +99,8 @@ float gauss() ...@@ -96,8 +99,8 @@ float gauss()
\User classes : \User classes :
GenomeClass { GenomeClass {
double *x; double x[SIZE];
double *sigma; // auto-adaptative mutation parameter double sigma[SIZE]; // auto-adaptative mutation parameter
} }
\end \end
...@@ -109,8 +112,6 @@ GenomeClass { ...@@ -109,8 +112,6 @@ GenomeClass {
\end \end
\GenomeClass::initialiser : // "initializer" is also accepted \GenomeClass::initialiser : // "initializer" is also accepted
Genome.x = (double *) malloc( DIM * sizeof(double) );
Genome.sigma = (double *) malloc( DIM * sizeof(double) );
for(int i=0; i<DIM; i++ ) { for(int i=0; i<DIM; i++ ) {
Genome.x[i] = (double)random(X_MIN,X_MAX); Genome.x[i] = (double)random(X_MIN,X_MAX);
Genome.sigma[i]=(double)random(0.,0.5); Genome.sigma[i]=(double)random(0.,0.5);
...@@ -152,6 +153,7 @@ return NbMut; ...@@ -152,6 +153,7 @@ return NbMut;
\User Makefile options: \User Makefile options:
CXXFLAGS+=-I/usr/local/cuda/common/inc/ -I/usr/local/cuda/include/ -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include CXXFLAGS+=-I/usr/local/cuda/common/inc/ -I/usr/local/cuda/include/ -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
LDFLAGS+=-lgfal_pthr -llcg_util LDFLAGS+=-lgfal_pthr -llcg_util
OBJS+= benchmarks.o benchmarksnoisy.o fgeneric.o benchmarkshelper.o
\end \end
\Default run parameters : // Please let the parameters appear in this order \Default run parameters : // Please let the parameters appear in this order
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment