Small modifications
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1366 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
1e73f201b9
commit
dd70ee8222
2 changed files with 29 additions and 7 deletions
|
|
@ -22,7 +22,7 @@ RandomNr *rn;
|
|||
//Sequences *seq;
|
||||
long seed;
|
||||
//vector<phylotreeIND> arbores;
|
||||
string datafile,usertree, expid, path;
|
||||
string datafile,usertree, expid, path, algotype;
|
||||
double pcrossover, pmutation, kappa, alpha;
|
||||
unsigned int ngenerations, popsize, ncats;
|
||||
ofstream exp_data,evolution_data, best_media_scores, final_trees, final_pareto_trees, clades_pareto, clades_final,final_scores,pareto_scores;
|
||||
|
|
@ -47,6 +47,7 @@ int main(int argc, char *argv[])
|
|||
datafile = parser.createParam(string(), "data", "Datafile", 'd',"Param").value();
|
||||
usertree = parser.createParam(string(), "treef", "Treefile", 't',"Param").value();
|
||||
path = parser.createParam(string(), "path", "Treefile", 'p',"Param").value();
|
||||
algotype = parser.createParam(string("nsgaii"), "algo", "Algorith, Type", 'b',"Param").value();
|
||||
ostringstream convert;
|
||||
convert << seed;
|
||||
expid = parser.createParam(convert.str(), "expid", "Experiment ID", 'e',"Param").value();
|
||||
|
|
@ -158,9 +159,20 @@ int main(int argc, char *argv[])
|
|||
|
||||
// apply<PhyloMOEO> ( byobj, population );
|
||||
// population.printOn(cout);
|
||||
moeoNSGAII2 < PhyloMOEO > nsgaII (cp, byobj, operadores);
|
||||
|
||||
nsgaII(population);
|
||||
if(algotype == "ibea")
|
||||
{
|
||||
moeoAdditiveEpsilonBinaryMetric < ObjectiveVector > metric;
|
||||
moeoIBEA < PhyloMOEO > algo (cp, byobj, operadores, metric);
|
||||
cout << "\n\nRunning IBEA ..." << endl;
|
||||
algo(population);
|
||||
}
|
||||
else
|
||||
{
|
||||
moeoNSGAII < PhyloMOEO > algo (cp, byobj, operadores);
|
||||
cout << "\n\nRunning NSGA-II ..." << endl;
|
||||
algo(population);
|
||||
|
||||
}
|
||||
|
||||
cout << "\nCalculating Final Solutions...";
|
||||
cout << " done\n";
|
||||
|
|
|
|||
|
|
@ -31,10 +31,11 @@ void Step_LikOptimizer::optimize()
|
|||
oldroot = invalid_node;
|
||||
|
||||
// calculate conditional likelihood
|
||||
double likinit=Lik_calc->calculate_likelihood();
|
||||
//cout << "likelihood inicial" << Lik_calc->calculate_likelihood() << endl;
|
||||
|
||||
graph::edge_iterator it_end = tree_ptr->TREE.edges_end();
|
||||
|
||||
int niterations=0;
|
||||
double sum,aux;
|
||||
do{
|
||||
it = tree_ptr->TREE.edges_begin();
|
||||
|
|
@ -70,9 +71,18 @@ void Step_LikOptimizer::optimize()
|
|||
oldroot = a;
|
||||
++it;
|
||||
}
|
||||
cout << '.';
|
||||
if(niterations>=30)
|
||||
{
|
||||
if(niterations == 30)cout << "\n probable problematic tree we will print the sum value for ten iterations more and quit this tree\n";
|
||||
cout << sum << endl;
|
||||
}
|
||||
else cout << '.';
|
||||
cout.flush();
|
||||
}while(sum>=0.0001);
|
||||
niterations++;
|
||||
|
||||
}while(sum>=0.0001 && niterations<40);
|
||||
double likfin = Lik_calc->calculate_likelihood();
|
||||
cout << likinit << " -->" << likfin << endl;
|
||||
//cout << "\nlikelihood final" << Lik_calc->calculate_likelihood() << endl;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue