From 77506fb591cd82109498fd7f54844bfb8e89ef60 Mon Sep 17 00:00:00 2001 From: canape Date: Mon, 4 Feb 2008 10:13:42 +0000 Subject: [PATCH] Island modified git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@922 331e1502-861f-0410-8da2-ba01fb791d7f --- trunk/paradiseo-peo/src/peoAsyncIslandMig.h | 16 +++------------- trunk/paradiseo-peo/src/peoSyncIslandMig.h | 17 +++-------------- trunk/paradiseo-peo/test/t-EAAsyncIsland.cpp | 8 ++++++-- trunk/paradiseo-peo/test/t-EASyncIsland.cpp | 8 ++------ trunk/paradiseo-peo/test/t-PSOGlobalBest.cpp | 4 ++-- trunk/paradiseo-peo/test/t-PSOWorstPosition.cpp | 4 ++-- trunk/paradiseo-peo/tutorial/Lesson3/mainEA.cpp | 4 ++-- .../paradiseo-peo/tutorial/Lesson3/mainPSO.cpp | 4 ++-- 8 files changed, 22 insertions(+), 43 deletions(-) diff --git a/trunk/paradiseo-peo/src/peoAsyncIslandMig.h b/trunk/paradiseo-peo/src/peoAsyncIslandMig.h index 445d24f98..2964fb914 100644 --- a/trunk/paradiseo-peo/src/peoAsyncIslandMig.h +++ b/trunk/paradiseo-peo/src/peoAsyncIslandMig.h @@ -71,15 +71,11 @@ template< class EOT, class TYPE > class peoAsyncIslandMig : public Cooperative, //! @param selector & __select //! @param replacement & __replace //! @param Topology& __topology - //! @param peoData & __source - //! @param eoData & __destination peoAsyncIslandMig( continuator & __cont, selector & __select, replacement & __replace, - Topology& __topology, - peoData & __source, - peoData & __destination + Topology& __topology ); //! @brief operator @@ -102,8 +98,6 @@ template< class EOT, class TYPE > class peoAsyncIslandMig : public Cooperative, //! @param selector & select //! @param replacement & replace //! @param Topology& topology - //! @param peoData & source - //! @param peoData & destination //! @param std :: queue< TYPE > imm //! @param std :: queue< TYPE > em //! @param std :: queue< Cooperative* > coop_em @@ -111,8 +105,6 @@ template< class EOT, class TYPE > class peoAsyncIslandMig : public Cooperative, selector & select; replacement & replace; Topology& topology; - peoData & source; - peoData & destination; std :: queue< TYPE > imm; std :: queue< TYPE > em; std :: queue< Cooperative* > coop_em; @@ -124,11 +116,9 @@ template< class EOT , class TYPE> peoAsyncIslandMig< EOT, TYPE > :: peoAsyncIsla continuator & __cont, selector & __select, replacement & __replace, - Topology& __topology, - peoData & __source, - peoData & __destination + Topology& __topology -) : select( __select ), replace( __replace ), topology( __topology ), source( __source ), destination( __destination ), cont(__cont) +) : select( __select ), replace( __replace ), topology( __topology ), cont(__cont) { __topology.add( *this ); diff --git a/trunk/paradiseo-peo/src/peoSyncIslandMig.h b/trunk/paradiseo-peo/src/peoSyncIslandMig.h index 7c12df50c..7bcd3e383 100644 --- a/trunk/paradiseo-peo/src/peoSyncIslandMig.h +++ b/trunk/paradiseo-peo/src/peoSyncIslandMig.h @@ -78,15 +78,11 @@ template< class EOT, class TYPE > class peoSyncIslandMig : public Cooperative, //! @param selector & __select //! @param replacement & __replace //! @param Topology& __topology - //! @param peoData & __source - //! @param eoData & __destination peoSyncIslandMig( unsigned __frequency, selector & __select, replacement & __replace, - Topology& __topology, - peoData & __source, - peoData & __destination + Topology& __topology ); //! @brief operator @@ -117,8 +113,6 @@ template< class EOT, class TYPE > class peoSyncIslandMig : public Cooperative, //! @param selector & select //! @param replacement & replace //! @param Topology& topology - //! @param peoData & source - //! @param peoData & destination //! @param std :: queue< TYPE > imm //! @param std :: queue< TYPE > em //! @param std :: queue< Cooperative* > coop_em @@ -131,8 +125,6 @@ template< class EOT, class TYPE > class peoSyncIslandMig : public Cooperative, selector & select; replacement & replace; Topology& topology; - peoData & source; - peoData & destination; std :: queue< TYPE > imm; std :: queue< TYPE > em; std :: queue< Cooperative* > coop_em; @@ -149,11 +141,8 @@ template< class EOT, class TYPE > peoSyncIslandMig< EOT,TYPE > :: peoSyncIslandM unsigned __frequency, selector & __select, replacement & __replace, - Topology& __topology, - peoData & __source, - peoData & __destination - -) : cont( __frequency ), select( __select ), replace( __replace ), topology( __topology ), source( __source ), destination( __destination ) + Topology& __topology +) : cont( __frequency ), select( __select ), replace( __replace ), topology( __topology ) { __topology.add( *this ); diff --git a/trunk/paradiseo-peo/test/t-EAAsyncIsland.cpp b/trunk/paradiseo-peo/test/t-EAAsyncIsland.cpp index 1bcbefe40..17018ccd7 100644 --- a/trunk/paradiseo-peo/test/t-EAAsyncIsland.cpp +++ b/trunk/paradiseo-peo/test/t-EAAsyncIsland.cpp @@ -33,7 +33,9 @@ int main (int __argc, char *__argv[]) eoRandomSelect mig_select_one; eoSelector > mig_select (mig_select_one,2,pop); eoReplace > mig_replace (replace,pop); - peoSyncIslandMig > mig(2,mig_select,mig_replace,topology,pop,pop); + eoPeriodicContinue< Indi > mig_cont( 2 ); + eoContinuator cont(mig_cont, pop); + peoAsyncIslandMig > mig(cont,mig_select,mig_replace,topology); checkpoint.add(mig); eoEasyEA< Indi > eaAlg( checkpoint, eval, select, transform, replace ); peoWrapper parallelEA( eaAlg, pop); @@ -58,7 +60,9 @@ int main (int __argc, char *__argv[]) eoRandomSelect mig_select_one2; eoSelector > mig_select2 (mig_select_one2,2,pop2); eoReplace > mig_replace2 (replace2,pop2); - peoSyncIslandMig > mig2(2,mig_select2,mig_replace2,topology,pop2,pop2); + eoPeriodicContinue< Indi > mig_cont2( 2 ); + eoContinuator cont2(mig_cont2, pop2); + peoAsyncIslandMig > mig2(cont2,mig_select2,mig_replace2,topology); checkpoint2.add(mig2); eoEasyEA< Indi > eaAlg2( checkpoint2, eval2, select2, transform2, replace2 ); peoWrapper parallelEA2( eaAlg2, pop2); diff --git a/trunk/paradiseo-peo/test/t-EASyncIsland.cpp b/trunk/paradiseo-peo/test/t-EASyncIsland.cpp index a7b1b8c83..94275355f 100644 --- a/trunk/paradiseo-peo/test/t-EASyncIsland.cpp +++ b/trunk/paradiseo-peo/test/t-EASyncIsland.cpp @@ -33,9 +33,7 @@ int main (int __argc, char *__argv[]) eoRandomSelect mig_select_one; eoSelector > mig_select (mig_select_one,2,pop); eoReplace > mig_replace (replace,pop); - eoPeriodicContinue< Indi > mig_cont( 2 ); - eoContinuator cont(mig_cont, pop); - peoAsyncIslandMig > mig(cont,mig_select,mig_replace,topology,pop,pop); + peoSyncIslandMig > mig(2,mig_select,mig_replace,topology); checkpoint.add(mig); eoEasyEA< Indi > eaAlg( checkpoint, eval, select, transform, replace ); peoWrapper parallelEA( eaAlg, pop); @@ -60,9 +58,7 @@ int main (int __argc, char *__argv[]) eoRandomSelect mig_select_one2; eoSelector > mig_select2 (mig_select_one2,2,pop2); eoReplace > mig_replace2 (replace2,pop2); - eoPeriodicContinue< Indi > mig_cont2( 2 ); - eoContinuator cont2(mig_cont2, pop2); - peoAsyncIslandMig > mig2(cont2,mig_select2,mig_replace2,topology,pop2,pop2); + peoSyncIslandMig > mig2(2,mig_select2,mig_replace2,topology); checkpoint2.add(mig2); eoEasyEA< Indi > eaAlg2( checkpoint2, eval2, select2, transform2, replace2 ); peoWrapper parallelEA2( eaAlg2, pop2); diff --git a/trunk/paradiseo-peo/test/t-PSOGlobalBest.cpp b/trunk/paradiseo-peo/test/t-PSOGlobalBest.cpp index 949445c6f..bde9f2fcb 100644 --- a/trunk/paradiseo-peo/test/t-PSOGlobalBest.cpp +++ b/trunk/paradiseo-peo/test/t-PSOGlobalBest.cpp @@ -61,9 +61,9 @@ int main (int __argc, char *__argv[]) eoContinuator cont2(mig_cont2,pop2); eoSelector > mig_select2 (mig_selec2,1,pop2); eoReplace > mig_replace2 (mig_replac2,pop2); - peoAsyncIslandMig< Indi, peoPop > mig(cont,mig_select, mig_replace, topologyMig, pop, pop); + peoAsyncIslandMig< Indi, peoPop > mig(cont,mig_select, mig_replace, topologyMig); checkpoint.add( mig ); - peoAsyncIslandMig< Indi, peoPop > mig2(cont2,mig_select2, mig_replace2, topologyMig, pop2, pop2); + peoAsyncIslandMig< Indi, peoPop > mig2(cont2,mig_select2, mig_replace2, topologyMig); checkpoint2.add( mig2 ); eoSyncEasyPSO psa(init,checkpoint,eval, velocity, flight); peoWrapper parallelPSO( psa, pop); diff --git a/trunk/paradiseo-peo/test/t-PSOWorstPosition.cpp b/trunk/paradiseo-peo/test/t-PSOWorstPosition.cpp index ea784d726..818f8cc86 100644 --- a/trunk/paradiseo-peo/test/t-PSOWorstPosition.cpp +++ b/trunk/paradiseo-peo/test/t-PSOWorstPosition.cpp @@ -61,9 +61,9 @@ int main (int __argc, char *__argv[]) eoContinuator cont2(mig_cont2,pop2); eoSelector > mig_select2 (mig_selec2,1,pop2); eoReplace > mig_replace2 (mig_replac2,pop2); - peoAsyncIslandMig< Indi, peoPop > mig(cont,mig_select, mig_replace, topologyMig, pop, pop); + peoAsyncIslandMig< Indi, peoPop > mig(cont,mig_select, mig_replace, topologyMig); checkpoint.add( mig ); - peoAsyncIslandMig< Indi, peoPop > mig2(cont2,mig_select2, mig_replace2, topologyMig, pop2, pop2); + peoAsyncIslandMig< Indi, peoPop > mig2(cont2,mig_select2, mig_replace2, topologyMig); checkpoint2.add( mig2 ); eoSyncEasyPSO psa(init,checkpoint,eval, velocity, flight); peoWrapper parallelPSO( psa, pop); diff --git a/trunk/paradiseo-peo/tutorial/Lesson3/mainEA.cpp b/trunk/paradiseo-peo/tutorial/Lesson3/mainEA.cpp index d05964201..87afcf059 100644 --- a/trunk/paradiseo-peo/tutorial/Lesson3/mainEA.cpp +++ b/trunk/paradiseo-peo/tutorial/Lesson3/mainEA.cpp @@ -90,7 +90,7 @@ int main (int __argc, char *__argv[]) eoRandomSelect mig_select_one; eoSelector > mig_select (mig_select_one,MIG_SIZE,pop); eoReplace > mig_replace (replace,pop); - peoSyncIslandMig > mig(MIG_FREQ,mig_select,mig_replace,topology,pop,pop); + peoSyncIslandMig > mig(MIG_FREQ,mig_select,mig_replace,topology); checkpoint.add(mig); eoEasyEA< Indi > eaAlg( checkpoint, eval, select, transform, replace ); peoWrapper parallelEA( eaAlg, pop); @@ -121,7 +121,7 @@ int main (int __argc, char *__argv[]) eoRandomSelect mig_select_one2; eoSelector > mig_select2 (mig_select_one2,MIG_SIZE,pop2); eoReplace > mig_replace2 (replace2,pop2); - peoSyncIslandMig > mig2(MIG_FREQ,mig_select2,mig_replace2,topology,pop2,pop2); + peoSyncIslandMig > mig2(MIG_FREQ,mig_select2,mig_replace2,topology); checkpoint2.add(mig2); eoEasyEA< Indi > eaAlg2( checkpoint2, eval2, select2, transform2, replace2 ); peoWrapper parallelEA2( eaAlg2, pop2); diff --git a/trunk/paradiseo-peo/tutorial/Lesson3/mainPSO.cpp b/trunk/paradiseo-peo/tutorial/Lesson3/mainPSO.cpp index 2e7b3a386..9e0e70d23 100644 --- a/trunk/paradiseo-peo/tutorial/Lesson3/mainPSO.cpp +++ b/trunk/paradiseo-peo/tutorial/Lesson3/mainPSO.cpp @@ -137,9 +137,9 @@ int main (int __argc, char *__argv[]) // Island model - peoAsyncIslandMig< Indi, peoPop > mig(cont,mig_select, mig_replace, topologyMig, pop, pop); + peoAsyncIslandMig< Indi, peoPop > mig(cont,mig_select, mig_replace, topologyMig); checkpoint.add( mig ); - peoAsyncIslandMig< Indi, peoPop > mig2(cont2,mig_select2, mig_replace2, topologyMig, pop2, pop2); + peoAsyncIslandMig< Indi, peoPop > mig2(cont2,mig_select2, mig_replace2, topologyMig); checkpoint2.add( mig2 );