new style peo
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1021 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
ef8ef3f3b2
commit
edb6d65a7b
34 changed files with 407 additions and 386 deletions
|
|
@ -80,10 +80,10 @@ COMM_ID getKey (const Communicable * __comm)
|
|||
}
|
||||
|
||||
void Communicable :: lock ()
|
||||
{
|
||||
{
|
||||
|
||||
sem_wait (& sem_lock);
|
||||
}
|
||||
sem_wait (& sem_lock);
|
||||
}
|
||||
|
||||
void Communicable :: unlock ()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* <complete_topo.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
|
|
@ -38,16 +38,19 @@
|
|||
#include "complete_topo.h"
|
||||
|
||||
void CompleteTopology :: setNeighbors (Cooperative * __mig,
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to) {
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to)
|
||||
{
|
||||
|
||||
__from.clear () ;
|
||||
__to.clear () ;
|
||||
|
||||
for (unsigned i = 0; i < mig.size (); i ++) {
|
||||
if (mig [i] != __mig) {
|
||||
__from.push_back (mig [i]);
|
||||
__to.push_back (mig [i]);
|
||||
}
|
||||
for (unsigned i = 0; i < mig.size (); i ++)
|
||||
{
|
||||
if (mig [i] != __mig)
|
||||
{
|
||||
__from.push_back (mig [i]);
|
||||
__to.push_back (mig [i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* <complete_topo.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
|
|
@ -39,13 +39,14 @@
|
|||
|
||||
#include "topology.h"
|
||||
|
||||
class CompleteTopology : public Topology {
|
||||
class CompleteTopology : public Topology
|
||||
{
|
||||
|
||||
public :
|
||||
public :
|
||||
|
||||
void setNeighbors (Cooperative * __mig,
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to);
|
||||
};
|
||||
void setNeighbors (Cooperative * __mig,
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* <random_topo.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
|
|
@ -40,16 +40,19 @@
|
|||
#include <utils/eoRNG.h>
|
||||
|
||||
void RandomTopology :: setNeighbors (Cooperative * __mig,
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to) {
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to)
|
||||
{
|
||||
|
||||
__from.clear () ;
|
||||
__to.clear () ;
|
||||
|
||||
for (unsigned i = 0; i < mig.size (); i ++) {
|
||||
if (mig [i] != __mig && rng.uniform() < 0.5 ) {
|
||||
__from.push_back (mig [i]);
|
||||
__to.push_back (mig [i]);
|
||||
}
|
||||
for (unsigned i = 0; i < mig.size (); i ++)
|
||||
{
|
||||
if (mig [i] != __mig && rng.uniform() < 0.5 )
|
||||
{
|
||||
__from.push_back (mig [i]);
|
||||
__to.push_back (mig [i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* <random_topo.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
|
|
@ -39,13 +39,14 @@
|
|||
|
||||
#include "topology.h"
|
||||
|
||||
class RandomTopology : public Topology {
|
||||
class RandomTopology : public Topology
|
||||
{
|
||||
|
||||
public :
|
||||
public :
|
||||
|
||||
void setNeighbors (Cooperative * __mig,
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to);
|
||||
};
|
||||
void setNeighbors (Cooperative * __mig,
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* <star_topo.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
|
|
@ -40,30 +40,36 @@
|
|||
StarTopology :: StarTopology () : center( NULL ) {}
|
||||
|
||||
void StarTopology :: setNeighbors (Cooperative * __mig,
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to) {
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to)
|
||||
{
|
||||
|
||||
assert( center != NULL );
|
||||
|
||||
__from.clear () ;
|
||||
__to.clear () ;
|
||||
|
||||
if ( __mig == center ) {
|
||||
if ( __mig == center )
|
||||
{
|
||||
|
||||
for (unsigned i = 0; i < mig.size (); i ++) {
|
||||
if (mig [i] != center) {
|
||||
__from.push_back (mig [i]);
|
||||
__to.push_back (mig [i]);
|
||||
}
|
||||
for (unsigned i = 0; i < mig.size (); i ++)
|
||||
{
|
||||
if (mig [i] != center)
|
||||
{
|
||||
__from.push_back (mig [i]);
|
||||
__to.push_back (mig [i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
__from.push_back (center);
|
||||
__to.push_back (center);
|
||||
}
|
||||
}
|
||||
else {
|
||||
__from.push_back (center);
|
||||
__to.push_back (center);
|
||||
}
|
||||
}
|
||||
|
||||
void StarTopology :: setCenter (Cooperative& __center) {
|
||||
void StarTopology :: setCenter (Cooperative& __center)
|
||||
{
|
||||
|
||||
center = &__center;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* <star_topo.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
|
|
@ -39,21 +39,22 @@
|
|||
|
||||
#include "topology.h"
|
||||
|
||||
class StarTopology : public Topology {
|
||||
class StarTopology : public Topology
|
||||
{
|
||||
|
||||
public :
|
||||
public :
|
||||
|
||||
StarTopology ();
|
||||
StarTopology ();
|
||||
|
||||
void setNeighbors (Cooperative * __mig,
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to);
|
||||
void setNeighbors (Cooperative * __mig,
|
||||
std :: vector <Cooperative *> & __from,
|
||||
std :: vector <Cooperative *> & __to);
|
||||
|
||||
void setCenter (Cooperative& __center);
|
||||
void setCenter (Cooperative& __center);
|
||||
|
||||
private :
|
||||
private :
|
||||
|
||||
Cooperative* center;
|
||||
};
|
||||
Cooperative* center;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -43,10 +43,10 @@ Topology :: ~ Topology ()
|
|||
}
|
||||
|
||||
void Topology :: add (Cooperative & __mig)
|
||||
{
|
||||
{
|
||||
|
||||
mig.push_back (& __mig) ;
|
||||
}
|
||||
mig.push_back (& __mig) ;
|
||||
}
|
||||
|
||||
Topology :: operator std :: vector <Cooperative *>& ()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
|
||||
|
||||
//! @class peoAsyncIslandMig
|
||||
//! @brief Specific class for a asynchronous migration
|
||||
//! @brief Specific class for a asynchronous migration
|
||||
//! @see Cooperative eoUpdater
|
||||
//! @version 2.0
|
||||
//! @date january 2008
|
||||
|
|
@ -67,18 +67,18 @@ template< class TYPESELECT, class TYPEREPLACE > class peoAsyncIslandMig : public
|
|||
public:
|
||||
|
||||
//! @brief Constructor
|
||||
//! @param continuator & __cont
|
||||
//! @param selector <TYPE> & __select
|
||||
//! @param replacement <TYPE> & __replace
|
||||
//! @param Topology& __topology
|
||||
peoAsyncIslandMig(
|
||||
//! @param continuator & __cont
|
||||
//! @param selector <TYPE> & __select
|
||||
//! @param replacement <TYPE> & __replace
|
||||
//! @param Topology& __topology
|
||||
peoAsyncIslandMig(
|
||||
continuator & __cont,
|
||||
selector <TYPESELECT> & __select,
|
||||
replacement <TYPEREPLACE> & __replace,
|
||||
Topology& __topology
|
||||
);
|
||||
|
||||
//! @brief operator
|
||||
//! @brief operator
|
||||
void operator()();
|
||||
//! @brief Function realizing packages
|
||||
void pack();
|
||||
|
|
@ -88,23 +88,23 @@ template< class TYPESELECT, class TYPEREPLACE > class peoAsyncIslandMig : public
|
|||
void packSynchronizeReq();
|
||||
|
||||
private:
|
||||
//! @brief Function which sends some emigrants
|
||||
//! @brief Function which sends some emigrants
|
||||
void emigrate();
|
||||
//! @brief Function which receives some immigrants
|
||||
void immigrate();
|
||||
|
||||
private:
|
||||
//! @param continuator & cont
|
||||
//! @param selector <TYPESELECT> & select
|
||||
//! @param replacement <TYPEREPLACE> & replace
|
||||
//! @param Topology& topology
|
||||
//! @param std :: queue< TYPEREPLACE > imm
|
||||
//! @param std :: queue< TYPESELECT > em
|
||||
//! @param std :: queue< Cooperative* > coop_em
|
||||
continuator & cont;
|
||||
selector <TYPESELECT> & select;
|
||||
replacement <TYPEREPLACE> & replace;
|
||||
Topology& topology;
|
||||
//! @param continuator & cont
|
||||
//! @param selector <TYPESELECT> & select
|
||||
//! @param replacement <TYPEREPLACE> & replace
|
||||
//! @param Topology& topology
|
||||
//! @param std :: queue< TYPEREPLACE > imm
|
||||
//! @param std :: queue< TYPESELECT > em
|
||||
//! @param std :: queue< Cooperative* > coop_em
|
||||
continuator & cont;
|
||||
selector <TYPESELECT> & select;
|
||||
replacement <TYPEREPLACE> & replace;
|
||||
Topology& topology;
|
||||
std :: queue< TYPEREPLACE > imm;
|
||||
std :: queue< TYPESELECT > em;
|
||||
std :: queue< Cooperative* > coop_em;
|
||||
|
|
@ -189,8 +189,8 @@ template< class TYPESELECT , class TYPEREPLACE> void peoAsyncIslandMig< TYPESELE
|
|||
if (! cont.check())
|
||||
{
|
||||
|
||||
emigrate();
|
||||
immigrate();
|
||||
emigrate();
|
||||
immigrate();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@
|
|||
class continuator
|
||||
{
|
||||
public:
|
||||
|
||||
//! @brief Virtual function of check
|
||||
//! @return true if the algorithm must continue
|
||||
|
||||
//! @brief Virtual function of check
|
||||
//! @return true if the algorithm must continue
|
||||
virtual bool check()=0;
|
||||
//! @brief Virtual destructor
|
||||
virtual ~continuator(){}
|
||||
|
|
@ -69,22 +69,22 @@ template < class EOT> class eoContinuator : public continuator
|
|||
{
|
||||
public:
|
||||
|
||||
//! @brief Constructor
|
||||
//! @param eoContinue<EOT> &
|
||||
//! @param eoPop<EOT> &
|
||||
//! @brief Constructor
|
||||
//! @param eoContinue<EOT> &
|
||||
//! @param eoPop<EOT> &
|
||||
eoContinuator(eoContinue<EOT> & _cont, const eoPop<EOT> & _pop): cont (_cont), pop(_pop)
|
||||
{}
|
||||
|
||||
//! @brief Virtual function of check
|
||||
//! @return false if the algorithm must continue
|
||||
//! @brief Virtual function of check
|
||||
//! @return false if the algorithm must continue
|
||||
virtual bool check()
|
||||
{
|
||||
return cont(pop);
|
||||
}
|
||||
|
||||
protected:
|
||||
//! @param eoContinue<EOT> &
|
||||
//! @param eoPop<EOT> &
|
||||
//! @param eoContinue<EOT> &
|
||||
//! @param eoPop<EOT> &
|
||||
eoContinue<EOT> & cont ;
|
||||
const eoPop<EOT> & pop;
|
||||
};
|
||||
|
|
@ -101,9 +101,9 @@ template < class EOT> class eoContinuator : public continuator
|
|||
template < class TYPE> class selector
|
||||
{
|
||||
public:
|
||||
|
||||
//! @brief Virtual operator on the template type
|
||||
//! @param TYPE &
|
||||
|
||||
//! @brief Virtual operator on the template type
|
||||
//! @param TYPE &
|
||||
virtual void operator()(TYPE &)=0;
|
||||
//! @brief Virtual destructor
|
||||
virtual ~selector(){}
|
||||
|
|
@ -119,16 +119,16 @@ template < class EOT, class TYPE> class eoSelector : public selector< TYPE >
|
|||
{
|
||||
public:
|
||||
|
||||
//! @brief Constructor
|
||||
//! @param eoSelectOne<EOT> &
|
||||
//! @param unsigned _nb_select
|
||||
//! @param TYPE & _source (with TYPE which is the template type)
|
||||
//! @brief Constructor
|
||||
//! @param eoSelectOne<EOT> &
|
||||
//! @param unsigned _nb_select
|
||||
//! @param TYPE & _source (with TYPE which is the template type)
|
||||
eoSelector(eoSelectOne<EOT> & _select, unsigned _nb_select, const TYPE & _source): selector (_select), nb_select(_nb_select), source(_source)
|
||||
{}
|
||||
|
||||
//! @brief Virtual operator on the template type
|
||||
//! @param TYPE & _dest
|
||||
virtual void operator()(TYPE & _dest)
|
||||
|
||||
//! @brief Virtual operator on the template type
|
||||
//! @param TYPE & _dest
|
||||
virtual void operator()(TYPE & _dest)
|
||||
{
|
||||
size_t target = static_cast<size_t>(nb_select);
|
||||
_dest.resize(target);
|
||||
|
|
@ -137,9 +137,9 @@ template < class EOT, class TYPE> class eoSelector : public selector< TYPE >
|
|||
}
|
||||
|
||||
protected:
|
||||
//! @param eoSelectOne<EOT> &
|
||||
//! @param unsigned nb_select
|
||||
//! @param TYPE & source
|
||||
//! @param eoSelectOne<EOT> &
|
||||
//! @param unsigned nb_select
|
||||
//! @param TYPE & source
|
||||
eoSelectOne<EOT> & selector ;
|
||||
unsigned nb_select;
|
||||
const TYPE & source;
|
||||
|
|
@ -157,8 +157,8 @@ template < class EOT, class TYPE> class eoSelector : public selector< TYPE >
|
|||
template < class TYPE> class replacement
|
||||
{
|
||||
public:
|
||||
//! @brief Virtual operator on the template type
|
||||
//! @param TYPE &
|
||||
//! @brief Virtual operator on the template type
|
||||
//! @param TYPE &
|
||||
virtual void operator()(TYPE &)=0;
|
||||
//! @brief Virtual destructor
|
||||
virtual ~replacement(){}
|
||||
|
|
@ -173,22 +173,22 @@ template < class TYPE> class replacement
|
|||
template < class EOT, class TYPE> class eoReplace : public replacement< TYPE >
|
||||
{
|
||||
public:
|
||||
//! @brief Constructor
|
||||
//! @param eoReplacement<EOT> &
|
||||
//! @param TYPE & _destination (with TYPE which is the template type)
|
||||
//! @brief Constructor
|
||||
//! @param eoReplacement<EOT> &
|
||||
//! @param TYPE & _destination (with TYPE which is the template type)
|
||||
eoReplace(eoReplacement<EOT> & _replace, TYPE & _destination): replace(_replace), destination(_destination)
|
||||
{}
|
||||
|
||||
//! @brief Virtual operator on the template type
|
||||
//! @param TYPE & _source
|
||||
//! @brief Virtual operator on the template type
|
||||
//! @param TYPE & _source
|
||||
virtual void operator()(TYPE & _source)
|
||||
{
|
||||
replace(destination, _source);
|
||||
}
|
||||
|
||||
protected:
|
||||
//! @param eoReplacement<EOT> &
|
||||
//! @param TYPE & destination
|
||||
//! @param eoReplacement<EOT> &
|
||||
//! @param TYPE & destination
|
||||
eoReplacement<EOT> & replace;
|
||||
TYPE & destination;
|
||||
};
|
||||
|
|
@ -207,14 +207,14 @@ class eoSyncContinue: public continuator
|
|||
{
|
||||
|
||||
public:
|
||||
//! @brief Constructor
|
||||
//! @param unsigned __period
|
||||
//! @param unsigned __init_counter
|
||||
//! @brief Constructor
|
||||
//! @param unsigned __period
|
||||
//! @param unsigned __init_counter
|
||||
eoSyncContinue (unsigned __period, unsigned __init_counter = 0): period (__period),counter (__init_counter)
|
||||
{}
|
||||
|
||||
//! @brief Virtual function of check
|
||||
//! @return true if the algorithm must continue
|
||||
//! @brief Virtual function of check
|
||||
//! @return true if the algorithm must continue
|
||||
virtual bool check()
|
||||
{
|
||||
return ((++ counter) % period) != 0 ;
|
||||
|
|
@ -222,8 +222,8 @@ class eoSyncContinue: public continuator
|
|||
|
||||
|
||||
private:
|
||||
//! @param unsigned period
|
||||
//! @param unsigned counter
|
||||
//! @param unsigned period
|
||||
//! @param unsigned counter
|
||||
unsigned period;
|
||||
unsigned counter;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -50,21 +50,21 @@ template< class EOT, class FitT = typename EOT::Fitness, class FunctionArg = con
|
|||
struct peoEvalFunc: public eoEvalFunc<EOT>
|
||||
{
|
||||
|
||||
//! @brief Constructor
|
||||
//! @param FitT (* _eval)( FunctionArg )
|
||||
//! @brief Constructor
|
||||
//! @param FitT (* _eval)( FunctionArg )
|
||||
peoEvalFunc( FitT (* _eval)( FunctionArg ) )
|
||||
: eoEvalFunc<EOT>(), evalFunc( _eval )
|
||||
{};
|
||||
|
||||
//! @brief Virtual operator
|
||||
//! @param EOT & _peo
|
||||
//! @brief Virtual operator
|
||||
//! @param EOT & _peo
|
||||
virtual void operator() ( EOT & _peo )
|
||||
{
|
||||
_peo.fitness((*evalFunc)( _peo ));
|
||||
};
|
||||
|
||||
private:
|
||||
//! @param FitT (* evalFunc )( FunctionArg )
|
||||
//! @param FitT (* evalFunc )( FunctionArg )
|
||||
FitT (* evalFunc )( FunctionArg );
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -71,10 +71,10 @@ template< class EOT > class peoMoeoPopEval : public Service, public eoPopEvalFun
|
|||
//!
|
||||
//! @param eoPop< EOT >& __pop - population to be evaluated by applying the evaluation functor specified in the constructor.
|
||||
void operator()(eoPop< EOT >& __pop);
|
||||
|
||||
|
||||
//! @brief Operator ()( eoPop< EOT >& __dummy, eoPop< EOT >& __pop )
|
||||
//! @param eoPop< EOT >& __dummy
|
||||
//! @param eoPop< EOT >& __pop
|
||||
//! @param eoPop< EOT >& __dummy
|
||||
//! @param eoPop< EOT >& __pop
|
||||
void operator()( eoPop< EOT >& __dummy, eoPop< EOT >& __pop );
|
||||
|
||||
//! Auxiliary function for transferring data between the process requesting an evaluation operation and the process that
|
||||
|
|
@ -105,16 +105,16 @@ template< class EOT > class peoMoeoPopEval : public Service, public eoPopEvalFun
|
|||
void notifySendingAllResourceRequests();
|
||||
|
||||
private:
|
||||
//! @param std :: vector< eoEvalFunc < EOT >* >& funcs
|
||||
//! @param std :: vector< eoEvalFunc < EOT >* > one_func
|
||||
//! @param peoAggEvalFunc< EOT >& merge_eval
|
||||
//! @param peoNoAggEvalFunc< EOT > no_merge_eval
|
||||
//! @param std :: queue< EOT* >tasks
|
||||
//! @param std :: map< EOT*, std :: pair< unsigned, unsigned > > progression
|
||||
//! @param unsigned num_func
|
||||
//! @param EOT sol
|
||||
//! @param EOT *ad_sol
|
||||
//! @param unsigned total
|
||||
//! @param std :: vector< eoEvalFunc < EOT >* >& funcs
|
||||
//! @param std :: vector< eoEvalFunc < EOT >* > one_func
|
||||
//! @param peoAggEvalFunc< EOT >& merge_eval
|
||||
//! @param peoNoAggEvalFunc< EOT > no_merge_eval
|
||||
//! @param std :: queue< EOT* >tasks
|
||||
//! @param std :: map< EOT*, std :: pair< unsigned, unsigned > > progression
|
||||
//! @param unsigned num_func
|
||||
//! @param EOT sol
|
||||
//! @param EOT *ad_sol
|
||||
//! @param unsigned total
|
||||
const std :: vector< eoEvalFunc < EOT >* >& funcs;
|
||||
std :: vector< eoEvalFunc < EOT >* > one_func;
|
||||
peoAggEvalFunc< EOT >& merge_eval;
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ template < typename EntityType > class peoMultiStart : public Service
|
|||
|
||||
public:
|
||||
|
||||
//! @brief Constructor
|
||||
//! @param AlgorithmType& externalAlgorithm
|
||||
//! @brief Constructor
|
||||
//! @param AlgorithmType& externalAlgorithm
|
||||
template < typename AlgorithmType > peoMultiStart( AlgorithmType& externalAlgorithm )
|
||||
{
|
||||
singularAlgorithm = new Algorithm< AlgorithmType >( externalAlgorithm );
|
||||
|
|
@ -60,18 +60,18 @@ template < typename EntityType > class peoMultiStart : public Service
|
|||
aggregationFunction = new NoAggregationFunction();
|
||||
}
|
||||
|
||||
//! @brief Constructor
|
||||
//! @param AlgorithmReturnType (*externalAlgorithm)( AlgorithmDataType& )
|
||||
//! @brief Constructor
|
||||
//! @param AlgorithmReturnType (*externalAlgorithm)( AlgorithmDataType& )
|
||||
template < typename AlgorithmReturnType, typename AlgorithmDataType > peoMultiStart( AlgorithmReturnType (*externalAlgorithm)( AlgorithmDataType& ) )
|
||||
{
|
||||
singularAlgorithm = new FunctionAlgorithm< AlgorithmReturnType, AlgorithmDataType >( externalAlgorithm );
|
||||
algorithms.push_back( singularAlgorithm );
|
||||
aggregationFunction = new NoAggregationFunction();
|
||||
}
|
||||
|
||||
//! @brief Constructor
|
||||
//! @param std::vector< AlgorithmType* >& externalAlgorithms
|
||||
//! @param AggregationFunctionType& externalAggregationFunction
|
||||
|
||||
//! @brief Constructor
|
||||
//! @param std::vector< AlgorithmType* >& externalAlgorithms
|
||||
//! @param AggregationFunctionType& externalAggregationFunction
|
||||
template < typename AlgorithmType, typename AggregationFunctionType > peoMultiStart( std::vector< AlgorithmType* >& externalAlgorithms, AggregationFunctionType& externalAggregationFunction )
|
||||
{
|
||||
for ( unsigned int index = 0; index < externalAlgorithms.size(); index++ )
|
||||
|
|
@ -81,9 +81,9 @@ template < typename EntityType > class peoMultiStart : public Service
|
|||
aggregationFunction = new AggregationAlgorithm< AggregationFunctionType >( externalAggregationFunction );
|
||||
}
|
||||
|
||||
//! @brief Constructor
|
||||
//! @param std::vector< AlgorithmReturnType (*)( AlgorithmDataType& ) >& externalAlgorithms
|
||||
//! @param AggregationFunctionType& externalAggregationFunction
|
||||
//! @brief Constructor
|
||||
//! @param std::vector< AlgorithmReturnType (*)( AlgorithmDataType& ) >& externalAlgorithms
|
||||
//! @param AggregationFunctionType& externalAggregationFunction
|
||||
template < typename AlgorithmReturnType, typename AlgorithmDataType, typename AggregationFunctionType > peoMultiStart( std::vector< AlgorithmReturnType (*)( AlgorithmDataType& ) >& externalAlgorithms, AggregationFunctionType& externalAggregationFunction )
|
||||
{
|
||||
for ( unsigned int index = 0; index < externalAlgorithms.size(); index++ )
|
||||
|
|
@ -93,16 +93,16 @@ template < typename EntityType > class peoMultiStart : public Service
|
|||
aggregationFunction = new AggregationAlgorithm< AggregationFunctionType >( externalAggregationFunction );
|
||||
}
|
||||
|
||||
//! @brief Destructor
|
||||
//! @brief Destructor
|
||||
~peoMultiStart()
|
||||
{
|
||||
for ( unsigned int index = 0; index < data.size(); index++ ) delete data[ index ];
|
||||
for ( unsigned int index = 0; index < algorithms.size(); index++ ) delete algorithms[ index ];
|
||||
delete aggregationFunction;
|
||||
for ( unsigned int index = 0; index < algorithms.size(); index++ ) delete algorithms[ index ];
|
||||
delete aggregationFunction;
|
||||
}
|
||||
|
||||
//! @brief operator on the template type
|
||||
//! @param Type& externalData
|
||||
//! @brief operator on the template type
|
||||
//! @param Type& externalData
|
||||
template < typename Type > void operator()( Type& externalData )
|
||||
{
|
||||
for ( typename Type::iterator externalDataIterator = externalData.begin(); externalDataIterator != externalData.end(); externalDataIterator++ )
|
||||
|
|
@ -114,9 +114,9 @@ template < typename EntityType > class peoMultiStart : public Service
|
|||
stop();
|
||||
}
|
||||
|
||||
//! @brief operator on the template type
|
||||
//! @param Type& externalDataBegin
|
||||
//! @param Type& externalDataEnd
|
||||
//! @brief operator on the template type
|
||||
//! @param Type& externalDataBegin
|
||||
//! @param Type& externalDataEnd
|
||||
template < typename Type > void operator()( const Type& externalDataBegin, const Type& externalDataEnd )
|
||||
{
|
||||
for ( Type externalDataIterator = externalDataBegin; externalDataIterator != externalDataEnd; externalDataIterator++ )
|
||||
|
|
@ -128,32 +128,32 @@ template < typename EntityType > class peoMultiStart : public Service
|
|||
stop();
|
||||
}
|
||||
|
||||
//! @brief Function realizing packages of data
|
||||
//! @brief Function realizing packages of data
|
||||
void packData();
|
||||
//! @brief Function reconstituting packages of data
|
||||
void unpackData();
|
||||
//! @brief Function which executes the algorithm
|
||||
//! @brief Function which executes the algorithm
|
||||
void execute();
|
||||
//! @brief Function realizing packages of the result
|
||||
//! @brief Function realizing packages of the result
|
||||
void packResult();
|
||||
//! @brief Function reconstituting packages of result
|
||||
//! @brief Function reconstituting packages of result
|
||||
void unpackResult();
|
||||
//! @brief Function notifySendingData
|
||||
//! @brief Function notifySendingData
|
||||
void notifySendingData();
|
||||
//! @brief Function notifySendingAllResourceRequests
|
||||
//! @brief Function notifySendingAllResourceRequests
|
||||
void notifySendingAllResourceRequests();
|
||||
|
||||
private:
|
||||
|
||||
//! @param AbstractAlgorithm* singularAlgorithm
|
||||
//! @param std::vector< AbstractAlgorithm* > algorithms
|
||||
//! @param AbstractAggregationAlgorithm* aggregationFunction
|
||||
//! @param EntityType entityTypeInstance
|
||||
//! @param std::vector< AbstractDataType* > data
|
||||
//! @param unsigned idx
|
||||
//! @param unsigned num_term
|
||||
//! @param unsigned dataIndex
|
||||
//! @param unsigned functionIndex
|
||||
|
||||
//! @param AbstractAlgorithm* singularAlgorithm
|
||||
//! @param std::vector< AbstractAlgorithm* > algorithms
|
||||
//! @param AbstractAggregationAlgorithm* aggregationFunction
|
||||
//! @param EntityType entityTypeInstance
|
||||
//! @param std::vector< AbstractDataType* > data
|
||||
//! @param unsigned idx
|
||||
//! @param unsigned num_term
|
||||
//! @param unsigned dataIndex
|
||||
//! @param unsigned functionIndex
|
||||
template < typename Type > struct DataType;
|
||||
struct AbstractDataType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -55,27 +55,27 @@ template <class POT> class peoPSOSelect: public eoSelectOne<POT>
|
|||
{
|
||||
public:
|
||||
|
||||
//! @brief Constructor
|
||||
//! @param eoTopology < POT > & _topology
|
||||
//! @brief Constructor
|
||||
//! @param eoTopology < POT > & _topology
|
||||
peoPSOSelect(eoTopology < POT > & _topology):topology(_topology)
|
||||
{}
|
||||
|
||||
//! @brief typedef : creation of Fitness
|
||||
//! @brief typedef : creation of Fitness
|
||||
typedef typename PO < POT >::Fitness Fitness;
|
||||
|
||||
//! @brief Virtual operator
|
||||
//! @param eoPop<POT>& _pop
|
||||
//! @return POT&
|
||||
//! @brief Virtual operator
|
||||
//! @param eoPop<POT>& _pop
|
||||
//! @return POT&
|
||||
virtual const POT& operator()(const eoPop<POT>& _pop)
|
||||
{
|
||||
return topology.globalBest(_pop);
|
||||
}
|
||||
|
||||
private:
|
||||
//! @param eoTopology < POT > & topology
|
||||
//! @param eoTopology < POT > & topology
|
||||
eoTopology < POT > & topology;
|
||||
};
|
||||
|
||||
|
||||
//! @class peoGlobalBestVelocity
|
||||
//! @brief Specific class for a replacement thanks to the velocity migration of a population of a PSO
|
||||
//! @see eoReplacement
|
||||
|
|
@ -86,18 +86,18 @@ class peoGlobalBestVelocity : public eoReplacement<POT>
|
|||
{
|
||||
public:
|
||||
|
||||
//! @brief typedef : creation of VelocityType
|
||||
//! @brief typedef : creation of VelocityType
|
||||
typedef typename POT::ParticleVelocityType VelocityType;
|
||||
|
||||
//! @brief Constructor
|
||||
//! @param double & _c3
|
||||
//! @param eoVelocity < POT > &_velocity
|
||||
//! @brief Constructor
|
||||
//! @param double & _c3
|
||||
//! @param eoVelocity < POT > &_velocity
|
||||
peoGlobalBestVelocity( const double & _c3, eoVelocity < POT > &_velocity): c3 (_c3),velocity (_velocity)
|
||||
{}
|
||||
|
||||
//! @brief Virtual operator
|
||||
//! @param eoPop<POT>& _dest
|
||||
//! @param eoPop<POT>& _source
|
||||
//! @brief Virtual operator
|
||||
//! @param eoPop<POT>& _dest
|
||||
//! @param eoPop<POT>& _source
|
||||
void operator()(eoPop<POT>& _dest, eoPop<POT>& _source)
|
||||
{
|
||||
|
||||
|
|
@ -113,12 +113,12 @@ class peoGlobalBestVelocity : public eoReplacement<POT>
|
|||
}
|
||||
|
||||
protected:
|
||||
//! @param double & c3
|
||||
//! @param eoVelocity < POT > & velocity
|
||||
//! @param double & c3
|
||||
//! @param eoVelocity < POT > & velocity
|
||||
const double & c3;
|
||||
eoVelocity < POT > & velocity;
|
||||
};
|
||||
|
||||
|
||||
//! @class peoWorstPositionReplacement
|
||||
//! @brief Specific class for a replacement of a population of a PSO
|
||||
//! @see eoReplacement
|
||||
|
|
@ -127,13 +127,13 @@ class peoGlobalBestVelocity : public eoReplacement<POT>
|
|||
template <class POT> class peoWorstPositionReplacement : public eoReplacement<POT>
|
||||
{
|
||||
public:
|
||||
//! @brief constructor
|
||||
//! @brief constructor
|
||||
peoWorstPositionReplacement()
|
||||
{}
|
||||
|
||||
//! @brief operator
|
||||
//! @param eoPop<POT>& _dest
|
||||
//! @param eoPop<POT>& _source
|
||||
//! @brief operator
|
||||
//! @param eoPop<POT>& _dest
|
||||
//! @param eoPop<POT>& _source
|
||||
void operator()(eoPop<POT>& _dest, eoPop<POT>& _source)
|
||||
{
|
||||
unsigned ind=0;
|
||||
|
|
|
|||
|
|
@ -71,10 +71,10 @@ template< class EOT > class peoPopEval : public Service, public eoPopEvalFunc<EO
|
|||
//!
|
||||
//! @param eoPop< EOT >& __pop - population to be evaluated by applying the evaluation functor specified in the constructor.
|
||||
void operator()(eoPop< EOT >& __pop);
|
||||
|
||||
|
||||
//! @brief Operator ()( eoPop< EOT >& __dummy, eoPop< EOT >& __pop )
|
||||
//! @param eoPop< EOT >& __dummy
|
||||
//! @param eoPop< EOT >& __pop
|
||||
//! @param eoPop< EOT >& __dummy
|
||||
//! @param eoPop< EOT >& __pop
|
||||
void operator()( eoPop< EOT >& __dummy, eoPop< EOT >& __pop );
|
||||
|
||||
//! Auxiliary function for transferring data between the process requesting an evaluation operation and the process that
|
||||
|
|
@ -106,16 +106,16 @@ template< class EOT > class peoPopEval : public Service, public eoPopEvalFunc<EO
|
|||
|
||||
private:
|
||||
|
||||
//! @param std :: vector< eoEvalFunc < EOT >* >& funcs
|
||||
//! @param std :: vector< eoEvalFunc < EOT >* > one_func
|
||||
//! @param peoAggEvalFunc< EOT >& merge_eval
|
||||
//! @param peoNoAggEvalFunc< EOT > no_merge_eval
|
||||
//! @param std :: queue< EOT* >tasks
|
||||
//! @param std :: map< EOT*, std :: pair< unsigned, unsigned > > progression
|
||||
//! @param unsigned num_func
|
||||
//! @param EOT sol
|
||||
//! @param EOT *ad_sol
|
||||
//! @param unsigned total
|
||||
//! @param std :: vector< eoEvalFunc < EOT >* >& funcs
|
||||
//! @param std :: vector< eoEvalFunc < EOT >* > one_func
|
||||
//! @param peoAggEvalFunc< EOT >& merge_eval
|
||||
//! @param peoNoAggEvalFunc< EOT > no_merge_eval
|
||||
//! @param std :: queue< EOT* >tasks
|
||||
//! @param std :: map< EOT*, std :: pair< unsigned, unsigned > > progression
|
||||
//! @param unsigned num_func
|
||||
//! @param EOT sol
|
||||
//! @param EOT *ad_sol
|
||||
//! @param unsigned total
|
||||
const std :: vector< eoEvalFunc < EOT >* >& funcs;
|
||||
std :: vector< eoEvalFunc < EOT >* > one_func;
|
||||
peoAggEvalFunc< EOT >& merge_eval;
|
||||
|
|
@ -153,23 +153,23 @@ template< class EOT > void peoPopEval< EOT >::operator()(eoPop< EOT >& __dummy,
|
|||
|
||||
template< class EOT > void peoPopEval< EOT >::operator()(eoPop< EOT >& __pop )
|
||||
{
|
||||
if ( __pop.size() && (funcs.size() * __pop.size()) )
|
||||
{
|
||||
for ( unsigned i = 0; i < __pop.size(); i++ )
|
||||
{
|
||||
__pop[ i ].fitness(typename EOT :: Fitness() );
|
||||
progression[ &__pop[ i ] ].first = funcs.size() - 1;
|
||||
progression[ &__pop[ i ] ].second = funcs.size();
|
||||
for ( unsigned j = 0; j < funcs.size(); j++ )
|
||||
{
|
||||
/* Queuing the 'invalid' solution and its associated owner */
|
||||
tasks.push( &__pop[ i ] );
|
||||
}
|
||||
}
|
||||
total = funcs.size() * __pop.size();
|
||||
requestResourceRequest( funcs.size() * __pop.size() );
|
||||
stop();
|
||||
}
|
||||
if ( __pop.size() && (funcs.size() * __pop.size()) )
|
||||
{
|
||||
for ( unsigned i = 0; i < __pop.size(); i++ )
|
||||
{
|
||||
__pop[ i ].fitness(typename EOT :: Fitness() );
|
||||
progression[ &__pop[ i ] ].first = funcs.size() - 1;
|
||||
progression[ &__pop[ i ] ].second = funcs.size();
|
||||
for ( unsigned j = 0; j < funcs.size(); j++ )
|
||||
{
|
||||
/* Queuing the 'invalid' solution and its associated owner */
|
||||
tasks.push( &__pop[ i ] );
|
||||
}
|
||||
}
|
||||
total = funcs.size() * __pop.size();
|
||||
requestResourceRequest( funcs.size() * __pop.size() );
|
||||
stop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
|
||||
|
||||
//! @class peoSyncIslandMig
|
||||
//! @brief Specific class for a synchronous migration
|
||||
//! @brief Specific class for a synchronous migration
|
||||
//! @see Cooperative eoUpdater
|
||||
//! @version 2.0
|
||||
//! @date january 2008
|
||||
|
|
@ -74,10 +74,10 @@ template< class TYPESELECT, class TYPEREPLACE > class peoSyncIslandMig : public
|
|||
public:
|
||||
|
||||
//! @brief Constructor
|
||||
//! @param unsigned __frequency
|
||||
//! @param selector <TYPESELECT> & __select
|
||||
//! @param replacement <TYPEREPLACE> & __replace
|
||||
//! @param Topology& __topology
|
||||
//! @param unsigned __frequency
|
||||
//! @param selector <TYPESELECT> & __select
|
||||
//! @param replacement <TYPEREPLACE> & __replace
|
||||
//! @param Topology& __topology
|
||||
peoSyncIslandMig(
|
||||
unsigned __frequency,
|
||||
selector <TYPESELECT> & __select,
|
||||
|
|
@ -87,19 +87,19 @@ template< class TYPESELECT, class TYPEREPLACE > class peoSyncIslandMig : public
|
|||
|
||||
//! @brief operator
|
||||
void operator()();
|
||||
//! @brief Function realizing packages
|
||||
//! @brief Function realizing packages
|
||||
void pack();
|
||||
//! @brief Function reconstituting packages
|
||||
void unpack();
|
||||
//! @brief Function packSynchronizeReq
|
||||
void packSynchronizeReq();
|
||||
//! @brief Function notifySending
|
||||
//! @brief Function notifySending
|
||||
void notifySending();
|
||||
//! @brief Function notifyReceiving
|
||||
//! @brief Function notifyReceiving
|
||||
void notifyReceiving();
|
||||
//! @brief notifySendingSyncReq
|
||||
//! @brief notifySendingSyncReq
|
||||
void notifySendingSyncReq();
|
||||
//! @brief notifySynchronized
|
||||
//! @brief notifySynchronized
|
||||
void notifySynchronized();
|
||||
|
||||
private:
|
||||
|
|
@ -109,22 +109,22 @@ template< class TYPESELECT, class TYPEREPLACE > class peoSyncIslandMig : public
|
|||
|
||||
|
||||
private:
|
||||
//! @param eoSyncContinue cont
|
||||
//! @param selector <TYPESELECT> & select
|
||||
//! @param replacement <TYPEREPLACE> & replace
|
||||
//! @param Topology& topology
|
||||
//! @param std :: queue< TYPEREPLACE > imm
|
||||
//! @param std :: queue< TYPESELECT > em
|
||||
//! @param std :: queue< Cooperative* > coop_em
|
||||
//! @param sem_t sync
|
||||
//! @param bool explicitPassive
|
||||
//! @param bool standbyMigration
|
||||
//! @param std :: vector< Cooperative* > in, out, all
|
||||
//! @param unsigned nbMigrations
|
||||
eoSyncContinue cont;
|
||||
selector <TYPESELECT> & select;
|
||||
replacement <TYPEREPLACE> & replace;
|
||||
Topology& topology;
|
||||
//! @param eoSyncContinue cont
|
||||
//! @param selector <TYPESELECT> & select
|
||||
//! @param replacement <TYPEREPLACE> & replace
|
||||
//! @param Topology& topology
|
||||
//! @param std :: queue< TYPEREPLACE > imm
|
||||
//! @param std :: queue< TYPESELECT > em
|
||||
//! @param std :: queue< Cooperative* > coop_em
|
||||
//! @param sem_t sync
|
||||
//! @param bool explicitPassive
|
||||
//! @param bool standbyMigration
|
||||
//! @param std :: vector< Cooperative* > in, out, all
|
||||
//! @param unsigned nbMigrations
|
||||
eoSyncContinue cont;
|
||||
selector <TYPESELECT> & select;
|
||||
replacement <TYPEREPLACE> & replace;
|
||||
Topology& topology;
|
||||
std :: queue< TYPEREPLACE > imm;
|
||||
std :: queue< TYPESELECT > em;
|
||||
std :: queue< Cooperative* > coop_em;
|
||||
|
|
|
|||
|
|
@ -55,11 +55,11 @@ template< class EOT > class peoTransform : public Service, public eoTransform< E
|
|||
|
||||
public:
|
||||
|
||||
//! @brief Constructor
|
||||
//! @param eoQuadOp< EOT >& __cross
|
||||
//! @param double __cross_rate
|
||||
//! @param eoMonOp< EOT >& __mut
|
||||
//! @param double __mut_rate
|
||||
//! @brief Constructor
|
||||
//! @param eoQuadOp< EOT >& __cross
|
||||
//! @param double __cross_rate
|
||||
//! @param eoMonOp< EOT >& __mut
|
||||
//! @param double __mut_rate
|
||||
peoTransform(
|
||||
eoQuadOp< EOT >& __cross,
|
||||
double __cross_rate,
|
||||
|
|
@ -67,34 +67,34 @@ template< class EOT > class peoTransform : public Service, public eoTransform< E
|
|||
double __mut_rate
|
||||
);
|
||||
|
||||
//! @brief Operator
|
||||
//! @param eoPop< EOT >& __pop
|
||||
//! @brief Operator
|
||||
//! @param eoPop< EOT >& __pop
|
||||
void operator()( eoPop< EOT >& __pop );
|
||||
//! @brief Function realizing packages of data
|
||||
//! @brief Function realizing packages of data
|
||||
void packData();
|
||||
//! @brief Function reconstituting packages of data
|
||||
//! @brief Function reconstituting packages of data
|
||||
void unpackData();
|
||||
//! @brief Function which executes the algorithm
|
||||
//! @brief Function which executes the algorithm
|
||||
void execute();
|
||||
//! @brief Function realizing packages of the result
|
||||
//! @brief Function realizing packages of the result
|
||||
void packResult();
|
||||
//! @brief Function reconstituting packages of result
|
||||
//! @brief Function reconstituting packages of result
|
||||
void unpackResult();
|
||||
//! @brief Function notifySendingData
|
||||
//! @brief Function notifySendingData
|
||||
void notifySendingData();
|
||||
//! @brief Function notifySendingAllResourceRequests
|
||||
void notifySendingAllResourceRequests();
|
||||
|
||||
private:
|
||||
//! @param eoQuadOp< EOT >& cross
|
||||
//! @param double cross_rate
|
||||
//! @param eoMonOp< EOT >& mut
|
||||
//! @param double mut_rate
|
||||
//! @param unsigned idx
|
||||
//! @param eoPop< EOT >* pop
|
||||
//! @param EOT father
|
||||
//! @param mother
|
||||
//! @param unsigned num_term
|
||||
//! @param eoQuadOp< EOT >& cross
|
||||
//! @param double cross_rate
|
||||
//! @param eoMonOp< EOT >& mut
|
||||
//! @param double mut_rate
|
||||
//! @param unsigned idx
|
||||
//! @param eoPop< EOT >* pop
|
||||
//! @param EOT father
|
||||
//! @param mother
|
||||
//! @param unsigned num_term
|
||||
eoQuadOp< EOT >& cross;
|
||||
double cross_rate;
|
||||
eoMonOp< EOT >& mut;
|
||||
|
|
|
|||
|
|
@ -51,39 +51,39 @@ class peoWrapper : public Runner
|
|||
|
||||
public:
|
||||
|
||||
//! @brief constructor
|
||||
//! @param AlgorithmType& externalAlgorithm
|
||||
//! @brief constructor
|
||||
//! @param AlgorithmType& externalAlgorithm
|
||||
template< typename AlgorithmType > peoWrapper( AlgorithmType& externalAlgorithm )
|
||||
: algorithm( new Algorithm< AlgorithmType, void >( externalAlgorithm ) )
|
||||
{}
|
||||
|
||||
//! @brief constructor
|
||||
//! @param AlgorithmType& externalAlgorithm
|
||||
//! @param AlgorithmDataType& externalData
|
||||
//! @brief constructor
|
||||
//! @param AlgorithmType& externalAlgorithm
|
||||
//! @param AlgorithmDataType& externalData
|
||||
template< typename AlgorithmType, typename AlgorithmDataType > peoWrapper( AlgorithmType& externalAlgorithm, AlgorithmDataType& externalData )
|
||||
: algorithm( new Algorithm< AlgorithmType, AlgorithmDataType >( externalAlgorithm, externalData ) )
|
||||
{}
|
||||
|
||||
//! @brief constructor
|
||||
//! @param AlgorithmReturnType& (*externalAlgorithm)()
|
||||
//! @brief constructor
|
||||
//! @param AlgorithmReturnType& (*externalAlgorithm)()
|
||||
template< typename AlgorithmReturnType > peoWrapper( AlgorithmReturnType& (*externalAlgorithm)() )
|
||||
: algorithm( new FunctionAlgorithm< AlgorithmReturnType, void >( externalAlgorithm ) )
|
||||
{}
|
||||
|
||||
//! @brief constructor
|
||||
//! @param AlgorithmReturnType& (*externalAlgorithm)( AlgorithmDataType& )
|
||||
//! @param AlgorithmDataType& externalData
|
||||
//! @brief constructor
|
||||
//! @param AlgorithmReturnType& (*externalAlgorithm)( AlgorithmDataType& )
|
||||
//! @param AlgorithmDataType& externalData
|
||||
template< typename AlgorithmReturnType, typename AlgorithmDataType > peoWrapper( AlgorithmReturnType& (*externalAlgorithm)( AlgorithmDataType& ), AlgorithmDataType& externalData )
|
||||
: algorithm( new FunctionAlgorithm< AlgorithmReturnType, AlgorithmDataType >( externalAlgorithm, externalData ) )
|
||||
{}
|
||||
|
||||
//! @brief destructor
|
||||
|
||||
//! @brief destructor
|
||||
~peoWrapper()
|
||||
{
|
||||
delete algorithm;
|
||||
}
|
||||
|
||||
//! @brief function run
|
||||
//! @brief function run
|
||||
void run()
|
||||
{
|
||||
algorithm->operator()();
|
||||
|
|
@ -166,7 +166,7 @@ class peoWrapper : public Runner
|
|||
};
|
||||
|
||||
private:
|
||||
//! @param AbstractAlgorithm* algorithm
|
||||
//! @param AbstractAlgorithm* algorithm
|
||||
AbstractAlgorithm* algorithm;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -65,10 +65,14 @@ struct SyncCompare
|
|||
std::vector< SyncEntry >::const_iterator itA = syncA.begin();
|
||||
std::vector< SyncEntry >::const_iterator itB = syncB.begin();
|
||||
|
||||
while ( itA != syncA.end() && (*itA).runner == (*itB).runner ) { itA++; itB++; }
|
||||
while ( itA != syncA.end() && (*itA).runner == (*itB).runner )
|
||||
{
|
||||
itA++;
|
||||
itB++;
|
||||
}
|
||||
|
||||
return ( (itA == syncA.end()) ) ? false : ( (*itA).runner < (*itB).runner );
|
||||
}
|
||||
return ( (itA == syncA.end()) ) ? false : ( (*itA).runner < (*itB).runner );
|
||||
}
|
||||
|
||||
return syncA.size() < syncB.size();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue