update cpp

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@390 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
liefooga 2007-06-26 12:20:58 +00:00
commit 7c09edb725

View file

@ -10,19 +10,15 @@
*/ */
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Miscilaneous include and declaration
using namespace std;
/* EO + MOEO */
// moeo general include // moeo general include
#include <moeo> #include <moeo>
// for the creation of an evaluator // for the creation of an evaluator
#include "make_eval_FlowShop.h" #include <make_eval_FlowShop.h>
// for the creation of an initializer // for the creation of an initializer
#include "make_genotype_FlowShop.h" #include <make_genotype_FlowShop.h>
// for the creation of the variation operators // for the creation of the variation operators
#include "make_op_FlowShop.h" #include <make_op_FlowShop.h>
// how to initialize the population // how to initialize the population
#include <do/make_pop.h> #include <do/make_pop.h>
// the stopping criterion // the stopping criterion
@ -35,21 +31,22 @@ using namespace std;
#include <do/make_run.h> #include <do/make_run.h>
// checks for help demand, and writes the status file and make_help; in libutils // checks for help demand, and writes the status file and make_help; in libutils
void make_help(eoParser & _parser); void make_help(eoParser & _parser);
/* FLOW-SHOP */ // definition of the representation
// definition of representation #include <FlowShop.h>
#include "FlowShop.h"
int main(int argc, char* argv[]) { using namespace std;
try {
int main(int argc, char* argv[])
{
try
{
eoParser parser(argc, argv); // for user-parameter reading eoParser parser(argc, argv); // for user-parameter reading
eoState state; // to keep all things allocated eoState state; // to keep all things allocated
/*** the representation-dependent things ***/ /*** the representation-dependent things ***/
// The fitness evaluation // The fitness evaluation
@ -60,9 +57,6 @@ int main(int argc, char* argv[]) {
eoGenOp<FlowShop>& op = do_make_op(parser, state); eoGenOp<FlowShop>& op = do_make_op(parser, state);
/*** the representation-independent things ***/ /*** the representation-independent things ***/
// initialization of the population // initialization of the population
@ -77,9 +71,6 @@ int main(int argc, char* argv[]) {
eoAlgo<FlowShop>& algo = do_make_ea_moeo(parser, state, eval, checkpoint, op, arch); eoAlgo<FlowShop>& algo = do_make_ea_moeo(parser, state, eval, checkpoint, op, arch);
/*** Go ! ***/ /*** Go ! ***/
// help ? // help ?
@ -88,9 +79,6 @@ int main(int argc, char* argv[]) {
// first evalution // first evalution
apply<FlowShop>(eval, pop); apply<FlowShop>(eval, pop);
pop.sort();
arch.update(pop);
// printing of the initial population // printing of the initial population
cout << "Initial Population\n"; cout << "Initial Population\n";
pop.sortedPrintOn(cout); pop.sortedPrintOn(cout);
@ -110,8 +98,9 @@ int main(int argc, char* argv[]) {
cout << endl; cout << endl;
}
} catch (exception& e) { catch (exception& e)
{
cout << e.what() << endl; cout << e.what() << endl;
} }
return EXIT_SUCCESS; return EXIT_SUCCESS;