Add to SyncMig with peoData
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@899 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
e4cd468545
commit
c775354e77
5 changed files with 156 additions and 79 deletions
|
|
@ -40,8 +40,9 @@
|
|||
#include "core/eoVector_mesg.h"
|
||||
#include "core/messaging.h"
|
||||
|
||||
|
||||
/**************************************************************************************/
|
||||
/************************** DEFINE A DATA ******************************************/
|
||||
/**************************************************************************************/
|
||||
|
||||
class peoData {
|
||||
public:
|
||||
|
|
@ -51,6 +52,9 @@ public:
|
|||
|
||||
};
|
||||
|
||||
|
||||
// Specific implementation : migration of a population
|
||||
|
||||
template<class EOT>
|
||||
class peoPop: public eoPop<EOT>, public peoData
|
||||
{
|
||||
|
|
@ -75,7 +79,9 @@ public:
|
|||
};
|
||||
|
||||
|
||||
/************************** DEFINE A CONTINUATOR ******************************************/
|
||||
/**************************************************************************************/
|
||||
/************************** DEFINE A CONTINUATOR ***********************************/
|
||||
/**************************************************************************************/
|
||||
|
||||
class continuator
|
||||
{
|
||||
|
|
@ -84,6 +90,8 @@ public:
|
|||
};
|
||||
|
||||
|
||||
// Specific implementation : migration of a population
|
||||
|
||||
template < class EOT> class eoContinuator : public continuator{
|
||||
public:
|
||||
|
||||
|
|
@ -99,7 +107,9 @@ protected:
|
|||
};
|
||||
|
||||
|
||||
/************************** DEFINE A SELECTOR ******************************************/
|
||||
/**************************************************************************************/
|
||||
/************************** DEFINE A SELECTOR **************************************/
|
||||
/**************************************************************************************/
|
||||
|
||||
template < class TYPE> class selector
|
||||
{
|
||||
|
|
@ -108,6 +118,8 @@ public:
|
|||
};
|
||||
|
||||
|
||||
// Specific implementation : migration of a population
|
||||
|
||||
template < class EOT, class TYPE> class eoSelector : public selector< TYPE >{
|
||||
public:
|
||||
|
||||
|
|
@ -128,7 +140,9 @@ protected:
|
|||
};
|
||||
|
||||
|
||||
/************************** DEFINE A REPLACEMENT ******************************************/
|
||||
/**************************************************************************************/
|
||||
/************************** DEFINE A REPLACEMENT ***********************************/
|
||||
/**************************************************************************************/
|
||||
|
||||
template < class TYPE> class replacement
|
||||
{
|
||||
|
|
@ -136,6 +150,9 @@ public:
|
|||
virtual void operator()(TYPE &)=0;
|
||||
};
|
||||
|
||||
|
||||
// Specific implementation : migration of a population
|
||||
|
||||
template < class EOT, class TYPE> class eoReplace : public replacement< TYPE >{
|
||||
public:
|
||||
eoReplace(eoReplacement<EOT> & _replace, TYPE & _destination): replace(_replace), destination(_destination){}
|
||||
|
|
@ -150,4 +167,32 @@ protected:
|
|||
TYPE & destination;
|
||||
};
|
||||
|
||||
|
||||
/**************************************************************************************/
|
||||
/************************ Continuator for synchrone migartion ************************/
|
||||
/**************************************************************************************/
|
||||
|
||||
class eoSyncContinue: public continuator
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
eoSyncContinue (unsigned __period, unsigned __init_counter = 0): period (__period),counter (__init_counter) {}
|
||||
|
||||
virtual bool check()
|
||||
{
|
||||
return ((++ counter) % period) != 0 ;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
|
||||
unsigned period;
|
||||
|
||||
unsigned counter;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue