indent all
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@232 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
afae4c1eca
commit
c8049ca6cd
51 changed files with 3899 additions and 3898 deletions
|
|
@ -10,7 +10,7 @@
|
|||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Miscilaneous include and declaration
|
||||
// Miscilaneous include and declaration
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
|
@ -41,78 +41,78 @@ void make_help(eoParser & _parser);
|
|||
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
try {
|
||||
|
||||
eoParser parser(argc, argv); // for user-parameter reading
|
||||
eoState state; // to keep all things allocated
|
||||
try {
|
||||
|
||||
eoParser parser(argc, argv); // for user-parameter reading
|
||||
eoState state; // to keep all things allocated
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*** the representation-dependent things ***/
|
||||
/*** the representation-dependent things ***/
|
||||
|
||||
// The fitness evaluation
|
||||
eoEvalFuncCounter<FlowShop>& eval = do_make_eval(parser, state);
|
||||
// the genotype (through a genotype initializer)
|
||||
eoInit<FlowShop>& init = do_make_genotype(parser, state);
|
||||
// the variation operators
|
||||
eoGenOp<FlowShop>& op = do_make_op(parser, state);
|
||||
// The fitness evaluation
|
||||
eoEvalFuncCounter<FlowShop>& eval = do_make_eval(parser, state);
|
||||
// the genotype (through a genotype initializer)
|
||||
eoInit<FlowShop>& init = do_make_genotype(parser, state);
|
||||
// the variation operators
|
||||
eoGenOp<FlowShop>& op = do_make_op(parser, state);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*** the representation-independent things ***/
|
||||
/*** the representation-independent things ***/
|
||||
|
||||
// initialization of the population
|
||||
eoPop<FlowShop>& pop = do_make_pop(parser, state, init);
|
||||
// definition of the archive
|
||||
moeoArchive<FlowShop> arch;
|
||||
// stopping criteria
|
||||
eoContinue<FlowShop>& term = do_make_continue_moeo(parser, state, eval);
|
||||
// output
|
||||
eoCheckPoint<FlowShop>& checkpoint = do_make_checkpoint_moeo(parser, state, eval, term, pop, arch);
|
||||
// algorithm
|
||||
eoAlgo<FlowShop>& algo = do_make_ea_moeo(parser, state, eval, checkpoint, op, arch);
|
||||
|
||||
// initialization of the population
|
||||
eoPop<FlowShop>& pop = do_make_pop(parser, state, init);
|
||||
// definition of the archive
|
||||
moeoArchive<FlowShop> arch;
|
||||
// stopping criteria
|
||||
eoContinue<FlowShop>& term = do_make_continue_moeo(parser, state, eval);
|
||||
// output
|
||||
eoCheckPoint<FlowShop>& checkpoint = do_make_checkpoint_moeo(parser, state, eval, term, pop, arch);
|
||||
// algorithm
|
||||
eoAlgo<FlowShop>& algo = do_make_ea_moeo(parser, state, eval, checkpoint, op, arch);
|
||||
|
||||
|
||||
|
||||
|
||||
/*** Go ! ***/
|
||||
|
||||
// help ?
|
||||
make_help(parser);
|
||||
/*** Go ! ***/
|
||||
|
||||
// first evalution
|
||||
apply<FlowShop>(eval, pop);
|
||||
|
||||
pop.sort();
|
||||
arch.update(pop);
|
||||
// help ?
|
||||
make_help(parser);
|
||||
|
||||
// printing of the initial population
|
||||
cout << "Initial Population\n";
|
||||
pop.sortedPrintOn(cout);
|
||||
cout << endl;
|
||||
// first evalution
|
||||
apply<FlowShop>(eval, pop);
|
||||
|
||||
// run the algo
|
||||
do_run(algo, pop);
|
||||
|
||||
// printing of the final population
|
||||
cout << "Final Population\n";
|
||||
pop.sortedPrintOn(cout);
|
||||
cout << endl;
|
||||
pop.sort();
|
||||
arch.update(pop);
|
||||
|
||||
// printing of the final archive
|
||||
cout << "Final Archive\n";
|
||||
arch.sortedPrintOn(cout);
|
||||
cout << endl;
|
||||
// printing of the initial population
|
||||
cout << "Initial Population\n";
|
||||
pop.sortedPrintOn(cout);
|
||||
cout << endl;
|
||||
|
||||
// run the algo
|
||||
do_run(algo, pop);
|
||||
|
||||
// printing of the final population
|
||||
cout << "Final Population\n";
|
||||
pop.sortedPrintOn(cout);
|
||||
cout << endl;
|
||||
|
||||
// printing of the final archive
|
||||
cout << "Final Archive\n";
|
||||
arch.sortedPrintOn(cout);
|
||||
cout << endl;
|
||||
|
||||
|
||||
|
||||
} catch(exception& e) {
|
||||
cout << e.what() << endl;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
} catch (exception& e) {
|
||||
cout << e.what() << endl;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue