Commit 3c1f3c0a authored by Joseph Pallamidessi's avatar Joseph Pallamidessi

Merge branch 'osx' of ssh://git.code.sf.net/p/easea/code into osx

parents c756a18e 2fb93f25
......@@ -11,6 +11,7 @@ CPPFLAGS = -Iinclude/
LIB_NAME=libalex.so
STATIC_LIB_NAME = libalex.a
#all:$(STATIC_LIB_NAME) $(LIB_NAME)
$(STATIC_LIB_NAME): $(OBJS)
ar -r $@ $(OBJS) && ranlib $@
......@@ -19,7 +20,7 @@ $(LIB_NAME): $(OBJS)
$(CXX) -shared -o $@ $^
%.o:%.cpp
$(CXX) $(CPPFLAGS) -fpic -c $<
$(CXX) $(CPPFLAGS) -c $<
clean:
rm -f *.o $(LIB_NAME) $(STATIC_LIB_NAME)
......@@ -389,7 +389,7 @@ void CEvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){
if(currentGeneration==0)
printf("GEN\tTIME\t\tEVAL\t\tBEST AVG STDDEV WORST\n\n");
#ifdef WIN32
printf("%lu\t%2.6f\t%lu\t%.2e\t%.2e\t%.2e\t%.2e\n",currentGeneration,duration,population->currentEvaluationNb,population->Best->getFitness(),this->cstats->currentAverageFitness,this->cstats->currentStdDev, population->Worst->getFitness());
printf("%u\t%2.6f\t%u\t%.2e\t%.2e\t%.2e\t%.2e\n",currentGeneration,duration,population->currentEvaluationNb,population->Best->getFitness(),this->cstats->currentAverageFitness,this->cstats->currentStdDev, population->Worst->getFitness());
#else
//printf("%d\t%ld.%01ld\t%d\t%.2e\t%.2e\t%.2e\t%.2e\n",(int)currentGeneration,res.tv_sec,res.tv_usec,(int)population->currentEvaluationNb,population->Best->getFitness(),currentAverageFitness,currentSTDEV, population->Worst->getFitness());
printf("%d\t%ld.%d\t\t%d\t\t%.2e %.2e %.2e %.2e\n",(int)currentGeneration,res.tv_sec,(int)res.tv_usec/10000,(int)population->currentEvaluationNb,population->Best->getFitness(),this->cstats->currentAverageFitness,this->cstats->currentStdDev, population->Worst->getFitness());
......@@ -405,7 +405,7 @@ void CEvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){
if(currentGeneration==0)
fprintf(f,"#GEN\tTIME\t\tEVAL\tBEST\t\tAVG\t\tSTDDEV\t\tWORST\n\n");
#ifdef WIN32
fprintf(f,"%lu\t%2.6f\t%lu\t%.2e\t%.2e\t%.2e\t%.2e\n",currentGeneration,duration,population->currentEvaluationNb,population->Best->getFitness(),this->cstats->currentAverageFitness,this->cstats->currentStdDev, population->Worst->getFitness());
fprintf(f,"%u\t%2.6f\t%u\t%.2e\t%.2e\t%.2e\t%.2e\n",currentGeneration,duration,population->currentEvaluationNb,population->Best->getFitness(),this->cstats->currentAverageFitness,this->cstats->currentStdDev, population->Worst->getFitness());
#else
//printf("%d\t%ld.%01ld\t%d\t%.2e\t%.2e\t%.2e\t%.2e\n",(int)currentGeneration,res.tv_sec,res.tv_usec,(int)population->currentEvaluationNb,population->Best->getFitness(),currentAverageFitness,currentSTDEV, population->Worst->getFitness());
fprintf(f,"%d\t%ld.%d\t\t%d\t\t%.2e %.2e %.2e %.2e\n",(int)currentGeneration,res.tv_sec,(int)res.tv_usec/10000,(int)population->currentEvaluationNb,population->Best->getFitness(),this->cstats->currentAverageFitness,this->cstats->currentStdDev, population->Worst->getFitness());
......@@ -422,7 +422,7 @@ void CEvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){
if(currentGeneration==0)
fprintf(f,"GEN,TIME,EVAL,BEST,AVG,STDDEV,WORST\n");
#ifdef WIN32
fprintf(f,"%lu\t%2.6f\t%lu\t%.2e\t%.2e\t%.2e\t%.2e\n",currentGeneration,duration,population->currentEvaluationNb,population->Best->getFitness(),this->cstats->currentAverageFitness,this->cstats->currentStdDev, population->Worst->getFitness());
fprintf(f,"%u\t%2.6f\t%u\t%.2e\t%.2e\t%.2e\t%.2e\n",currentGeneration,duration,population->currentEvaluationNb,population->Best->getFitness(),this->cstats->currentAverageFitness,this->cstats->currentStdDev, population->Worst->getFitness());
#else
//printf("%d\t%ld.%01ld\t%d\t%.2e\t%.2e\t%.2e\t%.2e\n",(int)currentGeneration,res.tv_sec,res.tv_usec,(int)population->currentEvaluationNb,population->Best->getFitness(),currentAverageFitness,currentSTDEV, population->Worst->getFitness());
fprintf(f,"%d\t%ld.%d\t\t%d\t\t%.2e %.2e %.2e %.2e\n",(int)currentGeneration,res.tv_sec,(int)res.tv_usec/10000,(int)population->currentEvaluationNb,population->Best->getFitness(),this->cstats->currentAverageFitness,this->cstats->currentStdDev, population->Worst->getFitness());
......
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