Island modified
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@922 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
d912c44a58
commit
77506fb591
8 changed files with 22 additions and 43 deletions
|
|
@ -71,15 +71,11 @@ template< class EOT, class TYPE > class peoAsyncIslandMig : public Cooperative,
|
|||
//! @param selector <TYPE> & __select
|
||||
//! @param replacement <TYPE> & __replace
|
||||
//! @param Topology& __topology
|
||||
//! @param peoData & __source
|
||||
//! @param eoData & __destination
|
||||
peoAsyncIslandMig(
|
||||
continuator & __cont,
|
||||
selector <TYPE> & __select,
|
||||
replacement <TYPE> & __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 <TYPE> & select
|
||||
//! @param replacement <TYPE> & 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 <TYPE> & select;
|
||||
replacement <TYPE> & 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 <TYPE> & __select,
|
||||
replacement <TYPE> & __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 );
|
||||
|
|
|
|||
|
|
@ -78,15 +78,11 @@ template< class EOT, class TYPE > class peoSyncIslandMig : public Cooperative,
|
|||
//! @param selector <TYPE> & __select
|
||||
//! @param replacement <TYPE> & __replace
|
||||
//! @param Topology& __topology
|
||||
//! @param peoData & __source
|
||||
//! @param eoData & __destination
|
||||
peoSyncIslandMig(
|
||||
unsigned __frequency,
|
||||
selector <TYPE> & __select,
|
||||
replacement <TYPE> & __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 <TYPE> & select
|
||||
//! @param replacement <TYPE> & 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 <TYPE> & select;
|
||||
replacement <TYPE> & 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 <TYPE> & __select,
|
||||
replacement <TYPE> & __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 );
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ int main (int __argc, char *__argv[])
|
|||
eoRandomSelect<Indi> mig_select_one;
|
||||
eoSelector <Indi, peoPop<Indi> > mig_select (mig_select_one,2,pop);
|
||||
eoReplace <Indi, peoPop<Indi> > mig_replace (replace,pop);
|
||||
peoSyncIslandMig<Indi, peoPop<Indi> > mig(2,mig_select,mig_replace,topology,pop,pop);
|
||||
eoPeriodicContinue< Indi > mig_cont( 2 );
|
||||
eoContinuator<Indi> cont(mig_cont, pop);
|
||||
peoAsyncIslandMig<Indi, peoPop<Indi> > 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<Indi> mig_select_one2;
|
||||
eoSelector <Indi, peoPop<Indi> > mig_select2 (mig_select_one2,2,pop2);
|
||||
eoReplace <Indi, peoPop<Indi> > mig_replace2 (replace2,pop2);
|
||||
peoSyncIslandMig<Indi, peoPop<Indi> > mig2(2,mig_select2,mig_replace2,topology,pop2,pop2);
|
||||
eoPeriodicContinue< Indi > mig_cont2( 2 );
|
||||
eoContinuator<Indi> cont2(mig_cont2, pop2);
|
||||
peoAsyncIslandMig<Indi, peoPop<Indi> > mig2(cont2,mig_select2,mig_replace2,topology);
|
||||
checkpoint2.add(mig2);
|
||||
eoEasyEA< Indi > eaAlg2( checkpoint2, eval2, select2, transform2, replace2 );
|
||||
peoWrapper parallelEA2( eaAlg2, pop2);
|
||||
|
|
|
|||
|
|
@ -33,9 +33,7 @@ int main (int __argc, char *__argv[])
|
|||
eoRandomSelect<Indi> mig_select_one;
|
||||
eoSelector <Indi, peoPop<Indi> > mig_select (mig_select_one,2,pop);
|
||||
eoReplace <Indi, peoPop<Indi> > mig_replace (replace,pop);
|
||||
eoPeriodicContinue< Indi > mig_cont( 2 );
|
||||
eoContinuator<Indi> cont(mig_cont, pop);
|
||||
peoAsyncIslandMig<Indi, peoPop<Indi> > mig(cont,mig_select,mig_replace,topology,pop,pop);
|
||||
peoSyncIslandMig<Indi, peoPop<Indi> > 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<Indi> mig_select_one2;
|
||||
eoSelector <Indi, peoPop<Indi> > mig_select2 (mig_select_one2,2,pop2);
|
||||
eoReplace <Indi, peoPop<Indi> > mig_replace2 (replace2,pop2);
|
||||
eoPeriodicContinue< Indi > mig_cont2( 2 );
|
||||
eoContinuator<Indi> cont2(mig_cont2, pop2);
|
||||
peoAsyncIslandMig<Indi, peoPop<Indi> > mig2(cont2,mig_select2,mig_replace2,topology,pop2,pop2);
|
||||
peoSyncIslandMig<Indi, peoPop<Indi> > mig2(2,mig_select2,mig_replace2,topology);
|
||||
checkpoint2.add(mig2);
|
||||
eoEasyEA< Indi > eaAlg2( checkpoint2, eval2, select2, transform2, replace2 );
|
||||
peoWrapper parallelEA2( eaAlg2, pop2);
|
||||
|
|
|
|||
|
|
@ -61,9 +61,9 @@ int main (int __argc, char *__argv[])
|
|||
eoContinuator<Indi> cont2(mig_cont2,pop2);
|
||||
eoSelector <Indi, peoPop<Indi> > mig_select2 (mig_selec2,1,pop2);
|
||||
eoReplace <Indi, peoPop<Indi> > mig_replace2 (mig_replac2,pop2);
|
||||
peoAsyncIslandMig< Indi, peoPop<Indi> > mig(cont,mig_select, mig_replace, topologyMig, pop, pop);
|
||||
peoAsyncIslandMig< Indi, peoPop<Indi> > mig(cont,mig_select, mig_replace, topologyMig);
|
||||
checkpoint.add( mig );
|
||||
peoAsyncIslandMig< Indi, peoPop<Indi> > mig2(cont2,mig_select2, mig_replace2, topologyMig, pop2, pop2);
|
||||
peoAsyncIslandMig< Indi, peoPop<Indi> > mig2(cont2,mig_select2, mig_replace2, topologyMig);
|
||||
checkpoint2.add( mig2 );
|
||||
eoSyncEasyPSO <Indi> psa(init,checkpoint,eval, velocity, flight);
|
||||
peoWrapper parallelPSO( psa, pop);
|
||||
|
|
|
|||
|
|
@ -61,9 +61,9 @@ int main (int __argc, char *__argv[])
|
|||
eoContinuator<Indi> cont2(mig_cont2,pop2);
|
||||
eoSelector <Indi, peoPop<Indi> > mig_select2 (mig_selec2,1,pop2);
|
||||
eoReplace <Indi, peoPop<Indi> > mig_replace2 (mig_replac2,pop2);
|
||||
peoAsyncIslandMig< Indi, peoPop<Indi> > mig(cont,mig_select, mig_replace, topologyMig, pop, pop);
|
||||
peoAsyncIslandMig< Indi, peoPop<Indi> > mig(cont,mig_select, mig_replace, topologyMig);
|
||||
checkpoint.add( mig );
|
||||
peoAsyncIslandMig< Indi, peoPop<Indi> > mig2(cont2,mig_select2, mig_replace2, topologyMig, pop2, pop2);
|
||||
peoAsyncIslandMig< Indi, peoPop<Indi> > mig2(cont2,mig_select2, mig_replace2, topologyMig);
|
||||
checkpoint2.add( mig2 );
|
||||
eoSyncEasyPSO <Indi> psa(init,checkpoint,eval, velocity, flight);
|
||||
peoWrapper parallelPSO( psa, pop);
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ int main (int __argc, char *__argv[])
|
|||
eoRandomSelect<Indi> mig_select_one;
|
||||
eoSelector <Indi, peoPop<Indi> > mig_select (mig_select_one,MIG_SIZE,pop);
|
||||
eoReplace <Indi, peoPop<Indi> > mig_replace (replace,pop);
|
||||
peoSyncIslandMig<Indi, peoPop<Indi> > mig(MIG_FREQ,mig_select,mig_replace,topology,pop,pop);
|
||||
peoSyncIslandMig<Indi, peoPop<Indi> > 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<Indi> mig_select_one2;
|
||||
eoSelector <Indi, peoPop<Indi> > mig_select2 (mig_select_one2,MIG_SIZE,pop2);
|
||||
eoReplace <Indi, peoPop<Indi> > mig_replace2 (replace2,pop2);
|
||||
peoSyncIslandMig<Indi, peoPop<Indi> > mig2(MIG_FREQ,mig_select2,mig_replace2,topology,pop2,pop2);
|
||||
peoSyncIslandMig<Indi, peoPop<Indi> > mig2(MIG_FREQ,mig_select2,mig_replace2,topology);
|
||||
checkpoint2.add(mig2);
|
||||
eoEasyEA< Indi > eaAlg2( checkpoint2, eval2, select2, transform2, replace2 );
|
||||
peoWrapper parallelEA2( eaAlg2, pop2);
|
||||
|
|
|
|||
|
|
@ -137,9 +137,9 @@ int main (int __argc, char *__argv[])
|
|||
|
||||
// Island model
|
||||
|
||||
peoAsyncIslandMig< Indi, peoPop<Indi> > mig(cont,mig_select, mig_replace, topologyMig, pop, pop);
|
||||
peoAsyncIslandMig< Indi, peoPop<Indi> > mig(cont,mig_select, mig_replace, topologyMig);
|
||||
checkpoint.add( mig );
|
||||
peoAsyncIslandMig< Indi, peoPop<Indi> > mig2(cont2,mig_select2, mig_replace2, topologyMig, pop2, pop2);
|
||||
peoAsyncIslandMig< Indi, peoPop<Indi> > mig2(cont2,mig_select2, mig_replace2, topologyMig);
|
||||
checkpoint2.add( mig2 );
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue