Commit 893e0e9c authored by Frederic's avatar Frederic

cma-es std

parent ff7c803e
......@@ -23,6 +23,7 @@ Centre de Math
#define DREAM 3
#define CUDA 4
#define STD 5
#define CMAES 6
#define STD_FLAVOR_SO 0
#define STD_FLAVOR_MO 1
......@@ -45,7 +46,8 @@ extern char sREPLACEMENT[], sSELECTOR[], sSELECT_PRM[], sRED_PAR[], sRED_PAR_PRM
extern int nMINIMISE,nELITE;
extern bool bELITISM, bVERBOSE;
extern bool bPROP_SEQ;
extern int nPOP_SIZE, nNB_GEN, nNB_ISLANDS, nOFF_SIZE, nSURV_PAR_SIZE, nSURV_OFF_SIZE;
extern char* nGENOME_NAME;
extern int nPOP_SIZE, nNB_GEN, nNB_ISLANDS, nOFF_SIZE, nSURV_PAR_SIZE, nSURV_OFF_SIZE, nPROBLEM_DIM;
extern float fMUT_PROB, fXOVER_PROB, fREPL_PERC, fMIG_FREQ;
extern int nMIG_CLONE, nNB_MIG, nIMMIG_REPL;
extern char sMIG_SEL[], sMIGRATOR[], sIMMIG_SEL[],sMIG_TARGET_SELECTOR[];
......
......@@ -682,6 +682,8 @@ exponent ([Ee][+-]?[0-9]+)
<TEMPLATE_ANALYSIS>"\\RED_FINAL_PRM" {fprintf(fpOutputFile,"%s",sRED_FINAL_PRM);}
<TEMPLATE_ANALYSIS>"\\SURV_PAR_SIZE" {fprintf(fpOutputFile,"%d",nSURV_PAR_SIZE);}
<TEMPLATE_ANALYSIS>"\\SURV_OFF_SIZE" {fprintf(fpOutputFile,"%d",nSURV_OFF_SIZE);}
<TEMPLATE_ANALYSIS>"\\GENOME_NAME" {fprintf(fpOutputFile,"%s",nGENOME_NAME);}
<TEMPLATE_ANALYSIS>"\\PROBLEM_DIM" {fprintf(fpOutputFile,"%d",nPROBLEM_DIM);}
<TEMPLATE_ANALYSIS>"\\NB_GEN" {fprintf(fpOutputFile,"%d",nNB_GEN);}
<TEMPLATE_ANALYSIS>"\\NB_ISLANDS" {fprintf(fpOutputFile,"%d",nNB_ISLANDS);}
<TEMPLATE_ANALYSIS>"\\PROP_OR_SEQ" {fprintf(fpOutputFile,"%s",bPROP_SEQ?"Prop":"Seq");}
......@@ -1956,6 +1958,8 @@ int CEASEALexer::create(CEASEAParser* pParser, CSymbolTable* pSymTable)
if (TARGET==STD){
if(TARGET_FLAVOR == STD_FLAVOR_SO)
strcat(sTemp,"STD.tpl");
else if (TARGET_FLAVOR == CMAES)
strcat(sTemp,"CMAES.tpl");
else
strcat(sTemp,"STD_MO.tpl");
if (!(yyin = fpTemplateFile = fopen(sTemp, "r"))){
......
......@@ -45,6 +45,8 @@ int nELITE;
bool bELITISM=0;
bool bVERBOSE=0;
int nPOP_SIZE, nOFF_SIZE, nSURV_PAR_SIZE, nSURV_OFF_SIZE;
char *nGENOME_NAME;
int nPROBLEM_DIM;
int nNB_GEN;
int nNB_ISLANDS;
bool bPROP_SEQ;
......@@ -353,6 +355,7 @@ Object
if (bVERBOSE) printf(" %s pointer declared (%d bytes)\n",$2->sName,$2->nSize);
}
| Symbol '[' Expr ']' {
if((TARGET_FLAVOR==CMAES) && nPROBLEM_DIM==0 && strcmp(pCURRENT_CLASS->sName,"Genome")==0) { nGENOME_NAME=$1->sName; nPROBLEM_DIM=(int)$3;}
$1->nSize=pCURRENT_TYPE->nSize*(int)$3;
$1->pClass=pCURRENT_CLASS;
$1->pType=pCURRENT_TYPE;
......@@ -1375,6 +1378,10 @@ int main(int argc, char *argv[]){
TARGET=STD;
TARGET_FLAVOR = STD_FLAVOR_MO;
}
else if (!mystricmp(sTemp,"cmaes")) {
TARGET=STD;
TARGET_FLAVOR = CMAES;
}
else if (!mystricmp(sTemp,"v")) bVERBOSE=true;
else if (!mystricmp(sTemp,"path")) {
......
......@@ -23,4 +23,4 @@ $(LIB_NAME): $(OBJS)
$(CPPC) $(CPPFLAGS) -fpic -c $<
clean:
rm -f *.o $(LIB_NAME)
\ No newline at end of file
rm -f *.o $(LIB_NAME) $(STATIC_LIB_NAME)
\ No newline at end of file
......@@ -63,8 +63,8 @@ clean:
install:$(EXEC)
sudo cp $< /usr/bin/dev-easea
# realclean: clean
# rm -f EaseaParse.cpp EaseaParse.h EaseaLex.cpp EaseaLex.h
realclean: clean
rm -f EaseaParse.cpp EaseaParse.h EaseaLex.cpp EaseaLex.h
EaseaParse.cpp: EaseaParse.y
......
This diff is collapsed.
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