EvolvingObjects
|
00001 // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- 00002 00003 //----------------------------------------------------------------------------- 00004 // real.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 real_h 00045 #define real_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/eoRealInitBounded.h> 00058 #include <es/eoReal.h> 00059 00060 //Representation dependent - rewrite everything anew for each representation 00062 00063 00067 // the genotypes 00068 eoRealInitBounded<eoReal<double> > & make_genotype(eoParser& _parser, eoState& _state, eoReal<double> _eo); 00069 eoRealInitBounded<eoReal<eoMinimizingFitness> > & make_genotype(eoParser& _parser, eoState& _state, eoReal<eoMinimizingFitness> _eo); 00070 00071 // the operators 00072 eoGenOp<eoReal<double> >& make_op(eoParser& _parser, eoState& _state, eoRealInitBounded<eoReal<double> >& _init); 00073 eoGenOp<eoReal<eoMinimizingFitness> >& make_op(eoParser& _parser, eoState& _state, eoRealInitBounded<eoReal<eoMinimizingFitness> >& _init); 00074 00075 //Representation INdependent 00077 // you don't need to modify that part even if you use your own representation 00078 00079 // init pop 00080 eoPop<eoReal<double> >& make_pop(eoParser& _parser, eoState& _state, eoInit<eoReal<double> >&); 00081 eoPop<eoReal<eoMinimizingFitness> >& make_pop(eoParser& _parser, eoState& _state, eoInit<eoReal<eoMinimizingFitness> >&); 00082 00083 // the continue's 00084 eoContinue<eoReal<double> >& make_continue(eoParser& _parser, eoState& _state, eoEvalFuncCounter<eoReal<double> > & _eval); 00085 eoContinue<eoReal<eoMinimizingFitness> >& make_continue(eoParser& _parser, eoState& _state, eoEvalFuncCounter<eoReal<eoMinimizingFitness> > & _eval); 00086 00087 // the checkpoint 00088 eoCheckPoint<eoReal<double> >& make_checkpoint(eoParser& _parser, eoState& _state, eoEvalFuncCounter<eoReal<double> >& _eval, eoContinue<eoReal<double> >& _continue); 00089 eoCheckPoint<eoReal<eoMinimizingFitness> >& make_checkpoint(eoParser& _parser, eoState& _state, eoEvalFuncCounter<eoReal<eoMinimizingFitness> >& _eval, eoContinue<eoReal<eoMinimizingFitness> >& _continue); 00090 00091 00092 // the algo 00093 eoAlgo<eoReal<double> >& make_algo_scalar(eoParser& _parser, eoState& _state, eoEvalFunc<eoReal<double> >& _eval, eoContinue<eoReal<double> >& _ccontinue, eoGenOp<eoReal<double> >& _op, eoDistance<eoReal<double> >* _dist = NULL); 00094 00095 eoAlgo<eoReal<eoMinimizingFitness> >& make_algo_scalar(eoParser& _parser, eoState& _state, eoEvalFunc<eoReal<eoMinimizingFitness> >& _eval, eoContinue<eoReal<eoMinimizingFitness> >& _ccontinue, eoGenOp<eoReal<eoMinimizingFitness> >& _op, eoDistance<eoReal<eoMinimizingFitness> >* _dist = NULL); 00096 00097 // run 00098 void run_ea(eoAlgo<eoReal<double> >& _ga, eoPop<eoReal<double> >& _pop); 00099 void run_ea(eoAlgo<eoReal<eoMinimizingFitness> >& _ga, eoPop<eoReal<eoMinimizingFitness> >& _pop); 00100 00101 // end of parameter input (+ .status + help) 00102 // that one is not templatized 00103 // Because of that, the source is in src/utils dir 00104 void make_help(eoParser & _parser); 00105 00107 #endif