EvolvingObjects
|
00001 // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- 00002 00003 //----------------------------------------------------------------------------- 00004 // es.h 00005 // (c) Maarten Keijzer, Marc Schoenauer and GeNeura Team, 2001 00006 /* 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Lesser General Public 00009 License as published by the Free Software Foundation; either 00010 version 2 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public 00018 License along with this library; if not, write to the Free Software 00019 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 00021 Contact: todos@geneura.ugr.es, http://geneura.ugr.es 00022 Marc.Schoenauer@polytechnique.fr 00023 mkeijzer@dhi.dk 00024 */ 00025 //----------------------------------------------------------------------------- 00026 00044 #ifndef es_h 00045 #define es_h 00046 00047 #include <eoAlgo.h> 00048 #include <eoScalarFitness.h> 00049 #include <utils/eoParser.h> 00050 #include <eoEvalFuncPtr.h> 00051 #include <eoEvalFuncCounter.h> 00052 #include <utils/eoCheckPoint.h> 00053 #include <eoGenOp.h> 00054 #include <eoPop.h> 00055 #include <utils/eoDistance.h> 00056 00057 #include <es/eoEsSimple.h> // one Sigma per individual 00058 #include <es/eoEsStdev.h> // one sigmal per object variable 00059 #include <es/eoEsFull.h> // full correlation matrix per indi 00060 00061 // include all similar declaration for eoReal - i.e. real-valued genotyes 00062 // without self-adaptation 00063 #include <es/make_real.h> 00064 00069 //Representation dependent - rewrite everything anew for each representation 00071 // the genotypes 00072 eoRealInitBounded<eoEsSimple<double> > & make_genotype(eoParser& _parser, eoState& _state, eoEsSimple<double> _eo); 00073 eoRealInitBounded<eoEsSimple<eoMinimizingFitness> > & make_genotype(eoParser& _parser, eoState& _state, eoEsSimple<eoMinimizingFitness> _eo); 00074 00075 eoRealInitBounded<eoEsStdev<double> > & make_genotype(eoParser& _parser, eoState& _state, eoEsStdev<double> _eo); 00076 eoRealInitBounded<eoEsStdev<eoMinimizingFitness> > & make_genotype(eoParser& _parser, eoState& _state, eoEsStdev<eoMinimizingFitness> _eo); 00077 00078 eoRealInitBounded<eoEsFull<double> > & make_genotype(eoParser& _parser, eoState& _state, eoEsFull<double> _eo); 00079 eoRealInitBounded<eoEsFull<eoMinimizingFitness> > & make_genotype(eoParser& _parser, eoState& _state, eoEsFull<eoMinimizingFitness> _eo); 00080 00081 00082 00083 // the operators 00084 eoGenOp<eoEsSimple<double> >& make_op(eoParser& _parser, eoState& _state, eoRealInitBounded<eoEsSimple<double> >& _init); 00085 eoGenOp<eoEsSimple<eoMinimizingFitness> >& make_op(eoParser& _parser, eoState& _state, eoRealInitBounded<eoEsSimple<eoMinimizingFitness> >& _init); 00086 eoGenOp<eoEsStdev<double> >& make_op(eoParser& _parser, eoState& _state, eoRealInitBounded<eoEsStdev<double> >& _init); 00087 eoGenOp<eoEsStdev<eoMinimizingFitness> >& make_op(eoParser& _parser, eoState& _state, eoRealInitBounded<eoEsStdev<eoMinimizingFitness> >& _init); 00088 eoGenOp<eoEsFull<double> >& make_op(eoParser& _parser, eoState& _state, eoRealInitBounded<eoEsFull<double> >& _init); 00089 eoGenOp<eoEsFull<eoMinimizingFitness> >& make_op(eoParser& _parser, eoState& _state, eoRealInitBounded<eoEsFull<eoMinimizingFitness> >& _init); 00090 00091 //Representation INdependent 00093 // you don't need to modify that part even if you use your own representation 00094 00095 // init pop 00096 eoPop<eoEsSimple<double> >& make_pop(eoParser& _parser, eoState& _state, eoInit<eoEsSimple<double> >&); 00097 eoPop<eoEsSimple<eoMinimizingFitness> >& make_pop(eoParser& _parser, eoState& _state, eoInit<eoEsSimple<eoMinimizingFitness> >&); 00098 00099 eoPop<eoEsStdev<double> >& make_pop(eoParser& _parser, eoState& _state, eoInit<eoEsStdev<double> >&); 00100 eoPop<eoEsStdev<eoMinimizingFitness> >& make_pop(eoParser& _parser, eoState& _state, eoInit<eoEsStdev<eoMinimizingFitness> >&); 00101 00102 eoPop<eoEsFull<double> >& make_pop(eoParser& _parser, eoState& _state, eoInit<eoEsFull<double> >&); 00103 eoPop<eoEsFull<eoMinimizingFitness> >& make_pop(eoParser& _parser, eoState& _state, eoInit<eoEsFull<eoMinimizingFitness> >&); 00104 00105 // the continue's 00106 eoContinue<eoEsSimple<double> >& make_continue(eoParser& _parser, eoState& _state, eoEvalFuncCounter<eoEsSimple<double> > & _eval); 00107 eoContinue<eoEsSimple<eoMinimizingFitness> >& make_continue(eoParser& _parser, eoState& _state, eoEvalFuncCounter<eoEsSimple<eoMinimizingFitness> > & _eval); 00108 00109 eoContinue<eoEsStdev<double> >& make_continue(eoParser& _parser, eoState& _state, eoEvalFuncCounter<eoEsStdev<double> > & _eval); 00110 eoContinue<eoEsStdev<eoMinimizingFitness> >& make_continue(eoParser& _parser, eoState& _state, eoEvalFuncCounter<eoEsStdev<eoMinimizingFitness> > & _eval); 00111 00112 eoContinue<eoEsFull<double> >& make_continue(eoParser& _parser, eoState& _state, eoEvalFuncCounter<eoEsFull<double> > & _eval); 00113 eoContinue<eoEsFull<eoMinimizingFitness> >& make_continue(eoParser& _parser, eoState& _state, eoEvalFuncCounter<eoEsFull<eoMinimizingFitness> > & _eval); 00114 00115 // the checkpoint 00116 eoCheckPoint<eoEsSimple<double> >& make_checkpoint(eoParser& _parser, eoState& _state, eoEvalFuncCounter<eoEsSimple<double> >& _eval, eoContinue<eoEsSimple<double> >& _continue); 00117 eoCheckPoint<eoEsSimple<eoMinimizingFitness> >& make_checkpoint(eoParser& _parser, eoState& _state, eoEvalFuncCounter<eoEsSimple<eoMinimizingFitness> >& _eval, eoContinue<eoEsSimple<eoMinimizingFitness> >& _continue); 00118 00119 eoCheckPoint<eoEsStdev<double> >& make_checkpoint(eoParser& _parser, eoState& _state, eoEvalFuncCounter<eoEsStdev<double> >& _eval, eoContinue<eoEsStdev<double> >& _continue); 00120 eoCheckPoint<eoEsStdev<eoMinimizingFitness> >& make_checkpoint(eoParser& _parser, eoState& _state, eoEvalFuncCounter<eoEsStdev<eoMinimizingFitness> >& _eval, eoContinue<eoEsStdev<eoMinimizingFitness> >& _continue); 00121 00122 eoCheckPoint<eoEsFull<double> >& make_checkpoint(eoParser& _parser, eoState& _state, eoEvalFuncCounter<eoEsFull<double> >& _eval, eoContinue<eoEsFull<double> >& _continue); 00123 eoCheckPoint<eoEsFull<eoMinimizingFitness> >& make_checkpoint(eoParser& _parser, eoState& _state, eoEvalFuncCounter<eoEsFull<eoMinimizingFitness> >& _eval, eoContinue<eoEsFull<eoMinimizingFitness> >& _continue); 00124 00125 00126 // the algo 00127 eoAlgo<eoEsSimple<double> >& make_algo_scalar(eoParser& _parser, eoState& _state, eoEvalFunc<eoEsSimple<double> >& _eval, eoContinue<eoEsSimple<double> >& _ccontinue, eoGenOp<eoEsSimple<double> >& _op, eoDistance<eoEsSimple<double> >* _dist = NULL); 00128 eoAlgo<eoEsSimple<eoMinimizingFitness> >& make_algo_scalar(eoParser& _parser, eoState& _state, eoEvalFunc<eoEsSimple<eoMinimizingFitness> >& _eval, eoContinue<eoEsSimple<eoMinimizingFitness> >& _ccontinue, eoGenOp<eoEsSimple<eoMinimizingFitness> >& _op, eoDistance<eoEsSimple<eoMinimizingFitness> >* _dist = NULL); 00129 00130 eoAlgo<eoEsStdev<double> >& make_algo_scalar(eoParser& _parser, eoState& _state, eoEvalFunc<eoEsStdev<double> >& _eval, eoContinue<eoEsStdev<double> >& _ccontinue, eoGenOp<eoEsStdev<double> >& _op, eoDistance<eoEsStdev<double> >* _dist = NULL); 00131 eoAlgo<eoEsStdev<eoMinimizingFitness> >& make_algo_scalar(eoParser& _parser, eoState& _state, eoEvalFunc<eoEsStdev<eoMinimizingFitness> >& _eval, eoContinue<eoEsStdev<eoMinimizingFitness> >& _ccontinue, eoGenOp<eoEsStdev<eoMinimizingFitness> >& _op, eoDistance<eoEsStdev<eoMinimizingFitness> >* _dist = NULL); 00132 00133 eoAlgo<eoEsFull<double> >& make_algo_scalar(eoParser& _parser, eoState& _state, eoEvalFunc<eoEsFull<double> >& _eval, eoContinue<eoEsFull<double> >& _ccontinue, eoGenOp<eoEsFull<double> >& _op, eoDistance<eoEsFull<double> >* _dist = NULL); 00134 eoAlgo<eoEsFull<eoMinimizingFitness> >& make_algo_scalar(eoParser& _parser, eoState& _state, eoEvalFunc<eoEsFull<eoMinimizingFitness> >& _eval, eoContinue<eoEsFull<eoMinimizingFitness> >& _ccontinue, eoGenOp<eoEsFull<eoMinimizingFitness> >& _op, eoDistance<eoEsFull<eoMinimizingFitness> >* _dist = NULL); 00135 00136 // run 00137 void run_ea(eoAlgo<eoEsSimple<double> >& _ga, eoPop<eoEsSimple<double> >& _pop); 00138 void run_ea(eoAlgo<eoEsSimple<eoMinimizingFitness> >& _ga, eoPop<eoEsSimple<eoMinimizingFitness> >& _pop); 00139 00140 void run_ea(eoAlgo<eoEsStdev<double> >& _ga, eoPop<eoEsStdev<double> >& _pop); 00141 void run_ea(eoAlgo<eoEsStdev<eoMinimizingFitness> >& _ga, eoPop<eoEsStdev<eoMinimizingFitness> >& _pop); 00142 00143 void run_ea(eoAlgo<eoEsFull<double> >& _ga, eoPop<eoEsFull<double> >& _pop); 00144 void run_ea(eoAlgo<eoEsFull<eoMinimizingFitness> >& _ga, eoPop<eoEsFull<eoMinimizingFitness> >& _pop); 00145 00146 // end of parameter input (+ .status + help) 00147 // that one is not templatized, but is here for completeness 00148 void make_help(eoParser & _parser); 00149 00152 #endif