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
63a34581
Commit
63a34581
authored
Sep 14, 2011
by
Frédéric Krüger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mise a jour des tel
parent
4d57f6a6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
163 additions
and
487 deletions
+163
-487
tpl/CMAES.tpl
tpl/CMAES.tpl
+29
-156
tpl/CUDA.tpl
tpl/CUDA.tpl
+8
-3
tpl/CUDA_GP.tpl
tpl/CUDA_GP.tpl
+64
-20
tpl/CUDA_MEM.tpl
tpl/CUDA_MEM.tpl
+6
-1
tpl/STD.tpl
tpl/STD.tpl
+25
-151
tpl/STD_MEM.tpl
tpl/STD_MEM.tpl
+31
-156
No files found.
tpl/CMAES.tpl
View file @
63a34581
\TEMPLATE_START
#ifdef WIN32
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(lib, "libEasea.lib")
#pragma comment(lib, "Winmm.lib")
#endif
/**
This is program entry for CMAES template for EASEA
...
...
@@ -54,25 +49,13 @@ int main(int argc, char** argv){
delete pop;
#ifdef WIN32
system("pause");
#endif
return 0;
}
\START_CUDA_GENOME_CU_TPL
#ifdef WIN32
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(lib, "libEasea.lib")
#endif
#include
<fstream>
#ifndef WIN32
#include
<sys
/
time.h
>
#else
#include
<time.h>
#endif
#include
<string>
#include
<sstream>
#include "CRandomGenerator.h"
...
...
@@ -162,6 +145,7 @@ IndividualImpl::IndividualImpl() : CIndividual() {
this-
>
\GENOME_NAME[i] = 0.5 + (cma->sigma * cma->rgD[i] * cma->alea.alea_Gauss());
}
valid = false;
isImmigrant = false;
}
CIndividual* IndividualImpl::clone(){
...
...
@@ -199,6 +183,7 @@ void IndividualImpl::deserialize(string Line){
\GENOME_DESERIAL
AESAE_Line >> this->fitness;
this->valid=true;
this->isImmigrant=false;
}
IndividualImpl::IndividualImpl(const IndividualImpl
&
genome){
...
...
@@ -212,6 +197,7 @@ IndividualImpl::IndividualImpl(const IndividualImpl& genome){
// Generic part
this->valid = genome.valid;
this->fitness = genome.fitness;
this->isImmigrant = false;
}
...
...
@@ -321,6 +307,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);
this->serverPort - setVariable("serverPort",\SERVER_PORT);
}
CEvolutionaryAlgorithm* ParametersImpl::newEvolutionaryAlgorithm(){
...
...
@@ -459,23 +446,34 @@ public:
UNAME
:=
$(shell
uname
)
ifeq
($(
shell
uname
-o
2
>
/dev/null),Msys)
OS := MINGW
endif
ifneq ("$(OS)","")
EZ_PATH=../../
endif
EASEALIB_PATH=$(EZ_PATH)libeasea/
CXXFLAGS = -O2 -g -Wall -fmessage-length=0 -I$(EASEALIB_PATH)include -I$(EZ_PATH)boost
#USER
MAKEFILE
OPTIONS
:
\
INSERT_MAKEFILE_OPTION#END
OF
USER
MAKEFILE
OPTIONS
OBJS = EASEA.o EASEAIndividual.o
LIBS = -lpthread
ifneq ("$(OS)","")
LIBS += -lws2_32 -lwinmm -L"C:\MinGW\lib"
endif
\INSERT_MAKEFILE_OPTION
#USER MAKEFILE OPTIONS :
\INSERT_MAKEFILE_OPTION#END OF USER MAKEFILE OPTIONS
TARGET = EASEA
$(TARGET): $(OBJS)
$(
CXX
)
-o
$(
TARGET
)
$(
OBJS
)
$(
L
IBS
)
-g
$(
EASEALIB_PATH
)
libeasea.a
$(
EZ_PATH
)
boost
/
program_options.a
$(CXX) -o $(TARGET) $(OBJS) $(L
DFLAGS) -g $(EASEALIB_PATH)libeasea.a $(EZ_PATH)boost/program_options.a $(LIBS)
#%.o:%.cpp
...
...
@@ -483,144 +481,18 @@ $(TARGET): $(OBJS)
all: $(TARGET)
clean:
ifneq ("$(OS)","")
-del $(OBJS) $(TARGET).exe
else
rm -f $(OBJS) $(TARGET)
endif
easeaclean:
rm
-f
$(
TARGET
)
*.o
*.cpp
*.hpp
EASEA.png
EASEA.dat
EASEA.prm
EASEA.mak
Makefile
EASEA.vcproj
EASEA.r
EASEA.plot
EASEA.csv
EASEA.plo
EASEA.pop
ifneq ("$(OS)","")
rm -f $(TARGET).exe *.o *.cpp *.hpp EASEA.png EASEA.dat EASEA.prm EASEA.mak Makefile EASEA.vcproj EASEA.r EASEA.plot EASEA.csv EASEA.plo EASEA.pop
else
-del $(TARGET) *.o *.cpp *.hpp EASEA.png EASEA.dat EASEA.prm EASEA.mak Makefile EASEA.vcproj EASEA.r EASEA.plot EASEA.csv EASEA.plo EASEA.pop
endif
\
START_VISUAL_TPL
<?
xml
version=
"1.0"
encoding=
"Windows-1252"
?
>
<VisualStudioProject
ProjectType=
"Visual C++"
Version=
"9,00"
Name=
"EASEA"
ProjectGUID=
"
{
E73D5A89
-
F262
-
4F0
E
-
A876
-
3
CF86175BC30
}
"
RootNamespace=
"EASEA"
Keyword=
"Win32Proj"
TargetFrameworkVersion=
"196613"
>
<Platforms>
<Platform
Name=
"Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name=
"Release|Win32"
OutputDirectory=
"$(SolutionDir)"
IntermediateDirectory=
"$(ConfigurationName)"
ConfigurationType=
"1"
CharacterSet=
"1"
WholeProgramOptimization=
"1"
>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCCLCompilerTool"
Optimization=
"2"
EnableIntrinsicFunctions=
"true"
AdditionalIncludeDirectories=
""\EZ_PATHlibEasea""
PreprocessorDefinitions=
"WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary=
"0"
EnableFunctionLevelLinking=
"true"
UsePrecompiledHeader=
"0"
WarningLevel=
"3"
DebugInformationFormat=
"3"
/>
<Tool
Name=
"VCManagedResourceCompilerTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCLinkerTool"
LinkIncremental=
"1"
AdditionalLibraryDirectories=
""\EZ_PATHlibEasea""
GenerateDebugInformation=
"true"
SubSystem=
"1"
OptimizeReferences=
"2"
EnableCOMDATFolding=
"2"
TargetMachine=
"1"
/>
<Tool
Name=
"VCALinkTool"
/>
<Tool
Name=
"VCManifestTool"
/>
<Tool
Name=
"VCXDCMakeTool"
/>
<Tool
Name=
"VCBscMakeTool"
/>
<Tool
Name=
"VCFxCopTool"
/>
<Tool
Name=
"VCAppVerifierTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name=
"Source Files"
Filter=
"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier=
"
{
4F
C737F1
-
C7A5
-
4376
-
A066
-
2
A32D752A2FF
}
"
>
<File
RelativePath=
".\EASEA.cpp"
>
</File>
<File
RelativePath=
".\EASEAIndividual.cpp"
>
</File>
</Filter>
<Filter
Name=
"Header Files"
Filter=
"h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier=
"
{
93995380
-
89
BD
-
4
b04
-
88
EB
-
625F
BE52EBFB
}
"
>
<File
RelativePath=
".\EASEAIndividual.hpp"
>
</File>
</Filter>
<Filter
Name=
"Resource Files"
Filter=
"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier=
"
{
67D
A6AB6
-
F800
-
4
c08
-
8
B7A
-
83
BB121AAD01
}
"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
\START_EO_PARAM_TPL#****************************************
#
...
...
@@ -662,4 +534,5 @@ easeaclean:
--remoteIslandModel=\REMOTE_ISLAND_MODEL #To initialize communications with remote AESAE's
--ipFile=\IP_FILE
--migrationProbability=\MIGRATION_PROBABILITY #Probability to send an individual every generation
--serverPort=\SERVER_PORT
\TEMPLATE_END
tpl/CUDA.tpl
View file @
63a34581
\
TEMPLATE_START
e
TEMPLATE_START
#ifdef WIN32
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(lib, "libEasea.lib")
...
...
@@ -272,6 +272,7 @@ IndividualImpl::IndividualImpl() : CIndividual() {
\
GENOME_CTOR
\
INSERT_EO_INITIALISER
valid =
false;
isImmigrant =
false;
}
CIndividual*
IndividualImpl::clone
(){
...
...
@@ -310,6 +311,7 @@ void IndividualImpl::deserialize(string Line){
\GENOME_DESERIAL
AESAE_Line >> this->fitness;
this->valid=true;
this->isImmigrant=false;
}
IndividualImpl::IndividualImpl(const IndividualImpl
&
genome){
...
...
@@ -323,6 +325,7 @@ IndividualImpl::IndividualImpl(const IndividualImpl& genome){
// Generic part
this->valid = genome.valid;
this->fitness = genome.fitness;
this->isImmigrant = false;
}
...
...
@@ -494,8 +497,9 @@ void ParametersImpl::setDefaultParameters(int argc, char** argv){
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);
this->ipFile = (char*)setVariable("ipFile","\IP_FILE").c_str();
this->migrationProbability = setVariable("migrationProbability",(float)\MIGRATION_PROBABILITY);
this->serverPort = setVariable("serverPort",\SERVER_PORT);
}
...
...
@@ -895,4 +899,5 @@ clean:
--remoteIslandModel=\REMOTE_ISLAND_MODEL #To initialize communications with remote AESAE's
--ipFile=\IP_FILE
--migrationProbability=\MIGRATION_PROBABILITY #Probability to send an individual every generation
--serverPort=\SERVER_PORT
\TEMPLATE_END
tpl/CUDA_GP.tpl
View file @
63a34581
...
...
@@ -87,8 +87,6 @@ int main(int argc, char** argv){
#include
<iostream>
#include
<sstream>
unsigned gNO_FITNESS_CASES=0;
unsigned aborded_crossover;
float* input_k;
float* output_k;
...
...
@@ -169,6 +167,23 @@ __device__ float eval_tree_gpu(unsigned fc_id, const float * k_progs, const floa
return stack[0];
}
int flattening_tree_rpn( GPNode* root, float* buf, int* index){
int i;
for( i=0 ; i
<opArity
[(
int
)
root-
>
opCode] ; i++ ){
flattening_tree_rpn(root->children[i],buf,index);
}
if( (*index)+2>MAX_PROGS_SIZE )return 0;
buf[(*index)++] = root->opCode;
if( root->opCode == OP_ERC ) buf[(*index)++] = root->erc_value;
return 1;
}
/**
Send input and output data on the GPU memory.
Allocate
...
...
@@ -223,7 +238,6 @@ EvaluatePostFixIndividuals_128(const float * k_progs,
const
int
tid =
threadIdx.x;
//0
to
NUM_THREADS-1
const
int
bid =
blockIdx.x;
//
0
to
NUM_BLOCKS-1
int
gNO_FITNESS_CASES =
trainingSetSize;
int
index
;
//
index
of
the
prog
processed
by
the
block
...
...
@@ -292,6 +306,40 @@ EvaluatePostFixIndividuals_128(const float * k_progs,
//
here
results
and
hits
have
been
stored
in
their
respective
array:
we
can
leave
}
GPNode*
pickNthNode
(
GPNode*
root
,
int
N
,
int*
childId
){
GPNode*
stack
[
TREE_DEPTH_MAX*MAX_ARITY
];
GPNode*
parentStack
[
TREE_DEPTH_MAX*MAX_ARITY
];
int
stackPointer =
0;
parentStack[stackPointer] =
NULL;
stack
[
stackPointer
++
] =
root;
for
(
int
i=
0
;
i
<
N
;
i
++
){
GPNode*
currentNode =
stack[stackPointer-1];
//
cout
<<
currentNode
<<
endl
;
stackPointer--
;
for
(
int
j=
opArity[currentNode-
>
opCode] ; j>0 ; j--){
parentStack[stackPointer] = currentNode;
stack[stackPointer++] = currentNode->children[j-1];
}
}
//assert(stackPointer>0);
if( stackPointer )
stackPointer--;
//cout
<
<
"
f
:
\
n
\
t
n
:
"
<<
stack
[
stackPointer
]
<<
"\
n
\
t
p
:
"
<<
parentStack
[
stackPointer
]
<<
"
cId
:
"
<<
\
//(
*childId
)
<<
endl
;
for
(
int
i=
0
;
i
<
opArity
[
parentStack
[
stackPointer
]
-
>
opCode] ; i++ ){
if( parentStack[stackPointer]->children[i]==stack[stackPointer] ){
(*childId)=i;
break;
}
}
return parentStack[stackPointer];
}
...
...
@@ -440,8 +488,8 @@ void simpleCrossOver(IndividualImpl& p1, IndividualImpl& p2, IndividualImpl& c){
if( Np1!=0 ) stockParentNode = pickNthNode(c.root, MIN(Np1,nbNodeP1) ,
&stockPointChildId
,TREE_DEPTH_MAX,MAX_ARITY
);
if( Np2!=0 ) graftParentNode = pickNthNode(p2.root, MIN(Np2,nbNodeP1) ,
&graftPointChildId
,TREE_DEPTH_MAX,MAX_ARITY
);
if( Np1!=0 ) stockParentNode = pickNthNode(c.root, MIN(Np1,nbNodeP1) ,
&stockPointChildId);
if( Np2!=0 ) graftParentNode = pickNthNode(p2.root, MIN(Np2,nbNodeP1) ,
&graftPointChildId);
// is the stock and the graft an authorized type of node (leaf or inner-node)
if( Np1
&&
!stockCouldBeTerminal
&&
opArity[stockParentNode->children[stockPointChildId]->opCode]==0 ) goto choose_node;
...
...
@@ -489,7 +537,7 @@ float IndividualImpl::evaluate(){
float sum = 0;
\INSERT_GENOME_EVAL_HDR
for( int i=0 ; i
<
g
NO_FITNESS_CASES
;
i
++
){
for( int i=0 ; i
<NO_FITNESS_CASES
;
i
++
){
float
EVOLVED_VALUE =
recEval(this-
>
root,inputs[i]);
\INSERT_GENOME_EVAL_BDY
sum += ERROR;
...
...
@@ -536,7 +584,7 @@ void evale_pop_chunk(CIndividual** population, int popSize){
int index = 0;
for( int i=0 ; i
<popSize
;
i
++
){
indexes[i] =
index;
flattening_tree_rpn
(
((
IndividualImpl*
)
population
[
i
])
-
>
root, progs,
&index
,MAX_PROGS_SIZE,OP_ERC
);
flattening_tree_rpn
(
((
IndividualImpl*
)
population
[
i
])
-
>
root, progs,
&index);
progs[index++] = OP_RETURN;
}
...
...
@@ -547,7 +595,7 @@ void evale_pop_chunk(CIndividual** population, int popSize){
cudaStreamCreate(
&st);
// Here we will do the real GPU evaluation
EvaluatePostFixIndividuals_128
<
<<
popSize
,128,0,
st
>
>>( progs_k, index, popSize, input_k, output_k,
g
NO_FITNESS_CASES, results_k, hits_k, indexes_k);
EvaluatePostFixIndividuals_128
<
<<
popSize
,128,0,
st
>
>>( progs_k, index, popSize, input_k, output_k, NO_FITNESS_CASES, results_k, hits_k, indexes_k);
CUDA_SAFE_CALL(cudaStreamSynchronize(st));
...
...
@@ -583,11 +631,11 @@ void EASEAInit(int argc, char** argv){
// load data from csv file.
cout
<
<"
Before
everything
else
function
called
"<<
endl
;
cout
<<
"
number
of
point
in
fitness
cases
set
:
"
<<
g
NO_FITNESS_CASES
<<
endl
;
cout
<<
"
number
of
point
in
fitness
cases
set
:
"
<<
NO_FITNESS_CASES
<<
endl
;
float*
inputs_f =
NULL;
flattenDatas2D
(
inputs
,
g
NO_FITNESS_CASES
,
VAR_LEN
,&
inputs_f
);
flattenDatas2D
(
inputs
,
NO_FITNESS_CASES
,
VAR_LEN
,&
inputs_f
);
indexes =
new
int
[
maxPopSize
];
hits =
new
int
[
maxPopSize
];
...
...
@@ -596,7 +644,7 @@ void EASEAInit(int argc, char** argv){
INSTEAD_EVAL_STEP=
true;
initialDataToGPU
(
inputs_f
,
gNO_FITNESS_CASES*VAR_LEN
,
outputs
,
g
NO_FITNESS_CASES
);
initialDataToGPU
(
inputs_f
,
NO_FITNESS_CASES*VAR_LEN
,
outputs
,
NO_FITNESS_CASES
);
}
...
...
@@ -795,11 +843,10 @@ void ParametersImpl::setDefaultParameters(int argc, char** argv){
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);
gNO_FITNESS_CASES = setVariable("fcSize",\FC_SIZE);
this->remoteIslandModel = setVariable("remoteIslandModel",\REMOTE_ISLAND_MODEL);
this->ipFile = (char*)setVariable("ipFile","\IP_FILE").c_str();
this->migrationProbability = setVariable("migrationProbability",(float)\MIGRATION_PROBABILITY);
this->serverPort = setVariable("serverPort",\SERVER_PORT);
}
CEvolutionaryAlgorithm* ParametersImpl::newEvolutionaryAlgorithm(){
...
...
@@ -854,8 +901,6 @@ EvolutionaryAlgorithmImpl::~EvolutionaryAlgorithmImpl(){
#ifndef PROBLEM_DEP_H
#define PROBLEM_DEP_H
extern unsigned gNO_FITNESS_CASES;
\INSERT_GP_PARAMETERS
//#include "CRandomGenerator.h"
...
...
@@ -1103,7 +1148,6 @@ easeaclean:
#
#***************************************
# --seed=0 # -S : Random number seed. It is possible to give a specific seed.
--fcSize=\FC_SIZE
###### Evolution Engine ######
--popSize=\POP_SIZE # -P : Population Size
...
...
@@ -1144,5 +1188,5 @@ easeaclean:
--remoteIslandModel=\REMOTE_ISLAND_MODEL #To initialize communications with remote AESAE's
--ipFile=\IP_FILE
--migrationProbability=\MIGRATION_PROBABILITY #Probability to send an individual every generation
--serverPort=\SERVER_PORT
\TEMPLATE_END
tpl/CUDA_MEM.tpl
View file @
63a34581
...
...
@@ -173,6 +173,7 @@ IndividualImpl::IndividualImpl() : CIndividual() {
\GENOME_CTOR
\INSERT_EO_INITIALISER
valid = false;
isImmigrant = false;
}
CIndividual* IndividualImpl::clone(){
...
...
@@ -210,6 +211,7 @@ void IndividualImpl::deserialize(string Line){
\GENOME_DESERIAL
AESAE_Line >> this->fitness;
this->valid=true;
this->isImmigrant=false;
}
void IndividualImpl::optimise(int currentIteration){
...
...
@@ -228,6 +230,7 @@ IndividualImpl::IndividualImpl(const IndividualImpl& genome){
// Generic part
this->valid = genome.valid;
this->fitness = genome.fitness;
this->isImmgrant = false;
}
...
...
@@ -570,8 +573,9 @@ void ParametersImpl::setDefaultParameters(int argc, char** argv){
this->plotOutputFilename = (char*)"EASEA.png";
this->remoteIslandModel = setVariable("remoteIslandModel",\REMOTE_ISLAND_MODEL);
this->ipFile = (char*)setVariable("ipFile","\IP_FILE").c_str();
this->ipFile = (char*)setVariable("ipFile","\IP_FILE").c_str();
this->migrationProbability = setVariable("migrationProbability",(float)\MIGRATION_PROBABILITY);
this->serverPort = setVariable("serverPort",\SERVER_PORT);
}
CEvolutionaryAlgorithm* ParametersImpl::newEvolutionaryAlgorithm(){
...
...
@@ -987,4 +991,5 @@ clean:
--remoteIslandModel=\REMOTE_ISLAND_MODEL #To initialize communications with remote AESAE's
--ipFile=\IP_FILE
--migrationProbability=\MIGRATION_PROBABILITY #Probability to send an individual every generation
--serverPort=\SERVER_PORT
\TEMPLATE_END
tpl/STD.tpl
View file @
63a34581
\TEMPLATE_START
#ifdef WIN32
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(lib, "libEasea.lib")
#pragma comment(lib, "Winmm.lib")
#endif
/**
This is program entry for STD template for EASEA
...
...
@@ -52,24 +47,13 @@ int main(int argc, char** argv){
delete pop;
#ifdef WIN32
system("pause");
#endif
return 0;
}
\START_CUDA_GENOME_CU_TPL
#ifdef WIN32
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(lib, "libEasea.lib")
#endif
#include
<fstream>
#ifndef WIN32
#include
<sys
/
time.h
>
#else
#include
<time.h>
#endif
#include
<string>
#include
<sstream>
#include "CRandomGenerator.h"
...
...
@@ -129,6 +113,7 @@ IndividualImpl::IndividualImpl() : CIndividual() {
\GENOME_CTOR
\INSERT_EO_INITIALISER
valid = false;
isImmigrant = false;
}
CIndividual* IndividualImpl::clone(){
...
...
@@ -166,6 +151,7 @@ void IndividualImpl::deserialize(string Line){
\GENOME_DESERIAL
AESAE_Line >> this->fitness;
this->valid=true;
this->isImmigrant = false;
}
IndividualImpl::IndividualImpl(const IndividualImpl
&
genome){
...
...
@@ -179,6 +165,7 @@ IndividualImpl::IndividualImpl(const IndividualImpl& genome){
// Generic part
this->valid = genome.valid;
this->fitness = genome.fitness;
this->isImmigrant = false;
}
...
...
@@ -316,6 +303,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);
this->serverPort = setVariable("serverPort",\SERVER_PORT);
}
CEvolutionaryAlgorithm* ParametersImpl::newEvolutionaryAlgorithm(){
...
...
@@ -448,9 +436,16 @@ public:
\
START_CUDA_MAKEFILE_TPL
UNAME
:=
$(shell
uname
)
ifeq
($(
shell
uname
-o
2
>
/dev/null),Msys)
OS := MINGW
endif
ifneq ("$(OS)","")
EZ_PATH=../../
endif
EASEALIB_PATH=$(EZ_PATH)/libeasea/
CXXFLAGS = -O2 -g -Wall -fmessage-length=0 -I$(EASEALIB_PATH)include -I$(EZ_PATH)boost
...
...
@@ -458,6 +453,9 @@ CXXFLAGS = -O2 -g -Wall -fmessage-length=0 -I$(EASEALIB_PATH)include -I$(EZ_PATH
OBJS = EASEA.o EASEAIndividual.o
LIBS = -lpthread
ifneq ("$(OS)","")
LIBS += -lws2_32 -lwinmm -L"C:\MinGW\lib"
endif
#USER MAKEFILE OPTIONS :
\INSERT_MAKEFILE_OPTION
...
...
@@ -466,7 +464,7 @@ LIBS = -lpthread
TARGET = EASEA
$(TARGET): $(OBJS)
$(
CXX
)
-o
$(
TARGET
)
$(
OBJS
)
$(
LDFLAGS
)
$(
LIBS
)
-g
$(
EASEALIB_PATH
)/
libeasea.a
$(
EZ_PATH
)
boost
/
program_options.a
$(CXX) -o $(TARGET) $(OBJS) $(LDFLAGS)
-g $(EASEALIB_PATH)/libeasea.a $(EZ_PATH)boost/program_options.a $(LIBS)
#%.o:%.cpp
...
...
@@ -474,142 +472,17 @@ $(TARGET): $(OBJS)
all: $(TARGET)
clean:
ifneq ("$(OS)","")
-del $(OBJS) $(TARGET).exe
else
rm -f $(OBJS) $(TARGET)
endif
easeaclean:
ifneq ("$(OS)","")
-del $(TARGET).exe *.o *.cpp *.hpp EASEA.png EASEA.dat EASEA.prm EASEA.mak Makefile EASEA.vcproj EASEA.csv EASEA.r EASEA.plot EASEA.pop
else
rm -f $(TARGET) *.o *.cpp *.hpp EASEA.png EASEA.dat EASEA.prm EASEA.mak Makefile EASEA.vcproj EASEA.csv EASEA.r EASEA.plot EASEA.pop
\
START_VISUAL_TPL
<?
xml
version=
"1.0"
encoding=
"Windows-1252"
?
>
<VisualStudioProject
ProjectType=
"Visual C++"
Version=
"9,00"
Name=
"EASEA"
ProjectGUID=
"
{
E73D5A89
-
F262
-
4F0
E
-
A876
-
3
CF86175BC30
}
"
RootNamespace=
"EASEA"
Keyword=
"Win32Proj"
TargetFrameworkVersion=
"196613"
>
<Platforms>
<Platform
Name=
"Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name=
"Release|Win32"
OutputDirectory=
"$(SolutionDir)"
IntermediateDirectory=
"$(ConfigurationName)"
ConfigurationType=
"1"
CharacterSet=
"1"
WholeProgramOptimization=
"1"
>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCCustomBuildTool"