Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
easea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Arnaud Kress
easea
Commits
876ad2d7
Commit
876ad2d7
authored
Oct 18, 2010
by
kruger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Derniere modification pour la version en ilot
parent
59f6c622
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
8944 additions
and
8761 deletions
+8944
-8761
Easea.h
Easea.h
+1
-0
EaseaLex.cpp
EaseaLex.cpp
+8300
-8192
EaseaLex.l
EaseaLex.l
+2
-0
EaseaParse.cpp
EaseaParse.cpp
+563
-540
EaseaParse.h
EaseaParse.h
+23
-22
EaseaParse.y
EaseaParse.y
+5
-0
examples/weierstrass_std/weierstrass.ez
examples/weierstrass_std/weierstrass.ez
+1
-0
libeasea/CEvolutionaryAlgorithm.cpp
libeasea/CEvolutionaryAlgorithm.cpp
+2
-2
libeasea/COptionParser.cpp
libeasea/COptionParser.cpp
+1
-0
libeasea/include/Parameters.h
libeasea/include/Parameters.h
+1
-0
tpl/CMAES.tpl
tpl/CMAES.tpl
+2
-0
tpl/CUDA.tpl
tpl/CUDA.tpl
+3
-1
tpl/CUDA_GP.tpl
tpl/CUDA_GP.tpl
+32
-3
tpl/CUDA_MEM.tpl
tpl/CUDA_MEM.tpl
+3
-0
tpl/STD.tpl
tpl/STD.tpl
+2
-0
tpl/STD_MEM.tpl
tpl/STD_MEM.tpl
+3
-1
No files found.
Easea.h
View file @
876ad2d7
...
...
@@ -58,6 +58,7 @@ extern int TARGET_FLAVOR;
extern
int
nMINIMISE
,
nELITE
;
extern
float
fMUT_PROB
,
fXOVER_PROB
,
fSURV_PAR_SIZE
,
fSURV_OFF_SIZE
;
extern
float
fSELECT_PRM
,
fRED_PAR_PRM
,
fRED_FINAL_PRM
,
fRED_OFF_PRM
;
extern
float
fMIGRATION_PROBABILITY
;
extern
unsigned
iMAX_INIT_TREE_D
,
iMIN_INIT_TREE_D
,
iMAX_TREE_D
,
iNB_GPU
,
iPRG_BUF_SIZE
,
iMAX_TREE_DEPTH
,
iNO_FITNESS_CASES
;
...
...
EaseaLex.cpp
View file @
876ad2d7
This diff is collapsed.
Click to expand it.
EaseaLex.l
View file @
876ad2d7
...
...
@@ -1139,6 +1139,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>"\\PRINT_STATS" {fprintf(fpOutputFile,"%d",bPRINT_STATS);}
<TEMPLATE_ANALYSIS>"\\PLOT_STATS" {fprintf(fpOutputFile,"%d",bPLOT_STATS);}
...
...
@@ -2146,6 +2147,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;}
// number
...
...
EaseaParse.cpp
View file @
876ad2d7
This diff is collapsed.
Click to expand it.
EaseaParse.h
View file @
876ad2d7
...
...
@@ -3,7 +3,7 @@
#include <cyacc.h>
#line 6
8
"EaseaParse.y"
#line 6
9
"EaseaParse.y"
// forward references
class
CSymbol
;
...
...
@@ -11,7 +11,7 @@ class CSymbol;
#line 12 "EaseaParse.h"
#ifndef YYSTYPE
union
tagYYSTYPE
{
#line 7
4
"EaseaParse.y"
#line 7
5
"EaseaParse.y"
CSymbol
*
pSymbol
;
double
dValue
;
...
...
@@ -67,28 +67,29 @@ union tagYYSTYPE {
#define ELITE 296
#define REMOTE_ISLAND_MODEL 297
#define IP_FILE 298
#define PRINT_STATS 299
#define PLOT_STATS 300
#define GENERATE_CSV_FILE 301
#define GENERATE_GNUPLOT_SCRIPT 302
#define GENERATE_R_SCRIPT 303
#define SAVE_POPULATION 304
#define START_FROM_FILE 305
#define TIME_LIMIT 306
#define MAX_INIT_TREE_D 307
#define MIN_INIT_TREE_D 308
#define MAX_XOVER_DEPTH 309
#define MAX_MUTAT_DEPTH 310
#define MAX_TREE_D 311
#define NB_GPU 312
#define PRG_BUF_SIZE 313
#define NO_FITNESS_CASES 314
#line 157 "EaseaParse.y"
#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"
#include "EaseaSym.h"
#include "EaseaLex.h"
#line 9
2
"EaseaParse.h"
#line 9
3
"EaseaParse.h"
/////////////////////////////////////////////////////////////////////////////
// CEASEAParser
...
...
@@ -109,7 +110,7 @@ protected:
#endif
public:
#line 16
4
"EaseaParse.y"
#line 16
6
"EaseaParse.y"
protected:
CEASEALexer
EASEALexer
;
// the lexical analyser
...
...
@@ -125,7 +126,7 @@ public:
virtual
void
yysyntaxerror
();
#line 1
29
"EaseaParse.h"
#line 1
30
"EaseaParse.h"
};
#ifndef YYPARSENAME
...
...
EaseaParse.y
View file @
876ad2d7
...
...
@@ -49,6 +49,7 @@ bool bGENERATE_CSV_FILE=0, bGENERATE_R_SCRIPT=0, bGENERATE_GNUPLOT_SCRIPT=0;
bool bSAVE_POPULATION=0, bSTART_FROM_FILE=0;
bool bBALDWINISM=0; //memetic
bool bREMOTE_ISLAND_MODEL=0; //remote island model
float fMIGRATION_PROBABILITY=0.0;
char sIP_FILE[128]; //remote island model
int nPOP_SIZE, nOFF_SIZE;
float fSURV_PAR_SIZE=-1.0, fSURV_OFF_SIZE=-1.0;
...
...
@@ -137,6 +138,7 @@ class CSymbol;
%token ELITE
%token REMOTE_ISLAND_MODEL //island model
%token IP_FILE //island model
%token MIGRATION_PROBABILITY //island model
%token PRINT_STATS
%token PLOT_STATS
%token GENERATE_CSV_FILE
...
...
@@ -632,6 +634,9 @@ Parameter
strcat(sIP_FILE,".");
strcat(sIP_FILE,$4->sName);
}
| MIGRATION_PROBABILITY NUMBER2{
fMIGRATION_PROBABILITY=(float)$2;
}
| PRINT_STATS IDENTIFIER2{
if (!mystricmp($2->sName,"False")) bPRINT_STATS=0;
...
...
examples/weierstrass_std/weierstrass.ez
View file @
876ad2d7
...
...
@@ -192,6 +192,7 @@ CPPFLAGS+=
Remote island model: true
IP file: ip.txt //File containing all the remote island's IP
Migration probability: 0.1
Save population: true
Start from file:false
...
...
libeasea/CEvolutionaryAlgorithm.cpp
View file @
876ad2d7
...
...
@@ -192,7 +192,7 @@ void CEvolutionaryAlgorithm::runEvolutionaryLoop(){
EASEABeginningGenerationFunction
(
this
);
// Sending individuals if remote island model
if
(
params
->
remoteIslandModel
&&
this
->
numberOfClients
>
0
)
if
(
params
->
remoteIslandModel
)
this
->
sendIndividual
();
population
->
produceOffspringPopulation
();
...
...
@@ -409,7 +409,7 @@ void CEvolutionaryAlgorithm::initializeClients(){
void
CEvolutionaryAlgorithm
::
sendIndividual
(){
//Sending an individual every n generations
if
(
this
->
currentGeneration
%
(
10
+
this
->
myClientNumber
)
==
0
){
if
(
globalRandomGenerator
->
random
(
0.0
,
1.0
)
<=
params
->
migrationProbability
){
//cout << "I'm going to send an Individual now" << endl;
//this->population->selectionOperator->initialize(this->population->parents, 7, this->population->actualParentPopulationSize);
//size_t index = this->population->selectionOperator->selectNext(this->population->actualParentPopulationSize);
...
...
libeasea/COptionParser.cpp
View file @
876ad2d7
...
...
@@ -142,6 +142,7 @@ void parseArguments(const char* parametersFileName, int ac, char** av,
(
"baldwinism"
,
po
::
value
<
int
>
(),
"Only keep fitness (default : 0)"
)
(
"remoteIslandModel"
,
po
::
value
<
int
>
(),
"Boolean to activate the individual exachange with remote islands (default : 0)"
)
(
"ipFile"
,
po
::
value
<
string
>
(),
"File containing all the IPs of the remote islands)"
)
(
"migrationProbability"
,
po
::
value
<
float
>
(),
"Probability to send an individual each generation"
)
(
"outputfile"
,
po
::
value
<
string
>
(),
"Set an output file for the final population (default : none)"
)
(
"inputfile"
,
po
::
value
<
string
>
(),
"Set an input file for the initial population (default : none)"
)
(
"printStats"
,
po
::
value
<
int
>
(),
"Print the Stats (default : 1)"
)
...
...
libeasea/include/Parameters.h
View file @
876ad2d7
...
...
@@ -72,6 +72,7 @@ public:
//Parameters for the Island Model
bool
remoteIslandModel
;
char
*
ipFile
;
float
migrationProbability
;
char
*
outputFilename
;
char
*
plotOutputFilename
;
...
...
tpl/CMAES.tpl
View file @
876ad2d7
...
...
@@ -318,6 +318,7 @@ void ParametersImpl::setDefaultParameters(int argc, char** argv){
this->remoteIslandModel = setVariable("remoteIslandModel",\REMOTE_ISLAND_MODEL);
this->ipFile = (char*)setVariable("ipFile","\IP_FILE").c_str();
this->migrationProbability = setVariable("migrationProbability",(float)\MIGRATION_PROBABILITY);
}
CEvolutionaryAlgorithm* ParametersImpl::newEvolutionaryAlgorithm(){
...
...
@@ -655,4 +656,5 @@ easeaclean:
#### Remote Island Model ####
--remoteIslandModel=\REMOTE_ISLAND_MODEL #To initialize communications with remote AESAE's
--ipFile=\IP_FILE
--migrationProbability=\MIGRATION_PROBABILITY #Probability to send an individual every generation
\TEMPLATE_END
tpl/CUDA.tpl
View file @
876ad2d7
...
...
@@ -487,7 +487,7 @@ void ParametersImpl::setDefaultParameters(int argc, char** argv){
this->remoteIslandModel = setVariable("remoteIslandModel",\REMOTE_ISLAND_MODEL);
this->ipFile = (char*)setVariable("ipFile","\IP_FILE").c_str();
this->migrationProbability = setVariable("migrationProbability",(float)\MIGRATION_PROBABILITY);
}
...
...
@@ -880,4 +880,6 @@ clean:
#### Remote Island Model ####
--remoteIslandModel=\REMOTE_ISLAND_MODEL #To initialize communications with remote AESAE's
--ipFile=\IP_FILE
--migrationProbability=\MIGRATION_PROBABILITY #Probability to send an individual every generation
\TEMPLATE_END
tpl/CUDA_GP.tpl
View file @
876ad2d7
...
...
@@ -797,9 +797,15 @@ void ParametersImpl::setDefaultParameters(int argc, char** argv){
this->plotStats = setVariable("plotStats",\PLOT_STATS);
this->printInitialPopulation = setVariable("printInitialPopulation",0);
this->printFinalPopulation = setVariable("printFinalPopulation",0);
this->savePopulation = setVariable("savePopulation",\SAVE_POPULATION);
this->startFromFile = setVariable("startFromFile",\START_FROM_FILE);
this->outputFilename = (char*)"EASEA";
this->plotOutputFilename = (char*)"EASEA.png";
this->remoteIslandModel = setVariable("remoteIslandModel",\REMOTE_ISLAND_MODEL);
this->ipFile = (char*)setVariable("ipFile","\IP_FILE").c_str();
this->migrationProbability = setVariable("migrationProbability",(float)\MIGRATION_PROBABILITY);
}
CEvolutionaryAlgorithm* ParametersImpl::newEvolutionaryAlgorithm(){
...
...
@@ -822,9 +828,22 @@ CEvolutionaryAlgorithm* ParametersImpl::newEvolutionaryAlgorithm(){
}
void EvolutionaryAlgorithmImpl::initializeParentPopulation(){
for( unsigned int i=0 ; i
<
this->
params->parentPopulationSize ; i++){
this->population->addIndividualParentPopulation(new IndividualImpl());
}
if(this->params->startFromFile){
ifstream AESAE_File("EASEA.pop");
string AESAE_Line;
for( unsigned int i=0 ; i
<
this->
params->parentPopulationSize ; i++){
getline(AESAE_File, AESAE_Line);
this->population->addIndividualParentPopulation(new IndividualImpl(),i);
((IndividualImpl*)this->population->parents[i])->deserialize(AESAE_Line);
}
}
else{
for( unsigned int i=0 ; i
<
this->
params->parentPopulationSize ; i++){
this->population->addIndividualParentPopulation(new IndividualImpl(),i);
}
}
this->population->actualParentPopulationSize = this->params->parentPopulationSize;
}
...
...
@@ -1115,4 +1134,14 @@ easeaclean:
--generateCSV=\GENERATE_CSV_FILE
--generateGnuplotScript=\GENERATE_GNUPLOT_SCRIPT
--generateRScript=\GENERATE_R_SCRIPT
#### Population save ####
--savePopulation=\SAVE_POPULATION #save population to EASEA.pop file
--startFromFile=\START_FROM_FILE #start optimisation from EASEA.pop file
#### Remote Island Model ####
--remoteIslandModel=\REMOTE_ISLAND_MODEL #To initialize communications with remote AESAE's
--ipFile=\IP_FILE
--migrationProbability=\MIGRATION_PROBABILITY #Probability to send an individual every generation
\TEMPLATE_END
tpl/CUDA_MEM.tpl
View file @
876ad2d7
...
...
@@ -569,6 +569,7 @@ void ParametersImpl::setDefaultParameters(int argc, char** argv){
this->remoteIslandModel = setVariable("remoteIslandModel",\REMOTE_ISLAND_MODEL);
this->ipFile = (char*)setVariable("ipFile","\IP_FILE").c_str();
this->migrationProbability = setVariable("migrationProbability",(float)\MIGRATION_PROBABILITY);
}
CEvolutionaryAlgorithm* ParametersImpl::newEvolutionaryAlgorithm(){
...
...
@@ -979,4 +980,6 @@ clean:
#### Remote Island Model ####
--remoteIslandModel=\REMOTE_ISLAND_MODEL #To initialize communications with remote AESAE's
--ipFile=\IP_FILE
--migrationProbability=\MIGRATION_PROBABILITY #Probability to send an individual every generation
\TEMPLATE_END
tpl/STD.tpl
View file @
876ad2d7
...
...
@@ -312,6 +312,7 @@ void ParametersImpl::setDefaultParameters(int argc, char** argv){
this->remoteIslandModel = setVariable("remoteIslandModel",\REMOTE_ISLAND_MODEL);
this->ipFile = (char*)setVariable("ipFile","\IP_FILE").c_str();
this->migrationProbability = setVariable("migrationProbability",(float)\MIGRATION_PROBABILITY);
}
CEvolutionaryAlgorithm* ParametersImpl::newEvolutionaryAlgorithm(){
...
...
@@ -651,4 +652,5 @@ easeaclean:
#### Remote Island Model ####
--remoteIslandModel=\REMOTE_ISLAND_MODEL #To initialize communications with remote AESAE's
--ipFile=\IP_FILE
--migrationProbability=\MIGRATION_PROBABILITY #Probability to send an individual every generation
\TEMPLATE_END
tpl/STD_MEM.tpl
View file @
876ad2d7
...
...
@@ -337,6 +337,7 @@ void ParametersImpl::setDefaultParameters(int argc, char** argv){
this->remoteIslandModel = setVariable("remoteIslandModel",\REMOTE_ISLAND_MODEL);
this->ipFile = (char*)setVariable("ipFile","\IP_FILE").c_str();
this->migrationProbability = setVariable("migrationProbability",(float)\MIGRATION_PROBABILITY);
}
CEvolutionaryAlgorithm* ParametersImpl::newEvolutionaryAlgorithm(){
...
...
@@ -691,6 +692,7 @@ easeaclean:
--startFromFile=\START_FROM_FILE #start optimisation from EASEA.pop file
#### Remote Island Model ####
-
-remoteIslandModel=\REMOTE_ISLAND_MODEL #To initialize communications with remote AESAE's
a
-remoteIslandModel=\REMOTE_ISLAND_MODEL #To initialize communications with remote AESAE's
--ipFile=\IP_FILE
--migrationProbability=\MIGRATION_PROBABILITY #Probability to send an individual every generation
\TEMPLATE_END
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment