Commit 82a6c009 authored by Joseph Pallamidessi's avatar Joseph Pallamidessi

Change csv formatting to be more standard and consistent which close #15

parent fcc3bc1a
......@@ -422,10 +422,10 @@ void CEvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){
if(currentGeneration==0)
fprintf(f,"GEN,TIME,EVAL,BEST,AVG,STDDEV,WORST\n");
#ifdef WIN32
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());
fprintf(f,"%u,%2.6f,%u,%.2e,%.2e,%.2e,%.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());
fprintf(f,"%d,%ld.%d,%d,%.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());
#endif
fclose(f);
}
......
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