⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 symbregevalop.hpp

📁 非常好的进化算法EC 实现平台 可以实现多种算法 GA GP
💻 HPP
字号:
/* *  Open BEAGLE *  Copyright (C) 2001-2005 by Christian Gagne and Marc Parizeau * *  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.1 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: *  Laboratoire de Vision et Systemes Numeriques *  Departement de genie electrique et de genie informatique *  Universite Laval, Quebec, Canada, G1K 7P4 *  http://vision.gel.ulaval.ca * *//*! *  \file   SymbRegEvalOp.hpp *  \brief  Definition of the type SymbRegEvalOp. *  \author Christian Gagne *  \author Marc Parizeau *  $Revision: 1.5 $ *  $Date: 2005/09/30 21:33:14 $ *//*! *  \defgroup SymbReg Symbolic Regression Example *  \brief Symbolic regression (symbreg): A simple GP example with Open BEAGLE. * *  \par Objective *  Find a function of one independent variable and one dependent variable, in *  symbolic form, that fits a given sample of 20 \f$(x_i,y_i)\f$ data points, *  where the target function is the quadratic polynomial \f$x^4 + x^3 + x^2 + x\f$. * *  \par Terminal set *  - X (the independent variable) *  - PI *  - Ephemeral constants randomly generated in [-1,1] * *  \par Function set *  - + *  - - *  - * *  - /     (protected division) *  - SIN *  - COS *  - EXP *  - LOG   (protected logarithm) * *  \par Fitness cases *  The given sample of 20 data points \f$(x_i,y_i)\f$, randomly chosen within *  interval [-1,1]. * *  \par Fitness *  \f$\frac{1.}{1.+RMSE}\f$ where RMSE is the Root Mean Square Error on the *  fitness cases. * *  \par Stopping criteria *  When the evolution reaches the maximum number of generations. * *  \par Reference *  John R. Koza, "Genetic Programming: On the Programming of Computers by Means *  of Natural Selection", MIT Press, 1992, pages 162-169. * */ #ifndef SymbRegEvalOp_hpp#define SymbRegEvalOp_hpp#include "beagle/GP.hpp"#include <string>#include <vector>/*! *  \class SymbRegEvalOp SymbRegEvalOp.hpp "SymbRegEvalOp.hpp" *  \brief The individual evaluation class operator for the problem of symbolic regression. *  \ingroup SymbReg */class SymbRegEvalOp : public Beagle::GP::EvaluationOp {public:  //! SymbRegEvalOp allocator type.  typedef Beagle::AllocatorT<SymbRegEvalOp,Beagle::GP::EvaluationOp::Alloc>          Alloc;  //!< SymbRegEvalOp handle type.  typedef Beagle::PointerT<SymbRegEvalOp,Beagle::GP::EvaluationOp::Handle>          Handle;  //!< SymbRegEvalOp bag type.  typedef Beagle::ContainerT<SymbRegEvalOp,Beagle::GP::EvaluationOp::Bag>          Bag;  explicit SymbRegEvalOp(std::string inName="SymbRegEvalOp");  virtual Beagle::Fitness::Handle evaluate(Beagle::GP::Individual& inIndividual,                                           Beagle::GP::Context& ioContext);  virtual void postInit(Beagle::System& ioSystem);  protected:  std::vector<Beagle::Double> mX;  std::vector<Beagle::Double> mY;};#endif // SymbRegEvalOp_hpp

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -