Commit 4a2ad6ec authored by Frédéric Krüger's avatar Frédéric Krüger

Mise a jour fichier principaux

parent 63a34581
......@@ -25,7 +25,6 @@ Centre de Math
#define STD_FLAVOR_SO 0
#define STD_FLAVOR_MO 1
#define STD_FLAVOR_GP 2
#define CUDA_FLAVOR_SO 0
#define CUDA_FLAVOR_MO 1
#define CUDA_FLAVOR_GP 2
......@@ -53,6 +52,7 @@ extern bool bREMOTE_ISLAND_MODEL;
extern bool bLINE_NUM_EZ_FILE;
extern char* nGENOME_NAME;
extern int nPOP_SIZE, nNB_GEN, nNB_OPT_IT, nOFF_SIZE, nPROBLEM_DIM, nTIME_LIMIT;
extern int nSERVER_PORT;
extern int nWARNINGS, nERRORS;
extern int TARGET, OPERATING_SYSTEM;
extern int TARGET_FLAVOR;
......
This diff is collapsed.
......@@ -3,7 +3,7 @@
#include <clex.h>
#line 153 "EaseaLex.l"
#line 158 "EaseaLex.l"
// forward references
class CEASEAParser;
......@@ -60,7 +60,7 @@ protected:
virtual int yyaction(int action);
public:
#line 168 "EaseaLex.l"
#line 173 "EaseaLex.l"
protected:
CSymbolTable *pSymbolTable; // the symbol table
......
......@@ -12,14 +12,28 @@ Centre de Math�matiques Appliqu�es
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(lib, "libAlexYacc.lib")
#endif
#if defined __WIN32__ || defined __WIN64__
#include "Easea.h"
#include "EaseaParse.h"
#ifdef WIN32
#else
#include "Easea.h"
#include "EaseaParse.h"
#endif
#if defined WIN32 || defined WIN64
#include <direct.h>
#else
#include <unistd.h>
#endif
#ifdef __APPLE__
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t) -1)
#endif
#ifndef SSIZE_MAX
# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
#endif
#include "debug.h"
#include <iostream>
#include <sstream>
#if defined __WIN64__ || defined __APPLE__ || defined __WIN32__
/* Mac OS X don't have strndup even if _GNU_SOURCE is defined */
char *strndup (const char *s, size_t n){
size_t len = strlen (s);
......@@ -99,15 +113,6 @@ end:
/* getline implementation is copied from glibc. */
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t) -1)
#endif
#ifndef SSIZE_MAX
# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
#endif
#include "debug.h"
#include <iostream>
#include <sstream>
size_t genomeSize;
bool genomeSizeValidity=false;
......@@ -1282,6 +1287,7 @@ if(OPERATING_SYSTEM=WINDOWS)
<TEMPLATE_ANALYSIS>"\\REMOTE_ISLAND_MODEL" {fprintf(fpOutputFile,"%d",bREMOTE_ISLAND_MODEL);}
<TEMPLATE_ANALYSIS>"\\IP_FILE" {if(strlen(sIP_FILE)>0)fprintf(fpOutputFile,"%s",sIP_FILE); else fprintf(fpOutputFile,"NULL");}
<TEMPLATE_ANALYSIS>"\\MIGRATION_PROBABILITY" {fprintf(fpOutputFile,"%f",fMIGRATION_PROBABILITY);}
<TEMPLATE_ANALYSIS>"\\SERVER_PORT" {fprintf(fpOutputFile,"%d",nSERVER_PORT);}
<TEMPLATE_ANALYSIS>"\\PRINT_STATS" {fprintf(fpOutputFile,"%d",bPRINT_STATS);}
<TEMPLATE_ANALYSIS>"\\PLOT_STATS" {fprintf(fpOutputFile,"%d",bPLOT_STATS);}
......@@ -2307,6 +2313,7 @@ if(OPERATING_SYSTEM=WINDOWS)
<GET_PARAMETERS>"Remote"[ \t\n]+"island"[ \t\n]+"model"[ \t\n]*":"[ \t\n]* {if(bVERBOSE) printf ("\tRemote Island Model...\n"); return REMOTE_ISLAND_MODEL;}
<GET_PARAMETERS>"IP"[ \t\n]+"file"[ \t\n]*":"[ \t\n]* {if(bVERBOSE) printf("\tIP File...\n"); return IP_FILE;}
<GET_PARAMETERS>"Migration"[ \t\n]+"probability"[ \t\n]*":"[ \t\n]* {if(bVERBOSE) printf("\tMigration Probability...\n"); return MIGRATION_PROBABILITY;}
<GET_PARAMETERS>"Server"[ \t\n]+"port"[ \t\n]*":"[ \t\n]* {if(bVERBOSE) printf("\tServer port...\n"); return SERVER_PORT;}
// number
......@@ -2491,8 +2498,8 @@ int CEASEALexer::create(CEASEAParser* pParser, CSymbolTable* pSymTable)
strcat(sTemp,"CMAES.tpl");
else if (TARGET_FLAVOR == MEMETIC )
strcat(sTemp,"STD_MEM.tpl");
else if (TARGET_FLAVOR == STD_FLAVOR_GP )
strcat(sTemp,"GP.tpl");
//else if (TARGET_FLAVOR == STD_FLAVOR_GP )
// strcat(sTemp,"GP.tpl");
else
strcat(sTemp,"STD_MO.tpl");
if (!(yyin = fpTemplateFile = fopen(sTemp, "r"))){
......
This diff is collapsed.
......@@ -3,7 +3,7 @@
#include <cyacc.h>
#line 69 "EaseaParse.y"
#line 70 "EaseaParse.y"
// forward references
class CSymbol;
......@@ -11,7 +11,7 @@ class CSymbol;
#line 12 "EaseaParse.h"
#ifndef YYSTYPE
union tagYYSTYPE {
#line 75 "EaseaParse.y"
#line 76 "EaseaParse.y"
CSymbol* pSymbol;
double dValue;
......@@ -68,28 +68,29 @@ union tagYYSTYPE {
#define REMOTE_ISLAND_MODEL 297
#define IP_FILE 298
#define MIGRATION_PROBABILITY 299
#define PRINT_STATS 300
#define PLOT_STATS 301
#define GENERATE_CSV_FILE 302
#define GENERATE_GNUPLOT_SCRIPT 303
#define GENERATE_R_SCRIPT 304
#define SAVE_POPULATION 305
#define START_FROM_FILE 306
#define TIME_LIMIT 307
#define MAX_INIT_TREE_D 308
#define MIN_INIT_TREE_D 309
#define MAX_XOVER_DEPTH 310
#define MAX_MUTAT_DEPTH 311
#define MAX_TREE_D 312
#define NB_GPU 313
#define PRG_BUF_SIZE 314
#define NO_FITNESS_CASES 315
#line 159 "EaseaParse.y"
#define SERVER_PORT 300
#define PRINT_STATS 301
#define PLOT_STATS 302
#define GENERATE_CSV_FILE 303
#define GENERATE_GNUPLOT_SCRIPT 304
#define GENERATE_R_SCRIPT 305
#define SAVE_POPULATION 306
#define START_FROM_FILE 307
#define TIME_LIMIT 308
#define MAX_INIT_TREE_D 309
#define MIN_INIT_TREE_D 310
#define MAX_XOVER_DEPTH 311
#define MAX_MUTAT_DEPTH 312
#define MAX_TREE_D 313
#define NB_GPU 314
#define PRG_BUF_SIZE 315
#define NO_FITNESS_CASES 316
#line 161 "EaseaParse.y"
#include "EaseaSym.h"
#include "EaseaLex.h"
#line 93 "EaseaParse.h"
#line 94 "EaseaParse.h"
/////////////////////////////////////////////////////////////////////////////
// CEASEAParser
......@@ -110,7 +111,7 @@ protected:
#endif
public:
#line 166 "EaseaParse.y"
#line 168 "EaseaParse.y"
protected:
CEASEALexer EASEALexer; // the lexical analyser
......@@ -126,7 +127,7 @@ public:
virtual void yysyntaxerror();
#line 130 "EaseaParse.h"
#line 131 "EaseaParse.h"
};
#ifndef YYPARSENAME
......
......@@ -58,6 +58,7 @@ int nPROBLEM_DIM;
int nNB_GEN=0;
int nNB_OPT_IT=0;
int nTIME_LIMIT=0;
int nSERVER_PORT=0;
float fMUT_PROB;
float fXOVER_PROB;
FILE *fpOutputFile, *fpTemplateFile, *fpGenomeFile;//, *fpExplodedGenomeFile;
......@@ -139,6 +140,7 @@ class CSymbol;
%token REMOTE_ISLAND_MODEL //island model
%token IP_FILE //island model
%token MIGRATION_PROBABILITY //island model
%token SERVER_PORT //server port
%token PRINT_STATS
%token PLOT_STATS
%token GENERATE_CSV_FILE
......@@ -637,7 +639,9 @@ Parameter
| MIGRATION_PROBABILITY NUMBER2{
fMIGRATION_PROBABILITY=(float)$2;
}
| SERVER_PORT NUMBER2{
nSERVER_PORT=(int)$2;
}
| PRINT_STATS IDENTIFIER2{
if (!mystricmp($2->sName,"False")) bPRINT_STATS=0;
else if (!mystricmp($2->sName,"True")) bPRINT_STATS=1;
......@@ -766,10 +770,6 @@ int main(int argc, char *argv[]){
else if (!mystricmp(sTemp,"memetic")) {
TARGET_FLAVOR = MEMETIC;
}
else if( !mystricmp(sTemp,"gp")){
TARGET = STD;
TARGET_FLAVOR = STD_FLAVOR_GP;
}
else if (!mystricmp(sTemp,"v")) bVERBOSE=true;
else if (!mystricmp(sTemp,"tl")){
......
UNAME := $(shell uname)
EXEC = easea
ifeq ($(shell uname -o 2>/dev/null),Msys)
OS := MINGW
endif
EXEC = easea
CPPFLAGS += -DUNIX_OS -Ialexyacc/include/ -g -Wno-deprecated -DDEBUG -DLINE_NUM_EZ_FILE
CPPC = g++
LDFLAGS =
......@@ -12,6 +15,43 @@ $(EXEC):EaseaSym.o EaseaParse.o EaseaLex.o alexyacc/libalex.a EaseaYTools.o boos
#$(EXEC):EaseaSym.o EaseaParse.o EaseaLex.o alexyacc/libalex.a EaseaYTools.o libeasea/libeasea.a
#endif
$(CPPC) $(CPPFLAGS) $(LDFLAGS) $^ -o $@
ifneq ("$(OS)","")
@echo #
@echo # Congratulations ! It looks like you compiled EASEA successfully.
@echo #
@echo # You can use easea from this directory by typing :
@echo # For example :
@echo # easea.exe examples\weierstrass_std\weierstrass.ez
@echo # Go to the target directory and type make -f weierstrass.mak
@echo #
@echo # Thanks for using EASEA.
@echo #
else ifeq ($(UNAME),Darwin)
#
# Congratulations ! It looks like you compiled EASEA successfully.
#
# EZ_PATH was automatically added to your .profile at the end of the compilation
#
# Easea could be moved to a bin directory or included in the PATH
# as long as users have defined a EZ_PATH environment variable
# pointing to the Easea directory.
# To do this temporally type :
# export EZ_PATH=`pwd`/
# Or define EZ_PATH in your .profile file :
# For example :
# export EZ_PATH=/path/to/easea/directory/
#
# Otherwise you can use easea from this directory by typing :
# For example :
# ./easea examples/weierstrass_std/weierstrass.ez
# Go to the taget directory and type make
#
# To Activate the EZ_PATH variable type:
# source ~/.profile
#
# Thanks for using EASEA.
#
else
#
# Congratulations ! It looks like you compiled EASEA successfully.
#
......@@ -26,7 +66,7 @@ $(EXEC):EaseaSym.o EaseaParse.o EaseaLex.o alexyacc/libalex.a EaseaYTools.o boos
# Easea could be moved to a bin directory or included in the PATH
# as long as users have defined a EZ_PATH environment variable
# pointing to the Easea directory.
# To do this temporarly type :
# To do this temporally type :
# export EZ_PATH=`pwd`/
# Or define EZ_PATH in your bashrc file (for bash users) :
# For example :
......@@ -42,6 +82,7 @@ $(EXEC):EaseaSym.o EaseaParse.o EaseaLex.o alexyacc/libalex.a EaseaYTools.o boos
#
# Thanks for using EASEA.
#
endif
# $(EXEC):EaseaSym.o EaseaParse.o EaseaLex.o alexyacc/libalex.so
# $(CPPC) $(CPPFLAGS) $(LDFLAGS) $^ -o $@
......@@ -81,9 +122,9 @@ endif
EaseaParse.o: EaseaParse.cpp EaseaLex.cpp
$(CPPC) $(CPPFLAGS) $< -o $@ -c #2>/dev/null
$(CPPC) $(CPPFLAGS) $< -o $@ -c
EaseaLex.o: EaseaLex.cpp
$(CPPC) $(CPPFLAGS) $< -o $@ -c #2>/dev/null
$(CPPC) $(CPPFLAGS) $< -o $@ -c
%.o:%.cpp
......@@ -106,9 +147,17 @@ libeasea/libeasea.a:libeasea/*.cpp
cd libeasea && make libeasea.a
clean:
ifneq ("$(OS)","")
-del *.o $(EXEC).exe $(EXEC)_bin
cd alexyacc && make clean
cd libeasea && make clean
cd boost && make clean
else
rm -f *.o $(EXEC) $(EXEC)_bin
cd alexyacc && make clean
cd libeasea && make clean
cd boost && make clean
endif
#ifeq ($(UNAME),Darwin)
cd boost && make clean
#endif
......
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