Commit 12a5e569 authored by kruger's avatar kruger

Correction d'erreurs mineures et mise a jour des tpl

parent 5e121a27
......@@ -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
......
......@@ -292,7 +292,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(){
......
......@@ -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,7 +282,7 @@ 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);
......@@ -477,7 +479,7 @@ easeaclean:
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories=""\EZ_PATHlibEasea""
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);
}
......@@ -411,7 +413,7 @@ void ParametersImpl::setDefaultParameters(int argc, char** argv){
this->elitSize = 0;
offspringReduction = parentReduction = false;
offspringReduction = parentReduction = false;
generationalCriterion = new CGenerationalCriterion(setVariable("nbGen",(int)\NB_GEN));
controlCStopingCriterion = new CControlCStopingCriterion();
......@@ -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
/**
This is program entry for STD template for EASEA
......@@ -79,7 +80,7 @@ int main(int argc, char** argv){
using namespace std;
#include "EASEAIndividual.hpp"
bool INSTEAD_EVAL_STEP = false;
CRandomGenerator* globalRandomGenerator;
......@@ -126,11 +127,6 @@ void cudaPreliminaryProcess(size_t populationSize, dim3* dimBlock, dim3* dimGrid
\INSERT_BOUND_CHECKING
void evale_pop_chunk(CIndividual** population, int popSize){
printf("evalPopChunk\n");
\INSTEAD_EVAL_FUNCTION
}
void EASEAInit(int argc, char** argv){
\INSERT_INIT_FCT_CALL
}
......@@ -418,7 +414,7 @@ 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);
......@@ -655,7 +651,7 @@ clean:
Name="CUDA Build Rule"
Include="\EZ_PATHlibEasea"
Keep="false"
Runtime="2"
Runtime="0"
/>
<Tool
Name="VCXMLDataGeneratorTool"
......@@ -672,7 +668,7 @@ clean:
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="&quot;\EZ_PATHlibEasea&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
......@@ -795,7 +791,7 @@ clean:
--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 STD template for EASEA
......@@ -281,7 +282,7 @@ 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);
......@@ -470,7 +471,7 @@ easeaclean:
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="&quot;\EZ_PATHlibEasea&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
......@@ -592,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
\TEMPLATE_END
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