Commit 9189089b authored by maitre's avatar maitre

Merge branch 'master' of ssh+git://easea-dev@atia/home/easea-dev/src

Conflicts:
	libeasea/CEvolutionaryAlgorithm.cpp
	tpl/STD.tpl
parents c1487e2d 12a5e569
......@@ -26,7 +26,7 @@ Centre de Math
bool genomeSizeValidity=false;
int lineCounter = 0;
// local functions
// local functions
char* selectorDetermination(int nMINIMISE, char* sSELECTOR){
char selectorName[50];
......@@ -75,7 +75,7 @@ Centre de Math
%start COPY_EO_INITIALISER
%start COPY COPY_INITIALISER COPY_CROSSOVER COPY_MUTATOR COPY_EVALUATOR COPY_FINALIZATION_FUNCTION
%start COPY_DISPLAY COPY_USER_FUNCTION COPY_USER_GENERATION PARAMETERS_ANALYSIS GET_PARAMETERS
%start COPY_USER_FUNCTIONS COPY_GENERATION_FUNCTION_BEFORE_REPLACEMENT GET_METHODS COPY_MAKEFILE_OPTION COPY_BOUND_CHECKING_FUNCTION COPY_BEG_GENERATION_FUNCTION COPY_END_GENERATION_FUNCTION COPY_INSTEAD_EVAL
%start COPY_USER_FUNCTIONS COPY_GENERATION_FUNCTION_BEFORE_REPLACEMENT GET_METHODS COPY_MAKEFILE_OPTION COPY_BOUND_CHECKING_FUNCTION COPY_BEG_GENERATION_FUNCTION COPY_END_GENERATION_FUNCTION
// lexical analyser name and class definition
%name CEASEALexer {
......@@ -187,15 +187,6 @@ exponent ([Ee][+-]?[0-9]+)
}
<TEMPLATE_ANALYSIS>"\\INSTEAD_EVAL_FUNCTION" {
//DEBUG_PRT_PRT("insert beg");
yyreset();
yyin = fpGenomeFile;
if (bVERBOSE) printf ("Evaluation population in a single function!!.\n");
BEGIN COPY_INSTEAD_EVAL;
}
<TEMPLATE_ANALYSIS>"\\INSERT_END_GENERATION_FUNCTION" {
//DEBUG_PRT_PRT("insert end");
if (bVERBOSE) printf ("Inserting at the end of each generation function.\n");
......@@ -506,7 +497,7 @@ exponent ([Ee][+-]?[0-9]+)
if (bVERBOSE) printf ("Inserting user functions.\n");
yyreset();
yyin = fpGenomeFile;
lineCounter=2; // switch to .ez file and analyser
lineCounter=1; // switch to .ez file and analyser
BEGIN COPY_USER_FUNCTIONS;
}
<TEMPLATE_ANALYSIS>"\\INSERT_EO_INITIALISER" {
......@@ -540,13 +531,11 @@ exponent ([Ee][+-]?[0-9]+)
<TEMPLATE_ANALYSIS>"\\INSERT_MUTATOR" {
yyreset();
yyin = fpGenomeFile; // switch to .ez file and analyser
lineCounter=1;
BEGIN COPY_MUTATOR;
}
<TEMPLATE_ANALYSIS>"\\INSERT_EVALUATOR" {
yyreset();
yyin = fpGenomeFile; // switch to .ez file and analyser
lineCounter=1;
BEGIN COPY_EVALUATOR;
}
......@@ -554,7 +543,6 @@ exponent ([Ee][+-]?[0-9]+)
yyreset();
yyin = fpGenomeFile; // switch to .ez file and analyser
bWithinCUDA_Evaluator = 1;
lineCounter=1;
BEGIN COPY_EVALUATOR;
}
......@@ -975,29 +963,6 @@ if(OPERATING_SYSTEM=WINDOWS)
}
}
<COPY_INSTEAD_EVAL>"\\Instead"[ \t\n]+"evaluation"[ \t\n]+"function:" {
//DEBUG_PRT_PRT("at each beg");
if( (TARGET==CUDA || TARGET==STD)){
fprintf (fpOutputFile,"{\n");
bFunction=1;
BEGIN COPY_USER_GENERATION;
}
}
<COPY_INSTEAD_EVAL>.|\n {}
<COPY_INSTEAD_EVAL><<EOF>> {
bBeginGenerationFunction=0; // No Generation function was found in the .ez file
if (bVERBOSE) printf("*** No Instead evaluation step function was found. ***\n");
fprintf(fpOutputFile,"\n// No Instead evaluation step function.\n");
rewind(fpGenomeFile);
yyin = fpTemplateFile;
BEGIN TEMPLATE_ANALYSIS;
bNotFinishedYet=1;
}
<COPY_BEG_GENERATION_FUNCTION><<EOF>> {
bBeginGenerationFunction=0; // No Generation function was found in the .ez file
if (bVERBOSE) printf("*** No beginning generation function was found. ***\n");
......@@ -1339,23 +1304,16 @@ if(OPERATING_SYSTEM=WINDOWS)
<COPY_CROSSOVER>\n {lineCounter++;}
<COPY_MUTATOR>"\\GenomeClass::mutator"[ \t\n]*":" {
bWithinMutator=1;
if( bLINE_NUM_EZ_FILE )
fprintf(fpOutputFile,"#line %d \"%s.ez\"\n",lineCounter, sRAW_PROJECT_NAME);
BEGIN COPY_USER_FUNCTION;
return USER_MUTATOR;
}
<COPY_MUTATOR>. {}
<COPY_MUTATOR>\n {lineCounter++;}
<COPY_MUTATOR>.|\n {}
<COPY_EVALUATOR>"\\GenomeClass::evaluator"[ \t\n]*":" {
BEGIN COPY_USER_FUNCTION;
bWithinEvaluator=1;
if( bLINE_NUM_EZ_FILE )
fprintf(fpOutputFile,"#line %d \"%s.ez\"\n",lineCounter, sRAW_PROJECT_NAME);
return USER_EVALUATOR;
}
<COPY_EVALUATOR>. {}
<COPY_EVALUATOR>\n {lineCounter++;}
<COPY_EVALUATOR>.|\n {}
//****************************************
// Basic copy to .cpp file with major changes
......@@ -1685,7 +1643,7 @@ if(OPERATING_SYSTEM=WINDOWS)
<GET_PARAMETERS>"Print"[ \t\n]+"stats"[ \t\n]*":"[\t\n]* {if (bVERBOSE) printf("\tPrint Stats...\n");return PRINT_STATS;}
<GET_PARAMETERS>"Plot"[ \t\n]+"stats"[ \t\n]*":"[\t\n]* {if (bVERBOSE) printf("\tPlot Stats with gnuplot...\n");return PLOT_STATS;}
<GET_PARAMETERS>"Generate"[ \t\n]+"cvs"[ \t\n]+"stats"[ \t\n]+"file"[ \t\n]*":"[ \t\n]* {if (bVERBOSE) printf("\tPrint Stats to cvs File...\n");return GENERATE_CVS_FILE;}
<GET_PARAMETERS>"Generate"[ \t\n]+"csv"[ \t\n]+"stats"[ \t\n]+"file"[ \t\n]*":"[ \t\n]* {if (bVERBOSE) printf("\tPrint Stats to cvs File...\n");return GENERATE_CVS_FILE;}
<GET_PARAMETERS>"Generate"[ \t\n]+"gnuplot"[ \t\n]+"script"[ \t\n]*":"[ \t\n]* {if (bVERBOSE) printf("\tGenerate Gnuplot Script...\n");return GENERATE_GNUPLOT_SCRIPT;}
<GET_PARAMETERS>"Generate"[ \t\n]+"R"[ \t\n]+"script"[ \t\n]*":"[ \t\n]* {if (bVERBOSE) printf("\tGenerate R Script...\n");return GENERATE_R_SCRIPT;}
......
......@@ -114,7 +114,9 @@ CPPFLAGS+=
Elitism: Strong //Weak or Strong
Elite: 5
Print stats:1 //Default: 1
Print stats to file:0
Generate csv stats file:0
Generate gnuplot script:0
Generate R script:0
Plot stats:0 //Default: 0
\end
*_________________________________________________________
/*_________________________________________________________
Test functions
__________________________________________________________*/
......@@ -119,7 +119,9 @@ LIBS+=
Elitism: Strong //Weak or Strong
Elite: 5
Print stats:1 //Default: 1
Print stats to file:0
Generate csv stats file:0
Generate gnuplot script:0
Generate R script:0
Plot stats:0 //Default: 0
\end
......@@ -165,7 +165,7 @@ CPPFLAGS+=
Print stats:1 //Default: 1
Plot stats:0 //Default: 0
Generate cvs stats file:0
Generate csv stats file:0
Generate gnuplot script:0
Generate R script:0
......
......@@ -167,7 +167,7 @@ CPPFLAGS+=
Elitism: Strong //Weak or Strong
Elite: 1
Print stats:1 //Default: 1
Generate cvs stats file:0
Generate csv stats file:0
Generate gnuplot script:0
Generate R script:0
Plot stats:0 //Default: 0
......
#ifdef WIN32
#pragma comment(lib, "WinMM.lib")
#endif
/*
* CEvolutionaryAlgorithm.cpp
*
......@@ -15,8 +13,8 @@
#endif
#ifdef WIN32
#include <windows.h>
#endif
#include <time.h>
#endif
#include <math.h>
#include <string>
#include "include/CIndividual.h"
......@@ -31,9 +29,6 @@ extern CEvolutionaryAlgorithm* EA;
void EASEABeginningGenerationFunction(CEvolutionaryAlgorithm* evolutionaryAlgorithm);
void EASEAEndGenerationFunction(CEvolutionaryAlgorithm* evolutionaryAlgorithm);
void EASEAGenerationFunctionBeforeReplacement(CEvolutionaryAlgorithm* evolutionaryAlgorithm);
extern void evale_pop_chunk(CIndividual** pop, int popSize);
extern bool INSTEAD_EVAL_STEP;
/**
* @DEPRECATED the next contructor has to be used instead of this one.
*/
......@@ -115,19 +110,19 @@ void CEvolutionaryAlgorithm::runEvolutionaryLoop(){
std::cout << "Parent's population initializing "<< std::endl;
this->initializeParentPopulation();
if(!INSTEAD_EVAL_STEP)
this->population->evaluateParentPopulation();
else
evale_pop_chunk(population->parents, population->parentPopulationSize);
this->population->currentEvaluationNb += this->params->parentPopulationSize;
if(this->params->printInitialPopulation){
std::cout << *population << std::endl;
}
#ifdef WIN32
clock_t begin(clock());
#else
struct timeval begin;
gettimeofday(&begin,NULL);
#endif
//Initialize elitPopulation
if(params->elitSize)
......@@ -138,10 +133,9 @@ void CEvolutionaryAlgorithm::runEvolutionaryLoop(){
EASEABeginningGenerationFunction(this);
population->produceOffspringPopulation();
if(!INSTEAD_EVAL_STEP)
population->evaluateOffspringPopulation();
else
evale_pop_chunk(population->offsprings, population->offspringPopulationSize);
population->currentEvaluationNb += this->params->offspringPopulationSize;
EASEAGenerationFunctionBeforeReplacement(this);
......@@ -168,9 +162,8 @@ void CEvolutionaryAlgorithm::runEvolutionaryLoop(){
population->reduceTotalPopulation(elitistPopulation);
population->sortParentPopulation();
showPopulationStats(begin);
bBest = population->Best;
EASEAEndGenerationFunction(this);
currentGeneration += 1;
......@@ -198,7 +191,12 @@ void CEvolutionaryAlgorithm::runEvolutionaryLoop(){
}
#ifdef WIN32
void CEvolutionaryAlgorithm::showPopulationStats(clock_t beginTime){
#else
void CEvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){
#endif
float currentAverageFitness=0.0;
float currentSTDEV=0.0;
......@@ -223,27 +221,43 @@ void CEvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){
currentSTDEV/=population->parentPopulationSize;
currentSTDEV=sqrt(currentSTDEV);
#ifdef WIN32
clock_t end(clock());
double duration;
duration = (double)(end-beginTime)/CLOCKS_PER_SEC;
#else
struct timeval end, res;
gettimeofday(&end,0);
timersub(&end,&beginTime,&res);
#endif
//Affichage
if(params->printStats){
if(currentGeneration==0)
printf("GEN\tTIME\t\tEVAL\tBEST\t\tAVG\t\tSTDEV\n\n");
#ifdef WIN32
printf("%lu\t%2.6f\t%lu\t%.15e\t%.15e\t%.15e\n",currentGeneration,duration,population->currentEvaluationNb,population->Best->getFitness(),currentAverageFitness,currentSTDEV);
#else
printf("%lu\t%ld.%06ld\t%lu\t%.15e\t%.15e\t%.15e\n",currentGeneration,res.tv_sec,res.tv_usec,population->currentEvaluationNb,population->Best->getFitness(),currentAverageFitness,currentSTDEV);
#endif
//printf("%lu\t%ld.%06ld\t%lu\t%f\t%f\t%f\n",currentGeneration,res.tv_sec,res.tv_usec,population->currentEvaluationNb,population->Best->getFitness(),currentAverageFitness,currentSTDEV);
}
if((this->params->plotStats && this->gnuplot->valid) || this->params->generateGnuplotScript){
FILE *f;
string fichier (params->outputFilename);
fichier.append(".dat");
f = fopen(fichier.c_str(),"a"); //ajouter .dat
f = fopen(params->outputFilename,"a"); //ajouter .dat
if(f!=NULL){
if(currentGeneration==0)
fprintf(f,"#GEN\tTIME\t\tEVAL\tBEST\t\tAVG\t\tSTDEV\n\n");
#ifdef WIN32
fprintf(f,"%lu\t%2.6f\t%lu\t%.15e\t%.15e\t%.15e\n",currentGeneration,duration,population->currentEvaluationNb,population->Best->getFitness(),currentAverageFitness,currentSTDEV);
#else
fprintf(f,"%lu\t%ld.%06ld\t%lu\t%.15e\t%.15e\t%.15e\n",currentGeneration,res.tv_sec,res.tv_usec,population->currentEvaluationNb,population->Best->getFitness(),currentAverageFitness,currentSTDEV);
#endif
fclose(f);
}
}
......@@ -255,7 +269,13 @@ void CEvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){
if(f!=NULL){
if(currentGeneration==0)
fprintf(f,"GEN,TIME,EVAL,BEST,AVG,STDEV\n");
#ifdef WIN32
fprintf(f,"%lu,%2.6f,%lu,%.15e,%.15e,%.15e\n",currentGeneration,duration,population->currentEvaluationNb,population->Best->getFitness(),currentAverageFitness,currentSTDEV);
#else
fprintf(f,"%lu,%ld.%06ld,%lu,%.15e,%.15e,%.15e\n",currentGeneration,res.tv_sec,res.tv_usec,population->currentEvaluationNb,population->Best->getFitness(),currentAverageFitness,currentSTDEV);
#endif
fclose(f);
}
}
......@@ -263,7 +283,7 @@ void CEvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){
#ifdef __linux__
if(this->params->plotStats && this->gnuplot->valid){
if(currentGeneration==0)
fprintf(this->gnuplot->fWrit,"plot \'%s.dat\' using 3:4 t \'Best Fitness\' w lines, \'%s.dat\' using 3:5 t \'Average\' w lines, \'%s.dat\' using 3:6 t \'StdDev\' w lines\n", params->outputFilename,params->outputFilename,params->outputFilename);
fprintf(this->gnuplot->fWrit,"plot \'%s\' using 3:4 t \'Best Fitness\' w lines, \'%s\' using 3:5 t \'Average\' w lines, \'%s\' using 3:6 t \'StdDev\' w lines\n", params->outputFilename,params->outputFilename,params->outputFilename);
else
fprintf(this->gnuplot->fWrit,"replot\n");
fflush(this->gnuplot->fWrit);
......@@ -271,7 +291,12 @@ void CEvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){
#endif
#ifdef WIN32
params->timeCriterion->setElapsedTime(duration);
#else
params->timeCriterion->setElapsedTime(res.tv_sec);
#endif
}
void CEvolutionaryAlgorithm::outputGraph(){
......@@ -326,27 +351,3 @@ bool CEvolutionaryAlgorithm::allCriteria(){
}
return false;
}
#ifdef WIN32
int gettimeofday
(struct timeval* tp, void* tzp) {
DWORD t;
t = timeGetTime();
tp->tv_sec = t / 1000;
tp->tv_usec = t % 1000;
/* 0 indicates success. */
return 0;
}
void timersub( const timeval * tvp, const timeval * uvp, timeval* vvp )
{
vvp->tv_sec = tvp->tv_sec - uvp->tv_sec;
vvp->tv_usec = tvp->tv_usec - uvp->tv_usec;
if( vvp->tv_usec < 0 )
{
--vvp->tv_sec;
vvp->tv_usec += 1000000;
}
}
#endif
......@@ -4,8 +4,7 @@
* Created on: 22 juin 2009
* Author: maitre
*/
#include <boost/program_options.hpp>
#include "boost/program_options.hpp"
#include <iostream>
namespace po = boost::program_options;
......@@ -137,7 +136,7 @@ void parseArguments(const char* parametersFileName, int ac, char** av,
("inputfile",po::value<string>(),"Set an input file for the initial population (default : none)")
("printStats",po::value<int>(),"Print the Stats (default : 1)")
("plotStats",po::value<int>(),"Plot the Stats with gnuplot (default : 0)")
("generateCSV",po::value<int>(),"Print the Stats to a CSV File (Filename: ProjectName.csv) (default : 0)")
("generateCSVFile",po::value<int>(),"Print the Stats to a CSV File (Filename: ProjectName.dat) (default : 0)")
("generateGnuplotScript",po::value<int>(),"Generates a Gnuplot script to plat the Stats (Filename: ProjectName.plot) (default : 0)")
("generateRScript",po::value<int>(),"Generates a R script to plat the Stats (Filename: ProjectName.r) (default : 0)")
// ("printStatsFile",po::value<int>(),"Print the Stats to a File (Filename: ProjectName.dat) (default : 0)")
......
......@@ -8,7 +8,6 @@
#include "include/CStoppingCriterion.h"
#include <iostream>
#include <signal.h>
#include "include/global.h"
#include "include/CEvolutionaryAlgorithm.h"
/* ****************************************
......@@ -93,19 +92,3 @@ void signal_handler(int sig){
}
/* ****************************************
Goal stopping criterion class
****************************************/
CGoalCriterion::CGoalCriterion( double goal, bool minimize ){
this->goal = goal;
this->minimize = minimize;
}
bool CGoalCriterion::reached(){
if( minimize ){
//printf("bf : %f\n",bBest->fitness);
return bBest->fitness <= goal;
}
else
return bBest->fitness >= goal;
}
......@@ -9,6 +9,7 @@
#define CEVOLUTIONARYALGORITHM_H_
#include <stdlib.h>
#include <string>
#include <time.h>
#include "CEvolutionaryAlgorithm.h"
#include "CSelectionOperator.h"
#include "CPopulation.h"
......@@ -46,7 +47,11 @@ public:
size_t reduceParents;
size_t reduceOffsprings;
#ifdef WIN32
void showPopulationStats(clock_t beginTime);
#else
void showPopulationStats(struct timeval beginTime);
#endif
void generateGnuplotScript();
void generateRScript();
......@@ -61,9 +66,4 @@ public:
std::string* inputfile;
};
#ifdef WIN32
int gettimeofday(struct timeval* tp, void* tzp);
void timersub( const timeval * tvp, const timeval * uvp, timeval* vvp );
#endif
#endif /* CEVOLUTIONARYALGORITHM_H_ */
......@@ -58,19 +58,6 @@ class CTimeCriterion : public CStoppingCriterion {
void setElapsedTime(size_t elapsedTime);
};
/* ****************************************
Goal stopping criterion class
****************************************/
class CGoalCriterion : public CStoppingCriterion {
private:
double goal;
bool minimize;
public:
virtual bool reached();
CGoalCriterion( double goal, bool minimize );
};
/* ****************************************
ControlCStopingCriterion class
****************************************/
......
......@@ -14,7 +14,7 @@
//#define true 1;
//#define false 0;
class CIndividual;
class CRandomGenerator;
extern CIndividual** pPopulation;
extern CIndividual* bBest;
extern float* pEZ_MUT_PROB;
......
......@@ -2,6 +2,7 @@
#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
......@@ -28,6 +29,7 @@ float* pEZ_MUT_PROB = NULL;
float* pEZ_XOVER_PROB = NULL;
size_t *EZ_NB_GEN;
size_t *EZ_current_generation;
CEvolutionaryAlgorithm* EA;
CCmaes *cma;
//CMA cma;
......@@ -85,7 +87,7 @@ using namespace std;
CRandomGenerator* globalRandomGenerator;
extern CEvolutionaryAlgorithm* EA;
#define STD_TPL
\INSERT_USER_DECLARATIONS
......@@ -280,14 +282,14 @@ void ParametersImpl::setDefaultParameters(int argc, char** argv){
this->randomGenerator = globalRandomGenerator;
this->printStats = setVariable("printStats",\PRINT_STATS);
this->generateCVSFile = setVariable("generateCVSFile",\GENERATE_CVS_FILE);
this->generateCVSFile = setVariable("generateCSVFile",\GENERATE_CVS_FILE);
this->generateGnuplotScript = setVariable("generateGnuplotScript",\GENERATE_GNUPLOT_SCRIPT);
this->generateRScript = setVariable("generateRScript",\GENERATE_R_SCRIPT);
this->plotStats = setVariable("plotStats",\PLOT_STATS);
this->printInitialPopulation = setVariable("printInitialPopulation",0);
this->printFinalPopulation = setVariable("printFinalPopulation",0);
this->outputFilename = (char*)"EASEA";
this->outputFilename = (char*)"EASEA.dat";
this->plotOutputFilename = (char*)"EASEA.png";
}
......@@ -477,7 +479,7 @@ easeaclean:
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="&quot;\EZ_PATHlibEasea&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
......@@ -591,7 +593,7 @@ easeaclean:
--plotStats=\PLOT_STATS #plot Stats with gnuplot (requires Gnuplot)
--printInitialPopulation=0 #Print initial population
--printFinalPopulation=0 #Print final population
--generateCVSFile=\GENERATE_CVS_FILE
--generateCSVFile=\GENERATE_CVS_FILE
--generateGnuplotScript=\GENERATE_GNUPLOT_SCRIPT
--generateRScript=\GENERATE_R_SCRIPT
......
......@@ -2,6 +2,7 @@
#ifdef WIN32
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(lib, "libEasea.lib")
#pragma comment(lib, "Winmm.lib")
#endif
/**
This is program entry for CMAES_CUDA template for EASEA
......@@ -28,6 +29,7 @@ float* pEZ_MUT_PROB = NULL;
float* pEZ_XOVER_PROB = NULL;
size_t *EZ_NB_GEN;
size_t *EZ_current_generation;
CEvolutionaryAlgorithm *EA;
CCmaesCuda *cma;
......@@ -88,7 +90,7 @@ using namespace std;
CRandomGenerator* globalRandomGenerator;
extern CEvolutionaryAlgorithm* EA;
#define CUDA_TPL
void* d_offspringPopulationcuda;
......@@ -138,7 +140,7 @@ void EASEAInit(int argc, char** argv){
}
void EASEAFinal(CPopulation* pop){
\INSERT_FINALIZATION_FCT_CALL
\INSERT_FINALIZATION_FCT_CALL;
delete(cma);
}
......@@ -230,7 +232,7 @@ CIndividual* IndividualImpl::crossover(CIndividual** ps){
IndividualImpl** tmp = (IndividualImpl**)ps;
IndividualImpl parent1(*this);
IndividualImpl parent2(*tmp[0]);
IndividualImpl child(*this);
IndividualImpl child1(*this);
////DEBUG_PRT("Xover");
/* cout << "p1 : " << parent1 << endl; */
......@@ -241,9 +243,9 @@ CIndividual* IndividualImpl::crossover(CIndividual** ps){
for(int i=0; i<\PROBLEM_DIM; ++i)
cma->rgdTmp[i] = (float)(cma->rgD[i] * cma->alea.alea_Gauss());
child.valid = false;
/* cout << "child : " << child << endl; */
return new IndividualImpl(child);
child1.valid = false;
/* cout << "child1 : " << child1 << endl; */
return new IndividualImpl(child1);
}
......@@ -423,7 +425,9 @@ void ParametersImpl::setDefaultParameters(int argc, char** argv){
this->randomGenerator = globalRandomGenerator;
this->printStats = setVariable("printStats",\PRINT_STATS);
this->printStatsFile = setVariable("printStatsFile",\PRINT_STATS_FILE);
this->generateCVSFile = setVariable("generateCSVFile",\GENERATE_CVS_FILE);
this->generateGnuplotScript = setVariable("generateGnuplotScript",\GENERATE_GNUPLOT_SCRIPT);
this->generateRScript = setVariable("generateRScript",\GENERATE_R_SCRIPT);
this->plotStats = setVariable("plotStats",\PLOT_STATS);
this->printInitialPopulation = setVariable("printInitialPopulation",0);
this->printFinalPopulation = setVariable("printFinalPopulation",0);
......@@ -617,7 +621,7 @@ $(BIN):$(OBJ)
$(NVCC) $(NVCCFLAGS) -o $@ $< -c -DTIMING $(CPPFLAGS) -g -Xcompiler -Wall
easeaclean: clean
rm -f Makefile EASEA.prm $(SRC) $(HDR) EASEA.mak $(CUDA_SRC) *.linkinfo EASEA.png EASEA.dat EASEA.vcproj EASEA.plot EASEA.r EASEA.csv
rm -f Makefile EASEA.prm $(SRC) $(HDR) EASEA.mak $(CUDA_SRC) *.linkinfo EASEA.png EASEA.dat EASEA.vcproj
clean:
rm -f $(OBJ) $(BIN)
......@@ -660,7 +664,7 @@ clean:
Name="CUDA Build Rule"
Include="\EZ_PATHlibEasea"
Keep="false"
Runtime="2"
Runtime="0"
/>
<Tool
Name="VCXMLDataGeneratorTool"
......@@ -677,7 +681,7 @@ clean:
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="&quot;\EZ_PATHlibEasea&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
......@@ -792,7 +796,8 @@ clean:
--plotStats=\PLOT_STATS #plot Stats with gnuplot (requires Gnuplot)
--printInitialPopulation=0 #Print initial population
--printFinalPopulation=0 #Print final population
--printStatsFile=\PRINT_STATS_FILE #Print stats to File (filename: ProjetName.dat)
--generateCSVFile=\GENERATE_CVS_FILE
--generateGnuplotScript=\GENERATE_GNUPLOT_SCRIPT
--generateRScript=\GENERATE_R_SCRIPT
\TEMPLATE_END
......@@ -2,6 +2,7 @@
#ifdef WIN32
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(lib, "libEasea.lib")
#pragma comment(lib, "Winmm.lib")
#endif