00001 /* 00002 * <FlowShopEA.cpp> 00003 * Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 00004 * (C) OPAC Team, LIFL, 2002-2007 00005 * 00006 * Arnaud Liefooghe 00007 * 00008 * This software is governed by the CeCILL license under French law and 00009 * abiding by the rules of distribution of free software. You can use, 00010 * modify and/ or redistribute the software under the terms of the CeCILL 00011 * license as circulated by CEA, CNRS and INRIA at the following URL 00012 * "http://www.cecill.info". 00013 * 00014 * As a counterpart to the access to the source code and rights to copy, 00015 * modify and redistribute granted by the license, users are provided only 00016 * with a limited warranty and the software's author, the holder of the 00017 * economic rights, and the successive licensors have only limited liability. 00018 * 00019 * In this respect, the user's attention is drawn to the risks associated 00020 * with loading, using, modifying and/or developing or reproducing the 00021 * software by the user in light of its specific status of free software, 00022 * that may mean that it is complicated to manipulate, and that also 00023 * therefore means that it is reserved for developers and experienced 00024 * professionals having in-depth computer knowledge. Users are therefore 00025 * encouraged to load and test the software's suitability as regards their 00026 * requirements in conditions enabling the security of their systems and/or 00027 * data to be ensured and, more generally, to use and operate it in the 00028 * same conditions as regards security. 00029 * The fact that you are presently reading this means that you have had 00030 * knowledge of the CeCILL license and that you accept its terms. 00031 * 00032 * ParadisEO WebSite : http://paradiseo.gforge.inria.fr 00033 * Contact: paradiseo-help@lists.gforge.inria.fr 00034 * 00035 */ 00036 //----------------------------------------------------------------------------- 00037 00038 00039 // moeo general include 00040 #include <moeo> 00041 // for the creation of an evaluator 00042 #include <make_eval_FlowShop.h> 00043 // for the creation of an initializer 00044 #include <make_genotype_FlowShop.h> 00045 // for the creation of the variation operators 00046 #include <make_op_FlowShop.h> 00047 // how to initialize the population 00048 #include <do/make_pop.h> 00049 // the stopping criterion 00050 #include <do/make_continue_moeo.h> 00051 // outputs (stats, population dumps, ...) 00052 #include <do/make_checkpoint_moeo.h> 00053 // evolution engine (selection and replacement) 00054 #include <do/make_ea_moeo.h> 00055 // simple call to the algo 00056 #include <do/make_run.h> 00057 // checks for help demand, and writes the status file and make_help; in libutils 00058 void make_help(eoParser & _parser); 00059 // definition of the representation 00060 #include <FlowShop.h> 00061 00062 00063 using namespace std; 00064 00065 00066 int main(int argc, char* argv[]) 00067 { 00068 try 00069 { 00070 00071 eoParser parser(argc, argv); // for user-parameter reading 00072 eoState state; // to keep all things allocated 00073 00074 00075 /*** the representation-dependent things ***/ 00076 00077 // The fitness evaluation 00078 eoEvalFuncCounter<FlowShop>& eval = do_make_eval(parser, state); 00079 // the genotype (through a genotype initializer) 00080 eoInit<FlowShop>& init = do_make_genotype(parser, state); 00081 // the variation operators 00082 eoGenOp<FlowShop>& op = do_make_op(parser, state); 00083 00084 00085 /*** the representation-independent things ***/ 00086 00087 // initialization of the population 00088 eoPop<FlowShop>& pop = do_make_pop(parser, state, init); 00089 // definition of the archive 00090 moeoArchive<FlowShop> arch; 00091 // stopping criteria 00092 eoContinue<FlowShop>& term = do_make_continue_moeo(parser, state, eval); 00093 // output 00094 eoCheckPoint<FlowShop>& checkpoint = do_make_checkpoint_moeo(parser, state, eval, term, pop, arch); 00095 // algorithm 00096 eoAlgo<FlowShop>& algo = do_make_ea_moeo(parser, state, eval, checkpoint, op, arch); 00097 00098 00099 /*** Go ! ***/ 00100 00101 // help ? 00102 make_help(parser); 00103 00104 // first evalution (for printing) 00105 apply<FlowShop>(eval, pop); 00106 00107 // printing of the initial population 00108 cout << "Initial Population\n"; 00109 pop.sortedPrintOn(cout); 00110 cout << endl; 00111 00112 // run the algo 00113 algo(pop); 00114 00115 // printing of the final population 00116 cout << "Final Population\n"; 00117 pop.sortedPrintOn(cout); 00118 cout << endl; 00119 00120 // printing of the final archive 00121 cout << "Final Archive\n"; 00122 arch.sortedPrintOn(cout); 00123 cout << endl; 00124 00125 00126 } 00127 catch (exception& e) 00128 { 00129 cout << e.what() << endl; 00130 } 00131 return EXIT_SUCCESS; 00132 }
1.4.7