Commit a29bb010 authored by Joseph Pallamidessi's avatar Joseph Pallamidessi

Fix critical bug. The ip file name was set with a pointer of a stack memory...

Fix critical bug. The ip file name was set with a pointer of a stack memory adress. The result was undefined. This bug is present in all tpl file
parent 30698924
......@@ -301,7 +301,10 @@ 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();
std::string* ipFilename=new std::string();
*ipFilename=setVariable("ipFile","\IP_FILE");
this->ipFile =(char*)ipFilename->c_str();
this->migrationProbability = setVariable("migrationProbability",(float)\MIGRATION_PROBABILITY);
this->serverPort = setVariable("serverPort",\SERVER_PORT);
}
......@@ -310,7 +313,7 @@ CEvolutionaryAlgorithm* ParametersImpl::newEvolutionaryAlgorithm(){
pEZ_MUT_PROB = &pMutationPerGene;
pEZ_XOVER_PROB = &pCrossover;
EZ_NB_GEN = (unsigned*)setVariable("nbGen",\NB_GEN);
//EZ_NB_GEN = (unsigned*)setVariable("nbGen",\NB_GEN);
EZ_current_generation=0;
CEvolutionaryAlgorithm* ea = new EvolutionaryAlgorithmImpl(this);
......
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