edoAlgoStateless.h
00001 /*
00002 The Evolving Distribution Objects framework (EDO) is a template-based,
00003 ANSI-C++ evolutionary computation library which helps you to write your
00004 own estimation of distribution algorithms.
00005 
00006 This library is free software; you can redistribute it and/or
00007 modify it under the terms of the GNU Lesser General Public
00008 License as published by the Free Software Foundation; either
00009 version 2.1 of the License, or (at your option) any later version.
00010 
00011 This library is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 Lesser General Public License for more details.
00015 
00016 You should have received a copy of the GNU Lesser General Public
00017 License along with this library; if not, write to the Free Software
00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019 
00020 Copyright (C) 2010 Thales group
00021 */
00022 /*
00023 Authors:
00024     Johann Dréo <johann.dreo@thalesgroup.com>
00025     Pierre Savéant <pierre.saveant@thalesgroup.com>
00026 */
00027 
00028 #ifndef _edoAlgoStateless_h
00029 #define _edoAlgoStateless_h
00030 
00031 #include "edoAlgoAdaptive.h"
00032 
00041 template < typename D >
00042 class edoAlgoStateless : public edoAlgoAdaptive< D >
00043 {
00044 public:
00046     typedef typename D::EOType EOType;
00047 
00049     typedef typename EOType::AtomType AtomType;
00050 
00052     typedef typename EOType::Fitness Fitness;
00053 
00054 public:
00055 
00065     edoAlgoStateless(
00066         eoPopEvalFunc < EOType > & evaluator,
00067         eoSelect< EOType > & selector,
00068         edoEstimator< D > & estimator,
00069         edoSampler< D > & sampler,
00070         eoReplacement< EOType > & replacor,
00071         eoContinue< EOType > & pop_continuator,
00072         edoContinue< D > & distribution_continuator
00073     ) :
00074         edoAlgoAdaptive<D>( *(new D), evaluator, selector, estimator, sampler, replacor, pop_continuator, distribution_continuator)
00075     {}
00076 
00086     edoAlgoStateless (
00087         eoPopEvalFunc < EOType > & evaluator,
00088         eoSelect< EOType > & selector,
00089         edoEstimator< D > & estimator,
00090         edoSampler< D > & sampler,
00091         eoReplacement< EOType > & replacor,
00092         eoContinue< EOType > & pop_continuator
00093     ) :
00094         edoAlgoAdaptive<D>( *(new D), evaluator, selector, estimator, sampler, replacor, pop_continuator)
00095     {}
00096 
00097     ~edoAlgoStateless()
00098     {
00099         // delete the temporary distrib allocated in constructors
00100         delete &(this->_distrib);
00101     }
00102 };
00103 
00104 #endif // !_edoAlgoStateless_h
00105 
 All Classes Functions Variables Typedefs