From 0e34aae83fd2d4ad9cce5a54e949907e76182c43 Mon Sep 17 00:00:00 2001 From: canape Date: Thu, 13 Dec 2007 14:04:20 +0000 Subject: [PATCH] Delete peoPopEval git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@843 331e1502-861f-0410-8da2-ba01fb791d7f --- trunk/paradiseo-peo/src/peo.h | 2 - trunk/paradiseo-peo/src/peoParaPopEval.h | 7 +- trunk/paradiseo-peo/src/peoPopEval.h | 57 ---------- trunk/paradiseo-peo/src/peoSeqPopEval.h | 87 --------------- trunk/paradiseo-peo/src/peoSeqTransform.h | 100 ------------------ .../paradiseo-peo/tutorial/Wrapper/main1.cpp | 36 +------ .../paradiseo-peo/tutorial/Wrapper/main2.cpp | 4 - .../paradiseo-peo/tutorial/Wrapper/main5.cpp | 5 +- .../paradiseo-peo/tutorial/Wrapper/main6.cpp | 5 +- 9 files changed, 7 insertions(+), 296 deletions(-) delete mode 100644 trunk/paradiseo-peo/src/peoPopEval.h delete mode 100644 trunk/paradiseo-peo/src/peoSeqPopEval.h delete mode 100644 trunk/paradiseo-peo/src/peoSeqTransform.h diff --git a/trunk/paradiseo-peo/src/peo.h b/trunk/paradiseo-peo/src/peo.h index b2262b22d..557746367 100644 --- a/trunk/paradiseo-peo/src/peo.h +++ b/trunk/paradiseo-peo/src/peo.h @@ -327,9 +327,7 @@ #include "peoWrapper.h" /* <------- components for parallel algorithms -------> */ -#include "peoSeqTransform.h" #include "peoParaSGATransform.h" -#include "peoSeqPopEval.h" #include "peoEvalFunc.h" #include "peoParaPopEval.h" diff --git a/trunk/paradiseo-peo/src/peoParaPopEval.h b/trunk/paradiseo-peo/src/peoParaPopEval.h index 206fa5f32..7a55f635a 100644 --- a/trunk/paradiseo-peo/src/peoParaPopEval.h +++ b/trunk/paradiseo-peo/src/peoParaPopEval.h @@ -51,16 +51,11 @@ //! The peoParaPopEval represents a wrapper for creating a functor capable of applying in parallel //! an EO-derived evaluation functor. The class offers the possibility of chosing between a single-function evaluation //! and an aggregate evaluation function, including several sub-evalution functions. -template< class EOT > class peoParaPopEval : public peoPopEval< EOT > +template< class EOT > class peoParaPopEval : public Service, public eoPopEvalFunc { public: - using peoPopEval< EOT > :: requestResourceRequest; - using peoPopEval< EOT > :: resume; - using peoPopEval< EOT > :: stop; - using peoPopEval< EOT > :: getOwner; - //! Constructor function - an EO-derived evaluation functor has to be specified; an internal reference //! is set towards the specified evaluation functor. //! diff --git a/trunk/paradiseo-peo/src/peoPopEval.h b/trunk/paradiseo-peo/src/peoPopEval.h deleted file mode 100644 index 41f0f9d88..000000000 --- a/trunk/paradiseo-peo/src/peoPopEval.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -* -* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 -* (C) OPAC Team, LIFL, 2002-2007 -* -* Sebastien Cahon, Alexandru-Adrian Tantar -* -* This software is governed by the CeCILL license under French law and -* abiding by the rules of distribution of free software. You can use, -* modify and/ or redistribute the software under the terms of the CeCILL -* license as circulated by CEA, CNRS and INRIA at the following URL -* "http://www.cecill.info". -* -* As a counterpart to the access to the source code and rights to copy, -* modify and redistribute granted by the license, users are provided only -* with a limited warranty and the software's author, the holder of the -* economic rights, and the successive licensors have only limited liability. -* -* In this respect, the user's attention is drawn to the risks associated -* with loading, using, modifying and/or developing or reproducing the -* software by the user in light of its specific status of free software, -* that may mean that it is complicated to manipulate, and that also -* therefore means that it is reserved for developers and experienced -* professionals having in-depth computer knowledge. Users are therefore -* encouraged to load and test the software's suitability as regards their -* requirements in conditions enabling the security of their systems and/or -* data to be ensured and, more generally, to use and operate it in the -* same conditions as regards security. -* The fact that you are presently reading this means that you have had -* knowledge of the CeCILL license and that you accept its terms. -* -* ParadisEO WebSite : http://paradiseo.gforge.inria.fr -* Contact: paradiseo-help@lists.gforge.inria.fr -* -*/ - -#ifndef __peoPopEval_h -#define __peoPopEval_h - -#include "core/service.h" - -//! Interface for ParadisEO specific evaluation functors. - -//! The peoPopEval class provides the interface for constructing ParadisEO specific evaluation functors. -//! The derived classes may be used as wrappers for EO-derived evaluation functors. In order to have an example, -//! please refer to the implementation of the peoSeqPopEval and peoParaPopEval classes. -template< class EOT > class peoPopEval : public Service, public eoPopEvalFunc -{ - -public: - - //! Interface function providing the signature for constructing an evaluation functor. - virtual void operator()( eoPop< EOT >& __tmp, eoPop< EOT >& __pop )=0; - -}; - -#endif diff --git a/trunk/paradiseo-peo/src/peoSeqPopEval.h b/trunk/paradiseo-peo/src/peoSeqPopEval.h deleted file mode 100644 index 3ff7ee468..000000000 --- a/trunk/paradiseo-peo/src/peoSeqPopEval.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -* -* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 -* (C) OPAC Team, LIFL, 2002-2007 -* -* Sebastien Cahon, Alexandru-Adrian Tantar -* -* This software is governed by the CeCILL license under French law and -* abiding by the rules of distribution of free software. You can use, -* modify and/ or redistribute the software under the terms of the CeCILL -* license as circulated by CEA, CNRS and INRIA at the following URL -* "http://www.cecill.info". -* -* As a counterpart to the access to the source code and rights to copy, -* modify and redistribute granted by the license, users are provided only -* with a limited warranty and the software's author, the holder of the -* economic rights, and the successive licensors have only limited liability. -* -* In this respect, the user's attention is drawn to the risks associated -* with loading, using, modifying and/or developing or reproducing the -* software by the user in light of its specific status of free software, -* that may mean that it is complicated to manipulate, and that also -* therefore means that it is reserved for developers and experienced -* professionals having in-depth computer knowledge. Users are therefore -* encouraged to load and test the software's suitability as regards their -* requirements in conditions enabling the security of their systems and/or -* data to be ensured and, more generally, to use and operate it in the -* same conditions as regards security. -* The fact that you are presently reading this means that you have had -* knowledge of the CeCILL license and that you accept its terms. -* -* ParadisEO WebSite : http://paradiseo.gforge.inria.fr -* Contact: paradiseo-help@lists.gforge.inria.fr -* -*/ - -#ifndef __peoSeqPopEval_h -#define __peoSeqPopEval_h - -#include - -#include "peoPopEval.h" - -//! Sequential evaluation functor wrapper. - -//! The peoSeqPopEval class acts only as a ParadisEO specific sequential evaluation functor - a wrapper for incorporating -//! an eoEvalFunc< EOT >-derived class as evaluation functor. The specified EO evaluation object is applyied in an -//! iterative manner to each individual of a specified population. -template< class EOT > class peoSeqPopEval : public peoPopEval< EOT > - { - - public: - - //! Constructor function - it only sets an internal reference to point to the specified evaluation object. - //! - //! @param eoEvalFunc< EOT >& __eval - evaluation object to be applied for each individual of a specified population - peoSeqPopEval( eoEvalFunc< EOT >& __eval ); - - //! Operator for evaluating all the individuals of a given population - in a sequential iterative manner. - //! - //! @param eoPop< EOT >& __pop - population to be evaluated. - void operator()( eoPop< EOT >& __pop ); - void operator()( eoPop< EOT > &__dummy,eoPop< EOT >&__pop); - - private: - - eoEvalFunc< EOT >& eval; - }; - - -template< class EOT > peoSeqPopEval< EOT > :: peoSeqPopEval( eoEvalFunc< EOT >& __eval ) : eval( __eval ) -{} - -template< class EOT > void peoSeqPopEval< EOT > :: operator()( eoPop< EOT >& __dummy,eoPop< EOT >& __pop ) -{ - this->operator()(__pop); -} - -template< class EOT > void peoSeqPopEval< EOT > :: operator()( eoPop< EOT >& __pop ) -{ - - for ( unsigned i = 0; i < __pop.size(); i++ ) - eval( __pop[i] ); -} - - -#endif diff --git a/trunk/paradiseo-peo/src/peoSeqTransform.h b/trunk/paradiseo-peo/src/peoSeqTransform.h deleted file mode 100644 index 099e33325..000000000 --- a/trunk/paradiseo-peo/src/peoSeqTransform.h +++ /dev/null @@ -1,100 +0,0 @@ -/* -* -* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 -* (C) OPAC Team, LIFL, 2002-2007 -* -* Sebastien Cahon, Alexandru-Adrian Tantar -* -* This software is governed by the CeCILL license under French law and -* abiding by the rules of distribution of free software. You can use, -* modify and/ or redistribute the software under the terms of the CeCILL -* license as circulated by CEA, CNRS and INRIA at the following URL -* "http://www.cecill.info". -* -* As a counterpart to the access to the source code and rights to copy, -* modify and redistribute granted by the license, users are provided only -* with a limited warranty and the software's author, the holder of the -* economic rights, and the successive licensors have only limited liability. -* -* In this respect, the user's attention is drawn to the risks associated -* with loading, using, modifying and/or developing or reproducing the -* software by the user in light of its specific status of free software, -* that may mean that it is complicated to manipulate, and that also -* therefore means that it is reserved for developers and experienced -* professionals having in-depth computer knowledge. Users are therefore -* encouraged to load and test the software's suitability as regards their -* requirements in conditions enabling the security of their systems and/or -* data to be ensured and, more generally, to use and operate it in the -* same conditions as regards security. -* The fact that you are presently reading this means that you have had -* knowledge of the CeCILL license and that you accept its terms. -* -* ParadisEO WebSite : http://paradiseo.gforge.inria.fr -* Contact: paradiseo-help@lists.gforge.inria.fr -* -*/ - -#ifndef __peoSeqTransform_h -#define __peoSeqTransform_h - -#include "peoTransform.h" - - -//! ParadisEO specific wrapper class offering the possibility of using EO derived transform operators. - -//! The peoSeqTransform represent a wrapper for offering the possibility of using EO derived transform operators -//! along with the ParadisEO evolutionary algorithms. A minimal set of interface functions is also provided for creating the -//! link with the parallel architecture of the ParadisEO framework. -template< class EOT > class peoSeqTransform : public peoTransform< EOT > - { - - public: - - //! Constructor function - sets an internal reference towards the specified EO-derived transform object. - //! - //! @param eoTransform< EOT >& __trans - EO-derived transform object including crossover and mutation operators. - peoSeqTransform( eoTransform< EOT >& __trans ); - - //! Operator for applying the specified transform operators on each individual of the given population. - //! - //! @param eoPop< EOT >& __pop - population to be transformed by applying the crossover and mutation operators. - void operator()( eoPop< EOT >& __pop ); - - //! Interface function for providing a link with the parallel architecture of the ParadisEO framework. - virtual void packData() - { } - - //! Interface function for providing a link with the parallel architecture of the ParadisEO framework. - virtual void unpackData() - { } - - //! Interface function for providing a link with the parallel architecture of the ParadisEO framework. - virtual void execute() - { } - - //! Interface function for providing a link with the parallel architecture of the ParadisEO framework. - virtual void packResult() - { } - - //! Interface function for providing a link with the parallel architecture of the ParadisEO framework. - virtual void unpackResult() - { } - - private: - - eoTransform< EOT >& trans; - }; - - -template< class EOT > peoSeqTransform< EOT > :: peoSeqTransform( eoTransform< EOT >& __trans ) : trans( __trans ) -{} - - -template< class EOT > void peoSeqTransform< EOT > :: operator()( eoPop< EOT >& __pop ) -{ - - trans( __pop ); -} - - -#endif diff --git a/trunk/paradiseo-peo/tutorial/Wrapper/main1.cpp b/trunk/paradiseo-peo/tutorial/Wrapper/main1.cpp index 7d9212333..f2dd3ad5c 100644 --- a/trunk/paradiseo-peo/tutorial/Wrapper/main1.cpp +++ b/trunk/paradiseo-peo/tutorial/Wrapper/main1.cpp @@ -34,8 +34,8 @@ int main( int __argc, char** __argv ) eoGenContinue < Indi > genContPara (MAX_GEN); eoCombinedContinue continuatorPara (genContPara); eoCheckPoint checkpoint(continuatorPara); - eoEvalFuncPtr< Indi > mainEval( f ); - eoEvalFuncCounter< Indi > eval(mainEval); + peoEvalFunc mainEval( f ); + peoParaPopEval eval(mainEval); eoUniformGenerator < double >uGen (INIT_POSITION_MIN, INIT_POSITION_MAX); eoInitFixedLength < Indi > random (VEC_SIZE, uGen); eoRankingSelect selectionStrategy; @@ -43,7 +43,6 @@ int main( int __argc, char** __argv ) eoSegmentCrossover crossover; eoUniformMutation mutation(EPSILON); eoSGATransform transform(crossover,CROSS_RATE,mutation,MUT_RATE); - peoSeqTransform eaTransform(transform); eoPlusReplacement replace; eoEasyEA< Indi > eaAlg( checkpoint, eval, select, transform, replace ); @@ -57,35 +56,4 @@ int main( int __argc, char** __argv ) peo :: finalize(); if (getNodeRank()==1) std::cout << "Final population :\n" << pop << std::endl; - - -// Algorithm - eoGenContinue < Indi > genContPara2 (MAX_GEN); - eoCombinedContinue continuatorPara2 (genContPara2); - eoCheckPoint checkpoint2(continuatorPara2); - eoEvalFuncPtr< Indi > mainEval2( f ); - eoEvalFuncCounter< Indi > eval2(mainEval2); - eoUniformGenerator < double >uGen2 (INIT_POSITION_MIN, INIT_POSITION_MAX); - eoInitFixedLength < Indi > random2 (VEC_SIZE, uGen2); - eoRankingSelect selectionStrategy2; - eoSelectNumber select2(selectionStrategy2,POP_SIZE); - eoSegmentCrossover crossover2; - eoUniformMutation mutation2(EPSILON); - eoSGATransform transform2(crossover2,CROSS_RATE,mutation2,MUT_RATE); - peoSeqTransform eaTransform2(transform2); - eoPlusReplacement replace2; - eoEasyEA< Indi > eaAlg2( checkpoint2, eval2, select2, transform2, replace2 ); - -// Population - eoPop < Indi > pop2; - pop2.append (POP_SIZE, random2); - - -// Wrapper - peo :: init( __argc, __argv ); - peoWrapper parallelEA2( eaAlg2, pop2); - peo :: run(); - peo :: finalize(); - if (getNodeRank()==1) - std::cout << "Final population 2 :\n" << pop2 << std::endl; } diff --git a/trunk/paradiseo-peo/tutorial/Wrapper/main2.cpp b/trunk/paradiseo-peo/tutorial/Wrapper/main2.cpp index e07a31884..d3c2e5f15 100644 --- a/trunk/paradiseo-peo/tutorial/Wrapper/main2.cpp +++ b/trunk/paradiseo-peo/tutorial/Wrapper/main2.cpp @@ -31,8 +31,6 @@ int main( int __argc, char** __argv ) eoCombinedContinue continuatorPara (genContPara); eoCheckPoint checkpoint(continuatorPara); - //eoEvalFuncPtr< Indi > mainEval( f ); - //eoEvalFuncCounter< Indi > eval(mainEval); peoEvalFunc mainEval( f ); peoParaPopEval eval(mainEval); @@ -43,8 +41,6 @@ int main( int __argc, char** __argv ) eoSegmentCrossover crossover; eoUniformMutation mutation(EPSILON); - //eoSGATransform transform(crossover,CROSS_RATE,mutation,MUT_RATE); - //peoSeqTransform eaTransform(transform); peoParaSGATransform transform(crossover,CROSS_RATE,mutation,MUT_RATE); eoPlusReplacement replace; diff --git a/trunk/paradiseo-peo/tutorial/Wrapper/main5.cpp b/trunk/paradiseo-peo/tutorial/Wrapper/main5.cpp index 8af2a5478..45000dada 100644 --- a/trunk/paradiseo-peo/tutorial/Wrapper/main5.cpp +++ b/trunk/paradiseo-peo/tutorial/Wrapper/main5.cpp @@ -42,13 +42,12 @@ int main (int __argc, char * * __argv) eoPop pop (POP_SIZE, route_init); eoGenContinue cont (NUM_GEN); eoCheckPoint checkpoint (cont); - peoSeqPopEval eval (full_eval); + eoEvalFuncCounter< Route > eval(full_eval); eoStochTournamentSelect select_one; eoSelectNumber select (select_one, POP_SIZE); eoSGATransform transform (order_cross, CROSS_RATE, city_swap_mut, MUT_RATE); - peoSeqTransform para_transform (transform); eoEPReplacement replace (2); - eoEasyEA< Route > eaAlg( checkpoint, eval, select, para_transform, replace ); + eoEasyEA< Route > eaAlg( checkpoint, eval, select, transform, replace ); peoWrapper parallelEA( eaAlg, pop); peo :: run (); peo :: finalize (); diff --git a/trunk/paradiseo-peo/tutorial/Wrapper/main6.cpp b/trunk/paradiseo-peo/tutorial/Wrapper/main6.cpp index a3ba5fc98..6075e6171 100644 --- a/trunk/paradiseo-peo/tutorial/Wrapper/main6.cpp +++ b/trunk/paradiseo-peo/tutorial/Wrapper/main6.cpp @@ -56,13 +56,12 @@ int main (int __argc, char * * __argv) peo :: init (__argc, __argv); eoGenContinue cont (NUM_GEN); eoCheckPoint checkpoint (cont); - peoSeqPopEval eval (full_eval); + eoEvalFuncCounter< Route > eval(full_eval); eoStochTournamentSelect select_one; eoSelectNumber select (select_one, POP_SIZE); eoSGATransform transform (order_cross, CROSS_RATE, city_swap_mut, MUT_RATE); - peoSeqTransform para_transform (transform); eoEPReplacement replace (2); - eoEasyEA< Route > eaAlg( checkpoint, eval, select, para_transform, replace ); + eoEasyEA< Route > eaAlg( checkpoint, eval, select, transform, replace ); peoWrapper parallelEA( eaAlg, pop); peo :: run (); peo :: finalize ();