From fc01c6862a59ba5d1d0ff8d16480953dd2e08b54 Mon Sep 17 00:00:00 2001 From: evomarc Date: Sat, 28 Apr 2001 05:53:37 +0000 Subject: [PATCH] Adding first bricks of ES algorithm - make_XXX_es.cpp --- eo/src/es/make_algo_scalar_es.cpp | 80 ++++++++++++++++++++++++++++++ eo/src/es/make_checkpoint_es.cpp | 78 +++++++++++++++++++++++++++++ eo/src/es/make_continue_es.cpp | 78 +++++++++++++++++++++++++++++ eo/src/es/make_pop_es.cpp | 81 ++++++++++++++++++++++++++++++ eo/src/es/make_run_es.cpp | 82 +++++++++++++++++++++++++++++++ 5 files changed, 399 insertions(+) create mode 100644 eo/src/es/make_algo_scalar_es.cpp create mode 100644 eo/src/es/make_checkpoint_es.cpp create mode 100644 eo/src/es/make_continue_es.cpp create mode 100644 eo/src/es/make_pop_es.cpp create mode 100644 eo/src/es/make_run_es.cpp diff --git a/eo/src/es/make_algo_scalar_es.cpp b/eo/src/es/make_algo_scalar_es.cpp new file mode 100644 index 00000000..b952770e --- /dev/null +++ b/eo/src/es/make_algo_scalar_es.cpp @@ -0,0 +1,80 @@ +// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- + +//----------------------------------------------------------------------------- +// make_algo_scalar_es.cpp +// (c) Maarten Keijzer, Marc Schoenauer and GeNeura Team, 2001 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + Marc.Schoenauer@polytechnique.fr + mkeijzer@dhi.dk + */ +//----------------------------------------------------------------------------- + +/** This file contains ***INSTANCIATED DEFINITIONS*** of select/replace fns + * of the library for evolution of ***eoEs genotypes*** inside EO. + * It should be included in the file that calls any of the corresponding fns + * Compiling this file allows one to generate part of the library (i.e. object + * files that you just need to link with your own main and fitness code). + * + * The corresponding ***INSTANCIATED DECLARATIONS*** are contained + * in src/es/es.h + * while the TEMPLATIZED code is define in make_algo_scalar.h in the src/do dir + */ + +// The templatized code +#include +// the instanciating EOType(s) +#include // one Sigma per individual +#include // one sigmal per object variable +#include // full correlation matrix per indi + +/// The following function merely call the templatized do_* functions above + +// Algo +/////// +eoAlgo >& make_algo_scalar(eoParameterLoader& _parser, eoState& _state, eoEvalFunc >& _eval, eoContinue >& _continue, eoGenOp >& _op) +{ + return do_make_algo_scalar(_parser, _state, _eval, _continue, _op); +} + +eoAlgo >& make_algo_scalar(eoParameterLoader& _parser, eoState& _state, eoEvalFunc >& _eval, eoContinue >& _continue, eoGenOp >& _op) +{ + return do_make_algo_scalar(_parser, _state, _eval, _continue, _op); +} + +////////////// +eoAlgo >& make_algo_scalar(eoParameterLoader& _parser, eoState& _state, eoEvalFunc >& _eval, eoContinue >& _continue, eoGenOp >& _op) +{ + return do_make_algo_scalar(_parser, _state, _eval, _continue, _op); +} + +eoAlgo >& make_algo_scalar(eoParameterLoader& _parser, eoState& _state, eoEvalFunc >& _eval, eoContinue >& _continue, eoGenOp >& _op) +{ + return do_make_algo_scalar(_parser, _state, _eval, _continue, _op); +} + +/////////////// +eoAlgo >& make_algo_scalar(eoParameterLoader& _parser, eoState& _state, eoEvalFunc >& _eval, eoContinue >& _continue, eoGenOp >& _op) +{ + return do_make_algo_scalar(_parser, _state, _eval, _continue, _op); +} + +eoAlgo >& make_algo_scalar(eoParameterLoader& _parser, eoState& _state, eoEvalFunc >& _eval, eoContinue >& _continue, eoGenOp >& _op) +{ + return do_make_algo_scalar(_parser, _state, _eval, _continue, _op); +} + diff --git a/eo/src/es/make_checkpoint_es.cpp b/eo/src/es/make_checkpoint_es.cpp new file mode 100644 index 00000000..489524d6 --- /dev/null +++ b/eo/src/es/make_checkpoint_es.cpp @@ -0,0 +1,78 @@ +// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- + +//----------------------------------------------------------------------------- +// make_checkpoint_es.cpp +// (c) Maarten Keijzer, Marc Schoenauer and GeNeura Team, 2001 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + Marc.Schoenauer@polytechnique.fr + mkeijzer@dhi.dk + */ +//----------------------------------------------------------------------------- + +/** This file contains ***INSTANCIATED DEFINITIONS*** of checkpoint fns + * of the library for evolution of ***ES genotypes*** inside EO. + * It should be included in the file that calls any of the corresponding fns + * Compiling this file allows one to generate part of the library (i.e. object + * files that you just need to link with your own main and fitness code). + * + * The corresponding ***INSTANCIATED DECLARATIONS*** are contained + * in src/es/es.h + * while the TEMPLATIZED code is define in make_checkpoint.h in the src/do dir + */ + +// The templatized code +#include +// the instanciating EOType(s) +#include // one Sigma per individual +#include // one sigmal per object variable +#include // full correlation matrix per indi + +/// The following function merely call the templatized do_* functions + +// checkpoint +///////////// +eoCheckPoint >& make_checkpoint(eoParameterLoader& _parser, eoState& _state, eoEvalFuncCounter >& _eval, eoContinue >& _continue) +{ + return do_make_checkpoint(_parser, _state, _eval, _continue); +} +eoCheckPoint >& make_checkpoint(eoParameterLoader& _parser, eoState& _state, eoEvalFuncCounter >& _eval, eoContinue >& _continue) +{ + return do_make_checkpoint(_parser, _state, _eval, _continue); +} + +///////////// +eoCheckPoint >& make_checkpoint(eoParameterLoader& _parser, eoState& _state, eoEvalFuncCounter >& _eval, eoContinue >& _continue) +{ + return do_make_checkpoint(_parser, _state, _eval, _continue); +} +eoCheckPoint >& make_checkpoint(eoParameterLoader& _parser, eoState& _state, eoEvalFuncCounter >& _eval, eoContinue >& _continue) +{ + return do_make_checkpoint(_parser, _state, _eval, _continue); +} + +///////////// +eoCheckPoint >& make_checkpoint(eoParameterLoader& _parser, eoState& _state, eoEvalFuncCounter >& _eval, eoContinue >& _continue) +{ + return do_make_checkpoint(_parser, _state, _eval, _continue); +} +eoCheckPoint >& make_checkpoint(eoParameterLoader& _parser, eoState& _state, eoEvalFuncCounter >& _eval, eoContinue >& _continue) +{ + return do_make_checkpoint(_parser, _state, _eval, _continue); +} + + diff --git a/eo/src/es/make_continue_es.cpp b/eo/src/es/make_continue_es.cpp new file mode 100644 index 00000000..7d53ce39 --- /dev/null +++ b/eo/src/es/make_continue_es.cpp @@ -0,0 +1,78 @@ +// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- + +//----------------------------------------------------------------------------- +// make_continue_es.cpp +// (c) Maarten Keijzer, Marc Schoenauer and GeNeura Team, 2001 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + Marc.Schoenauer@polytechnique.fr + mkeijzer@dhi.dk + */ +//----------------------------------------------------------------------------- + +/** This file contains ***INSTANCIATED DEFINITIONS*** of continuator fns + * of the library for evolution of ***ES genotypes*** inside EO. + * It should be included in the file that calls any of the corresponding fns + * Compiling this file allows one to generate part of the library (i.e. object + * files that you just need to link with your own main and fitness code). + * + * The corresponding ***INSTANCIATED DECLARATIONS*** are contained + * in src/es/es.h + * while the TEMPLATIZED code is define in make_continue.h in the src/do dir + */ + +// The templatized code +#include +// the instanciating EOType(s) +#include // one Sigma per individual +#include // one sigmal per object variable +#include // full correlation matrix per indi + +/// The following function merely call the templatized do_* functions + +// continue +/////////// +eoContinue >& make_continue(eoParser& _parser, eoState& _state, eoEvalFuncCounter > & _eval) +{ + return do_make_continue(_parser, _state, _eval); +} +eoContinue >& make_continue(eoParser& _parser, eoState& _state, eoEvalFuncCounter > & _eval) +{ + return do_make_continue(_parser, _state, _eval); +} + +/////////// +eoContinue >& make_continue(eoParser& _parser, eoState& _state, eoEvalFuncCounter > & _eval) +{ + return do_make_continue(_parser, _state, _eval); +} +eoContinue >& make_continue(eoParser& _parser, eoState& _state, eoEvalFuncCounter > & _eval) +{ + return do_make_continue(_parser, _state, _eval); +} + +/////////// +eoContinue >& make_continue(eoParser& _parser, eoState& _state, eoEvalFuncCounter > & _eval) +{ + return do_make_continue(_parser, _state, _eval); +} +eoContinue >& make_continue(eoParser& _parser, eoState& _state, eoEvalFuncCounter > & _eval) +{ + return do_make_continue(_parser, _state, _eval); +} + + diff --git a/eo/src/es/make_pop_es.cpp b/eo/src/es/make_pop_es.cpp new file mode 100644 index 00000000..ca826e08 --- /dev/null +++ b/eo/src/es/make_pop_es.cpp @@ -0,0 +1,81 @@ +// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- + +//----------------------------------------------------------------------------- +// make_pop_es.cpp +// (c) Maarten Keijzer, Marc Schoenauer and GeNeura Team, 2001 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + Marc.Schoenauer@polytechnique.fr + mkeijzer@dhi.dk + */ +//----------------------------------------------------------------------------- + +/** This file contains ***INSTANCIATED DEFINITIONS*** of pop. init. fns + * of the library for evolution of ***ES genotypes*** indis inside EO. + * It should be included in the file that calls any of the corresponding fns + * Compiling this file allows one to generate part of the library (i.e. object + * files that you just need to link with your own main and fitness code). + * + * The corresponding ***INSTANCIATED DECLARATIONS*** are contained + * in src/es/es.h + * while the TEMPLATIZED code is define in make_pop.h in the src/do dir + */ + +// The templatized code +#include +// the instanciating EOType(s) +#include // one Sigma per individual +#include // one sigmal per object variable +#include // full correlation matrix per indi + +/// The following function merely call the templatized do_* functions above + +// Init POP +/////////// +eoPop >& make_pop(eoParser& _parser, eoState& _state, eoInit > & _init) +{ + return do_make_pop(_parser, _state, _init); +} + +eoPop >& make_pop(eoParser& _parser, eoState& _state, eoInit > & _init) +{ + return do_make_pop(_parser, _state, _init); +} + +/////////// +eoPop >& make_pop(eoParser& _parser, eoState& _state, eoInit > & _init) +{ + return do_make_pop(_parser, _state, _init); +} + +eoPop >& make_pop(eoParser& _parser, eoState& _state, eoInit > & _init) +{ + return do_make_pop(_parser, _state, _init); +} + +/////////// +eoPop >& make_pop(eoParser& _parser, eoState& _state, eoInit > & _init) +{ + return do_make_pop(_parser, _state, _init); +} + +eoPop >& make_pop(eoParser& _parser, eoState& _state, eoInit > & _init) +{ + return do_make_pop(_parser, _state, _init); +} + + diff --git a/eo/src/es/make_run_es.cpp b/eo/src/es/make_run_es.cpp new file mode 100644 index 00000000..6707fe45 --- /dev/null +++ b/eo/src/es/make_run_es.cpp @@ -0,0 +1,82 @@ +// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- + +//----------------------------------------------------------------------------- +// make_run_es.cpp +// (c) Maarten Keijzer, Marc Schoenauer and GeNeura Team, 2001 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + Marc.Schoenauer@polytechnique.fr + mkeijzer@dhi.dk + */ +//----------------------------------------------------------------------------- + +/** This file contains ***INSTANCIATED DEFINITIONS*** of run funs + * of the library for evolution of ***ES genotypes*** inside EO. + * It should be included in the file that calls any of the corresponding fns + * Compiling this file allows one to generate part of the library (i.e. object + * files that you just need to link with your own main and fitness code). + * + * The corresponding ***INSTANCIATED DECLARATIONS*** are contained + * in src/es/es.h + * while the TEMPLATIZED code is define in make_run.h in the src/do dir + */ + +// The templatized code +#include +// the instanciating EOType(s) +#include // one Sigma per individual +#include // one sigmal per object variable +#include // full correlation matrix per indi +// the instanciating fitnesses +#include + +/// The following function merely call the templatized do_* functions above + +// run +///////// +void run_ea(eoAlgo >& _ga, eoPop >& _pop) +{ + do_run(_ga, _pop); +} + +void run_ea(eoAlgo >& _ga, eoPop >& _pop) +{ + do_run(_ga, _pop); +} + +///////// +void run_ea(eoAlgo >& _ga, eoPop >& _pop) +{ + do_run(_ga, _pop); +} + +void run_ea(eoAlgo >& _ga, eoPop >& _pop) +{ + do_run(_ga, _pop); +} + +///////// +void run_ea(eoAlgo >& _ga, eoPop >& _pop) +{ + do_run(_ga, _pop); +} + +void run_ea(eoAlgo >& _ga, eoPop >& _pop) +{ + do_run(_ga, _pop); +} +