Rename in peo
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@841 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
717fc4f265
commit
f128e5ec66
16 changed files with 54 additions and 683 deletions
|
|
@ -324,8 +324,7 @@
|
|||
#include "core/eoPop_mesg.h"
|
||||
#include "core/eoVector_mesg.h"
|
||||
|
||||
#include "peoEA.h"
|
||||
#include "peoParallelAlgorithmWrapper.h"
|
||||
#include "peoWrapper.h"
|
||||
|
||||
/* <------- components for parallel algorithms -------> */
|
||||
#include "peoSeqTransform.h"
|
||||
|
|
@ -340,15 +339,12 @@
|
|||
#include "peoAsyncIslandMig.h"
|
||||
|
||||
/* Synchronous multi-start model */
|
||||
#include "peoSyncMultiStart.h"
|
||||
#include "peoSynchronousMultiStart.h"
|
||||
#include "peoMultiStart.h"
|
||||
/* <------- components for parallel algorithms -------> */
|
||||
|
||||
/* Parallel PSO */
|
||||
#include "peoInitializer.h"
|
||||
#include "peoPSO.h"
|
||||
#include "peoPSOSelect.h"
|
||||
#include "peoPSOReplacement.h"
|
||||
#include "peoPSOVelocity.h"
|
||||
#include "peoWorstPositionReplacement.h"
|
||||
#include "peoGlobalBestVelocity.h"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,179 +0,0 @@
|
|||
/*
|
||||
* <peoEA.h>
|
||||
* 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 __peoEA_h
|
||||
#define __peoEA_h
|
||||
|
||||
#include <eoContinue.h>
|
||||
#include <eoEvalFunc.h>
|
||||
#include <eoSelect.h>
|
||||
#include <eoPopEvalFunc.h>
|
||||
#include <eoReplacement.h>
|
||||
|
||||
#include "peoPopEval.h"
|
||||
#include "peoTransform.h"
|
||||
#include "core/runner.h"
|
||||
#include "core/peo_debug.h"
|
||||
|
||||
//! Class providing an elementary ParadisEO evolutionary algorithm.
|
||||
|
||||
//! The peoEA class offers an elementary evolutionary algorithm implementation. In addition, as compared
|
||||
//! with the algorithms provided by the EO framework, the peoEA class has the underlying necessary structure
|
||||
//! for including, for example, parallel evaluation and parallel transformation operators, migration operators
|
||||
//! etc. Although there is no restriction on using the algorithms provided by the EO framework, the drawback resides
|
||||
//! in the fact that the EO implementation is exclusively sequential and, in consequence, no parallelism is provided.
|
||||
//! A simple example for constructing a peoEA object:
|
||||
//!
|
||||
//! <table style="border:none; border-spacing:0px;text-align:left; vertical-align:top; font-size:8pt;" border="0">
|
||||
//! <tr><td>... </td> <td> </td></tr>
|
||||
//! <tr><td>eoPop< EOT > population( POP_SIZE, popInitializer ); </td> <td>// creation of a population with POP_SIZE individuals - the popInitializer is a functor to be called for each individual</td></tr>
|
||||
//! <tr><td> </td> <td> </td></tr>
|
||||
//! <tr><td>eoGenContinue< EOT > eaCont( NUM_GEN ); </td> <td>// number of generations for the evolutionary algorithm</td></tr>
|
||||
//! <tr><td>eoCheckPoint< EOT > eaCheckpointContinue( eaCont ); </td> <td>// checkpoint incorporating the continuation criterion - startpoint for adding other checkpoint objects</td></tr>
|
||||
//! <tr><td> </td> <td> </td></tr>
|
||||
//! <tr><td>peoSeqPopEval< EOT > eaPopEval( evalFunction ); </td> <td>// sequential evaluation functor wrapper - evalFunction represents the actual evaluation functor </td></tr>
|
||||
//! <tr><td> </td> <td> </td></tr>
|
||||
//! <tr><td>eoRankingSelect< EOT > selectionStrategy; </td> <td>// selection strategy for creating the offspring population - a simple ranking selection in this case </td></tr>
|
||||
//! <tr><td>eoSelectNumber< EOT > eaSelect( selectionStrategy, POP_SIZE ); </td> <td>// the number of individuals to be selected for creating the offspring population </td></tr>
|
||||
//! <tr><td>eoRankingSelect< EOT > selectionStrategy; </td> <td>// selection strategy for creating the offspring population - a simple ranking selection in this case </td></tr>
|
||||
//! <tr><td> </td> <td> </td></tr>
|
||||
//! <tr><td>eoSGATransform< EOT > transform( crossover, CROSS_RATE, mutation, MUT_RATE ); </td> <td>// transformation operator - crossover and mutation operators with their associated probabilities </td></tr>
|
||||
//! <tr><td>peoSeqTransform< EOT > eaTransform( transform ); </td> <td>// ParadisEO specific sequential operator - a parallel version may be specified in the same manner </td></tr>
|
||||
//! <tr><td> </td> <td> </td></tr>
|
||||
//! <tr><td>eoPlusReplacement< EOT > eaReplace; </td> <td>// replacement strategy - for integrating the offspring resulting individuals in the initial population </td></tr>
|
||||
//! <tr><td> </td> <td> </td></tr>
|
||||
//! <tr><td>peoEA< EOT > eaAlg( eaCheckpointContinue, eaPopEval, eaSelect, eaTransform, eaReplace ); </td> <td>// ParadisEO evolutionary algorithm integrating the above defined objects </td></tr>
|
||||
//! <tr><td>eaAlg( population ); </td> <td>// specifying the initial population for the algorithm </td></tr>
|
||||
//! <tr><td>... </td> <td> </td></tr>
|
||||
//! </table>
|
||||
template < class EOT > class peoEA : public Runner
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//! Constructor for the evolutionary algorithm object - several basic parameters have to be specified,
|
||||
//! allowing for different levels of parallelism. Depending on the requirements, a sequential or a parallel
|
||||
//! evaluation operator may be specified or, in the same manner, a sequential or a parallel transformation
|
||||
//! operator may be given as parameter. Out of the box objects may be provided, from the EO package, for example,
|
||||
//! or custom defined ones may be specified, provided that they are derived from the correct base classes.
|
||||
//!
|
||||
//! @param eoContinue< EOT >& __cont - continuation criterion specifying whether the algorithm should continue or not;
|
||||
//! @param peoPopEval< EOT >& __pop_eval - evaluation operator; it allows the specification of parallel evaluation operators, aggregate evaluation functions, etc.;
|
||||
//! @param eoSelect< EOT >& __select - selection strategy to be applied for constructing a list of offspring individuals;
|
||||
//! @param peoTransform< EOT >& __trans - transformation operator, i.e. crossover and mutation; allows for sequential or parallel transform;
|
||||
//! @param eoReplacement< EOT >& __replace - replacement strategy for integrating the offspring individuals in the initial population;
|
||||
peoEA(
|
||||
eoContinue< EOT >& __cont,
|
||||
peoPopEval< EOT >& __pop_eval,
|
||||
eoSelect< EOT >& __select,
|
||||
peoTransform< EOT >& __trans,
|
||||
eoReplacement< EOT >& __replace
|
||||
);
|
||||
|
||||
//! Evolutionary algorithm function - a side effect of the fact that the class is derived from the <b>Runner</b> class,
|
||||
//! thus requiring the existence of a <i>run</i> function, the algorithm being executed on a distinct thread.
|
||||
void run();
|
||||
|
||||
//! Function operator for specifying the population to be associated with the algorithm.
|
||||
//!
|
||||
//! @param eoPop< EOT >& __pop - initial population of the algorithm, to be iteratively evolved;
|
||||
void operator()( eoPop< EOT >& __pop );
|
||||
|
||||
|
||||
private:
|
||||
|
||||
eoContinue< EOT >& cont;
|
||||
peoPopEval< EOT >& pop_eval;
|
||||
eoSelect< EOT >& select;
|
||||
peoTransform< EOT >& trans;
|
||||
eoReplacement< EOT >& replace;
|
||||
eoPop< EOT >* pop;
|
||||
};
|
||||
|
||||
|
||||
template < class EOT > peoEA< EOT > :: peoEA(
|
||||
|
||||
eoContinue< EOT >& __cont,
|
||||
peoPopEval< EOT >& __pop_eval,
|
||||
eoSelect< EOT >& __select,
|
||||
peoTransform< EOT >& __trans,
|
||||
eoReplacement< EOT >& __replace
|
||||
|
||||
) : cont( __cont ), pop_eval( __pop_eval ), select( __select ), trans( __trans ), replace( __replace )
|
||||
{
|
||||
|
||||
trans.setOwner( *this );
|
||||
pop_eval.setOwner( *this );
|
||||
}
|
||||
|
||||
|
||||
template< class EOT > void peoEA< EOT > :: operator ()( eoPop< EOT >& __pop )
|
||||
{
|
||||
|
||||
pop = &__pop;
|
||||
}
|
||||
|
||||
|
||||
template< class EOT > void peoEA< EOT > :: run()
|
||||
{
|
||||
|
||||
eoPop< EOT > dummy;
|
||||
printDebugMessage( "peoEA: performing the first evaluation of the population." );
|
||||
pop_eval(dummy, *pop );
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
eoPop< EOT > off;
|
||||
|
||||
printDebugMessage( "peoEA: performing the selection step." );
|
||||
select( *pop, off );
|
||||
trans( off );
|
||||
|
||||
printDebugMessage( "peoEA: performing the evaluation of the population." );
|
||||
|
||||
pop_eval(dummy, off );
|
||||
|
||||
printDebugMessage( "peoEA: performing the replacement of the population." );
|
||||
replace( *pop, off );
|
||||
|
||||
printDebugMessage( "peoEA: deciding of the continuation." );
|
||||
|
||||
}
|
||||
while ( cont( *pop ) );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
/* <peoPSOVelocity.h>
|
||||
/* <peoGlobalBestVelocity.h>
|
||||
*
|
||||
* (c) OPAC Team, October 2007
|
||||
*
|
||||
|
|
@ -33,8 +33,8 @@
|
|||
* Contact: clive.canape@inria.fr
|
||||
*/
|
||||
|
||||
#ifndef _peoPSOVelocity_h
|
||||
#define _peoPSOVelocity_h
|
||||
#ifndef _peoGlobalBestVelocity_h
|
||||
#define _peoGlobalBestVelocity_h
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -47,13 +47,13 @@
|
|||
#include <utils/eoHowMany.h>
|
||||
|
||||
template <class POT>
|
||||
class peoPSOVelocity : public eoReplacement<POT>
|
||||
class peoGlobalBestVelocity : public eoReplacement<POT>
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename POT::ParticleVelocityType VelocityType;
|
||||
|
||||
peoPSOVelocity( const double & _c3,
|
||||
peoGlobalBestVelocity( const double & _c3,
|
||||
eoVelocity < POT > &_velocity):
|
||||
c3 (_c3),
|
||||
velocity (_velocity)
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
/*
|
||||
* <peoInitializer.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
|
||||
* (C) OPAC Team, INRIA, 2007
|
||||
*
|
||||
* Clive Canape
|
||||
*
|
||||
* 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: clive.canape@inria.fr
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _peoInitializer_H
|
||||
#define _peoInitializer_H
|
||||
|
||||
/**
|
||||
Base (name) class for parallel initialization of algorithm PSO
|
||||
|
||||
@see eoInitializerBase
|
||||
*/
|
||||
|
||||
template <class POT> class peoInitializer : public eoInitializerBase <POT>
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
//! Constructor
|
||||
//! @param _proc Evaluation function
|
||||
//! @param _initVelo Initialization of the velocity
|
||||
//! @param _initBest Initialization of the best
|
||||
//! @param _pop Population
|
||||
peoInitializer(
|
||||
peoPopEval< POT >& _proc,
|
||||
eoVelocityInit < POT > &_initVelo,
|
||||
eoParticleBestInit <POT> &_initBest,
|
||||
eoPop < POT > &_pop
|
||||
) : proc(_proc), initVelo(_initVelo), initBest(_initBest)
|
||||
{
|
||||
pop = &_pop;
|
||||
}
|
||||
|
||||
//! Give the name of the class
|
||||
//! @return The name of the class
|
||||
virtual std::string className (void) const
|
||||
{
|
||||
return "peoInitializer";
|
||||
}
|
||||
|
||||
//! void operator ()
|
||||
//! Parallel initialization of the population
|
||||
virtual void operator()()
|
||||
{
|
||||
proc(dummyPop,*pop);
|
||||
apply < POT > (initVelo, *pop);
|
||||
apply < POT > (initBest, *pop);
|
||||
}
|
||||
|
||||
private :
|
||||
|
||||
/*
|
||||
@param proc First evaluation
|
||||
@param initVelo Initialization of the velocity
|
||||
@param initBest Initialization of the best
|
||||
@param pop Population
|
||||
*/
|
||||
peoPopEval< POT >& proc;
|
||||
eoVelocityInit < POT > & initVelo;
|
||||
eoParticleBestInit <POT> & initBest;
|
||||
eoPop <POT> * pop;
|
||||
eoPop< POT > dummyPop;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* <peoSynchronousMultiStart.h>
|
||||
* <peoMultiStart.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
|
||||
* (C) OPAC Team, LIFL, 2002-2007
|
||||
*
|
||||
|
|
@ -33,8 +33,8 @@
|
|||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
#ifndef __peoSynchronousMultiStart_h
|
||||
#define __peoSynchronousMultiStart_h
|
||||
#ifndef __peoMultiStart_h
|
||||
#define __peoMultiStart_h
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
|
@ -42,12 +42,12 @@
|
|||
#include "core/messaging.h"
|
||||
|
||||
|
||||
template < typename EntityType > class peoSynchronousMultiStart : public Service
|
||||
template < typename EntityType > class peoMultiStart : public Service
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
template < typename AlgorithmType > peoSynchronousMultiStart( AlgorithmType& externalAlgorithm )
|
||||
template < typename AlgorithmType > peoMultiStart( AlgorithmType& externalAlgorithm )
|
||||
{
|
||||
|
||||
singularAlgorithm = new Algorithm< AlgorithmType >( externalAlgorithm );
|
||||
|
|
@ -56,7 +56,7 @@ template < typename EntityType > class peoSynchronousMultiStart : public Service
|
|||
aggregationFunction = new NoAggregationFunction();
|
||||
}
|
||||
|
||||
template < typename AlgorithmReturnType, typename AlgorithmDataType > peoSynchronousMultiStart( AlgorithmReturnType (*externalAlgorithm)( AlgorithmDataType& ) )
|
||||
template < typename AlgorithmReturnType, typename AlgorithmDataType > peoMultiStart( AlgorithmReturnType (*externalAlgorithm)( AlgorithmDataType& ) )
|
||||
{
|
||||
|
||||
singularAlgorithm = new FunctionAlgorithm< AlgorithmReturnType, AlgorithmDataType >( externalAlgorithm );
|
||||
|
|
@ -65,7 +65,7 @@ template < typename EntityType > class peoSynchronousMultiStart : public Service
|
|||
aggregationFunction = new NoAggregationFunction();
|
||||
}
|
||||
|
||||
template < typename AlgorithmType, typename AggregationFunctionType > peoSynchronousMultiStart( std::vector< AlgorithmType* >& externalAlgorithms, AggregationFunctionType& externalAggregationFunction )
|
||||
template < typename AlgorithmType, typename AggregationFunctionType > peoMultiStart( std::vector< AlgorithmType* >& externalAlgorithms, AggregationFunctionType& externalAggregationFunction )
|
||||
{
|
||||
|
||||
for ( unsigned int index = 0; index < externalAlgorithms.size(); index++ )
|
||||
|
|
@ -78,7 +78,7 @@ template < typename EntityType > class peoSynchronousMultiStart : public Service
|
|||
}
|
||||
|
||||
template < typename AlgorithmReturnType, typename AlgorithmDataType, typename AggregationFunctionType >
|
||||
peoSynchronousMultiStart( std::vector< AlgorithmReturnType (*)( AlgorithmDataType& ) >& externalAlgorithms,
|
||||
peoMultiStart( std::vector< AlgorithmReturnType (*)( AlgorithmDataType& ) >& externalAlgorithms,
|
||||
AggregationFunctionType& externalAggregationFunction )
|
||||
{
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ template < typename EntityType > class peoSynchronousMultiStart : public Service
|
|||
aggregationFunction = new AggregationAlgorithm< AggregationFunctionType >( externalAggregationFunction );
|
||||
}
|
||||
|
||||
~peoSynchronousMultiStart()
|
||||
~peoMultiStart()
|
||||
{
|
||||
|
||||
for ( unsigned int index = 0; index < data.size(); index++ ) delete data[ index ];
|
||||
|
|
@ -264,7 +264,7 @@ template < typename EntityType > class peoSynchronousMultiStart : public Service
|
|||
};
|
||||
|
||||
|
||||
template < typename EntityType > void peoSynchronousMultiStart< EntityType >::packData()
|
||||
template < typename EntityType > void peoMultiStart< EntityType >::packData()
|
||||
{
|
||||
|
||||
pack( functionIndex );
|
||||
|
|
@ -281,7 +281,7 @@ template < typename EntityType > void peoSynchronousMultiStart< EntityType >::pa
|
|||
}
|
||||
}
|
||||
|
||||
template < typename EntityType > void peoSynchronousMultiStart< EntityType >::unpackData()
|
||||
template < typename EntityType > void peoMultiStart< EntityType >::unpackData()
|
||||
{
|
||||
|
||||
unpack( functionIndex );
|
||||
|
|
@ -289,7 +289,7 @@ template < typename EntityType > void peoSynchronousMultiStart< EntityType >::un
|
|||
unpack( entityTypeInstance );
|
||||
}
|
||||
|
||||
template < typename EntityType > void peoSynchronousMultiStart< EntityType >::execute()
|
||||
template < typename EntityType > void peoMultiStart< EntityType >::execute()
|
||||
{
|
||||
|
||||
// wrapping the unpacked data - the definition of an abstract algorithm imposes
|
||||
|
|
@ -300,14 +300,14 @@ template < typename EntityType > void peoSynchronousMultiStart< EntityType >::ex
|
|||
delete entityWrapper;
|
||||
}
|
||||
|
||||
template < typename EntityType > void peoSynchronousMultiStart< EntityType >::packResult()
|
||||
template < typename EntityType > void peoMultiStart< EntityType >::packResult()
|
||||
{
|
||||
|
||||
pack( dataIndex );
|
||||
pack( entityTypeInstance );
|
||||
}
|
||||
|
||||
template < typename EntityType > void peoSynchronousMultiStart< EntityType >::unpackResult()
|
||||
template < typename EntityType > void peoMultiStart< EntityType >::unpackResult()
|
||||
{
|
||||
|
||||
unpack( dataIndex );
|
||||
|
|
@ -329,10 +329,10 @@ template < typename EntityType > void peoSynchronousMultiStart< EntityType >::un
|
|||
}
|
||||
}
|
||||
|
||||
template < typename EntityType > void peoSynchronousMultiStart< EntityType >::notifySendingData()
|
||||
template < typename EntityType > void peoMultiStart< EntityType >::notifySendingData()
|
||||
{}
|
||||
|
||||
template < typename EntityType > void peoSynchronousMultiStart< EntityType >::notifySendingAllResourceRequests()
|
||||
template < typename EntityType > void peoMultiStart< EntityType >::notifySendingAllResourceRequests()
|
||||
{
|
||||
|
||||
getOwner()->setPassive();
|
||||
|
|
@ -1,130 +0,0 @@
|
|||
/* <peoPSO.h>
|
||||
*
|
||||
* (c) OPAC Team, October 2007
|
||||
*
|
||||
* Clive Canape
|
||||
*
|
||||
* 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
|
||||
* Contact: clive.canape@inria.fr
|
||||
*/
|
||||
|
||||
#ifndef __peoPSO_h
|
||||
#define __peoPSO_h
|
||||
|
||||
#include <eoContinue.h>
|
||||
#include <eoEvalFunc.h>
|
||||
#include <eoPopEvalFunc.h>
|
||||
#include <eoPSO.h>
|
||||
#include <eoVelocity.h>
|
||||
#include <eoFlight.h>
|
||||
#include "peoPopEval.h"
|
||||
#include "core/runner.h"
|
||||
#include "core/peo_debug.h"
|
||||
|
||||
//! Class providing an elementary ParadisEO evolutionary algorithm.
|
||||
|
||||
//! The peoPSO class offers an elementary Particle Swarm Optimization implementation. In addition, as compared
|
||||
//! with the algorithms provided by the EO framework, the peoPSO class has the underlying necessary structure
|
||||
//! for including, for example, parallel evaluation, etc.
|
||||
|
||||
template < class POT > class peoPSO : public Runner
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Constructor for the Particle Swarm Optimization
|
||||
//! @param eoContinue< POT >& __cont - continuation criterion specifying whether the algorithm should continue or not;
|
||||
//! @param peoPopEval< POT >& __pop_eval - evaluation operator; it allows the specification of parallel evaluation operators, aggregate evaluation functions, etc.;
|
||||
//! @param eoVelocity< POT >& __velocity - velocity operator;
|
||||
//! @param eoFlight< POT >& __flight - flight operator;
|
||||
peoPSO(
|
||||
eoInitializerBase <POT> & _Init,
|
||||
eoContinue< POT >& __cont,
|
||||
peoPopEval< POT >& __pop_eval,
|
||||
eoVelocity < POT > &_velocity,
|
||||
eoFlight < POT > &_flight);
|
||||
|
||||
//! Particle Swarm Optimization function - a side effect of the fact that the class is derived from the Runner class
|
||||
//! thus requiring the existence of a run function, the algorithm being executed on a distinct thread.
|
||||
void run();
|
||||
|
||||
//! Function operator for specifying the population to be associated with the algorithm.
|
||||
void operator()( eoPop< POT >& __pop );
|
||||
|
||||
private:
|
||||
|
||||
eoInitializerBase <POT> & Init;
|
||||
eoContinue< POT >& cont;
|
||||
peoPopEval< POT >& pop_eval;
|
||||
eoPop< POT >* pop;
|
||||
eoVelocity < POT > &velocity;
|
||||
eoFlight < POT > &flight;
|
||||
};
|
||||
|
||||
|
||||
template < class POT > peoPSO< POT > :: peoPSO(
|
||||
eoInitializerBase <POT> & _Init,
|
||||
eoContinue< POT >& __cont,
|
||||
peoPopEval< POT >& __pop_eval,
|
||||
eoVelocity < POT > &__velocity,
|
||||
eoFlight < POT > &__flight
|
||||
) : Init(_Init),cont( __cont ), pop_eval(__pop_eval ),velocity( __velocity),flight( __flight)
|
||||
{
|
||||
pop_eval.setOwner( *this );
|
||||
}
|
||||
|
||||
|
||||
template< class POT > void peoPSO< POT > :: operator ()( eoPop< POT >& __pop )
|
||||
{
|
||||
|
||||
pop = &__pop;
|
||||
}
|
||||
|
||||
|
||||
template< class POT > void peoPSO< POT > :: run()
|
||||
{
|
||||
eoPop< POT > dummy;
|
||||
printDebugMessage( "Performing the first evaluation of the population." );
|
||||
Init();
|
||||
velocity.getTopology().setup(*pop);
|
||||
do
|
||||
{
|
||||
printDebugMessage( "Performing the velocity evaluation." );
|
||||
velocity.apply ( *pop );
|
||||
printDebugMessage( "Performing the flight." );
|
||||
flight.apply ( *pop );
|
||||
printDebugMessage( "Performing the evaluation." );
|
||||
pop_eval(dummy,*pop);
|
||||
velocity.updateNeighborhood( *pop );
|
||||
}
|
||||
while ( cont( *pop ) );
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,217 +0,0 @@
|
|||
/*
|
||||
* <peoSyncMultiStart.h>
|
||||
* 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 __peoSyncMultiStart_h
|
||||
#define __peoSyncMultiStart_h
|
||||
|
||||
#include <utils/eoUpdater.h>
|
||||
#include <moAlgo.h>
|
||||
|
||||
#include <eoSelect.h>
|
||||
#include <eoReplacement.h>
|
||||
#include <eoContinue.h>
|
||||
|
||||
#include "core/service.h"
|
||||
#include "core/messaging.h"
|
||||
#include "core/peo_debug.h"
|
||||
|
||||
|
||||
extern int getNodeRank();
|
||||
|
||||
|
||||
//! Class providing the basis for the synchronous multi-start model.
|
||||
|
||||
//! The peoSyncMultiStart class provides the basis for implementing the synchronous multi-start model,
|
||||
//! for launching several solution-based algorithms in parallel on a specified initial population. As a simple
|
||||
//! example, several hill climbing algorithms may be synchronously launched on the specified population, each
|
||||
//! algorithm acting upon one individual only, the final result being integrated back in the population. A
|
||||
//! peoSyncMultiStart object can be specified as checkpoint object for a classic ParadisEO evolutionary algorithm
|
||||
//! thus allowing for simple hybridization schemes which combine the evolutionary approach with a local search approach,
|
||||
//! for example, executed at the end of each generation.
|
||||
template< class EOT > class peoSyncMultiStart : public Service, public eoUpdater
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//! Constructor function - several simple parameters are required for defining the characteristics of the multi-start model.
|
||||
//!
|
||||
//! @param eoContinue< EOT >& __cont - defined for including further functionality - no semantics associated at this time;
|
||||
//! @param eoSelect< EOT >& __select - selection strategy for obtaining a subset of the initial population on which to apply the specified algorithm;
|
||||
//! @param eoReplacement< EOT >& __replace - replacement strategy for integrating the resulting individuals in the initial population;
|
||||
//! @param moAlgo< EOT >& __ls - algorithm to be applied on each of the selected individuals - a <b>moAlgo< EOT ></b>-derived object must be specified;
|
||||
//! @param eoPop< EOT >& __pop - the initial population from which the individuals are selected for applying the specified algorithm.
|
||||
peoSyncMultiStart(
|
||||
|
||||
eoContinue< EOT >& __cont,
|
||||
eoSelect< EOT >& __select,
|
||||
eoReplacement< EOT >& __replace,
|
||||
moAlgo< EOT >& __ls,
|
||||
eoPop< EOT >& __pop
|
||||
);
|
||||
|
||||
//! Operator which synchronously executes the specified algorithm on the individuals selected from the initial population.
|
||||
//! There is no need to explicitly call the operator - automatically called as checkpoint operator.
|
||||
void operator()();
|
||||
|
||||
//! Auxiliary function for transferring data between the process requesting the synchronous execution of the specified
|
||||
//! algorithm and the process which actually executes the algorithm. There is no need to explicitly call the function.
|
||||
void packData();
|
||||
|
||||
//! Auxiliary function for transferring data between the process requesting the synchronous execution of the specified
|
||||
//! algorithm and the process which actually executes the algorithm. There is no need to explicitly call the function.
|
||||
void unpackData();
|
||||
|
||||
//! Auxiliary function for actually executing the specified algorithm on one assigned individual. There is no need to
|
||||
//! explicitly call the function.
|
||||
void execute();
|
||||
|
||||
//! Auxiliary function for transferring data between the process requesting the synchronous execution of the specified
|
||||
//! algorithm and the process which actually executes the algorithm. There is no need to explicitly call the function.
|
||||
void packResult();
|
||||
|
||||
//! Auxiliary function for transferring data between the process requesting the synchronous execution of the specified
|
||||
//! algorithm and the process which actually executes the algorithm. There is no need to explicitly call the function.
|
||||
void unpackResult();
|
||||
|
||||
//! Auxiliary function for notifications between the process requesting the synchronous multi-start execution
|
||||
//! and the processes that performs the actual execution phase. There is no need to explicitly call the function.
|
||||
void notifySendingData();
|
||||
|
||||
//! Auxiliary function for notifications between the process requesting the synchronous multi-start execution
|
||||
//! and the processes that performs the actual execution phase. There is no need to explicitly call the function.
|
||||
void notifySendingAllResourceRequests();
|
||||
|
||||
private:
|
||||
|
||||
eoContinue< EOT >& cont;
|
||||
eoSelect< EOT >& select;
|
||||
eoReplacement< EOT >& replace;
|
||||
|
||||
moAlgo< EOT >& ls;
|
||||
|
||||
eoPop< EOT >& pop;
|
||||
eoPop< EOT > sel;
|
||||
eoPop< EOT > impr_sel;
|
||||
|
||||
EOT sol;
|
||||
unsigned idx;
|
||||
unsigned num_term;
|
||||
};
|
||||
|
||||
|
||||
template< class EOT > peoSyncMultiStart< EOT > :: peoSyncMultiStart(
|
||||
|
||||
eoContinue < EOT >& __cont,
|
||||
eoSelect< EOT >& __select,
|
||||
eoReplacement< EOT >& __replace,
|
||||
moAlgo < EOT >& __ls,
|
||||
eoPop< EOT >& __pop
|
||||
|
||||
) : cont( __cont ), select( __select ), replace( __replace ), ls( __ls ), pop( __pop )
|
||||
{}
|
||||
|
||||
|
||||
template< class EOT > void peoSyncMultiStart< EOT > :: packData()
|
||||
{
|
||||
|
||||
pack( sel[ idx++ ] );
|
||||
}
|
||||
|
||||
|
||||
template< class EOT > void peoSyncMultiStart< EOT > :: unpackData()
|
||||
{
|
||||
|
||||
unpack( sol );
|
||||
}
|
||||
|
||||
|
||||
template< class EOT > void peoSyncMultiStart< EOT > :: execute()
|
||||
{
|
||||
|
||||
ls( sol );
|
||||
}
|
||||
|
||||
|
||||
template< class EOT > void peoSyncMultiStart< EOT > :: packResult()
|
||||
{
|
||||
|
||||
pack( sol );
|
||||
}
|
||||
|
||||
|
||||
template< class EOT > void peoSyncMultiStart< EOT > :: unpackResult()
|
||||
{
|
||||
|
||||
unpack( sol );
|
||||
impr_sel.push_back( sol );
|
||||
num_term++;
|
||||
|
||||
if ( num_term == sel.size() )
|
||||
{
|
||||
|
||||
getOwner()->setActive();
|
||||
replace( pop, impr_sel );
|
||||
|
||||
printDebugMessage( "replacing the improved individuals in the population." );
|
||||
resume();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template< class EOT > void peoSyncMultiStart< EOT > :: operator()()
|
||||
{
|
||||
|
||||
printDebugMessage( "performing the parallel multi-start hybridization." );
|
||||
select( pop, sel );
|
||||
impr_sel.clear();
|
||||
idx = num_term = 0;
|
||||
requestResourceRequest( sel.size() );
|
||||
stop();
|
||||
}
|
||||
|
||||
|
||||
template< class EOT > void peoSyncMultiStart< EOT > :: notifySendingData()
|
||||
{}
|
||||
|
||||
|
||||
template< class EOT > void peoSyncMultiStart< EOT > :: notifySendingAllResourceRequests()
|
||||
{
|
||||
|
||||
getOwner()->setPassive();
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
/* <peoPSOReplacement.h>
|
||||
/* <peoWorstPositionReplacement.h>
|
||||
*
|
||||
* (c) OPAC Team, October 2007
|
||||
*
|
||||
|
|
@ -33,8 +33,8 @@
|
|||
* Contact: clive.canape@inria.fr
|
||||
*/
|
||||
|
||||
#ifndef _peoPSOReplacement_h
|
||||
#define _peoPSOReplacement_h
|
||||
#ifndef _peoWorstPositionReplacement_h
|
||||
#define _peoWorstPositionReplacement_h
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -46,10 +46,10 @@
|
|||
#include <utils/eoHowMany.h>
|
||||
|
||||
template <class POT>
|
||||
class peoPSOReplacement : public eoReplacement<POT>
|
||||
class peoWorstPositionReplacement : public eoReplacement<POT>
|
||||
{
|
||||
public:
|
||||
peoPSOReplacement()
|
||||
peoWorstPositionReplacement()
|
||||
{}
|
||||
|
||||
void operator()(eoPop<POT>& _dest, eoPop<POT>& _source)
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* <peoParallelAlgorithmWrapper.h>
|
||||
* <peoWrapper.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
|
||||
* (C) OPAC Team, LIFL, 2002-2007
|
||||
*
|
||||
|
|
@ -44,28 +44,28 @@
|
|||
|
||||
|
||||
|
||||
class peoParallelAlgorithmWrapper : public Runner
|
||||
class peoWrapper : public Runner
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
template< typename AlgorithmType > peoParallelAlgorithmWrapper( AlgorithmType& externalAlgorithm )
|
||||
template< typename AlgorithmType > peoWrapper( AlgorithmType& externalAlgorithm )
|
||||
: algorithm( new Algorithm< AlgorithmType, void >( externalAlgorithm ) )
|
||||
{}
|
||||
|
||||
template< typename AlgorithmType, typename AlgorithmDataType > peoParallelAlgorithmWrapper( AlgorithmType& externalAlgorithm, AlgorithmDataType& externalData )
|
||||
template< typename AlgorithmType, typename AlgorithmDataType > peoWrapper( AlgorithmType& externalAlgorithm, AlgorithmDataType& externalData )
|
||||
: algorithm( new Algorithm< AlgorithmType, AlgorithmDataType >( externalAlgorithm, externalData ) )
|
||||
{}
|
||||
|
||||
template< typename AlgorithmReturnType > peoParallelAlgorithmWrapper( AlgorithmReturnType& (*externalAlgorithm)() )
|
||||
template< typename AlgorithmReturnType > peoWrapper( AlgorithmReturnType& (*externalAlgorithm)() )
|
||||
: algorithm( new FunctionAlgorithm< AlgorithmReturnType, void >( externalAlgorithm ) )
|
||||
{}
|
||||
|
||||
template< typename AlgorithmReturnType, typename AlgorithmDataType > peoParallelAlgorithmWrapper( AlgorithmReturnType& (*externalAlgorithm)( AlgorithmDataType& ), AlgorithmDataType& externalData )
|
||||
template< typename AlgorithmReturnType, typename AlgorithmDataType > peoWrapper( AlgorithmReturnType& (*externalAlgorithm)( AlgorithmDataType& ), AlgorithmDataType& externalData )
|
||||
: algorithm( new FunctionAlgorithm< AlgorithmReturnType, AlgorithmDataType >( externalAlgorithm, externalData ) )
|
||||
{}
|
||||
|
||||
~peoParallelAlgorithmWrapper()
|
||||
~peoWrapper()
|
||||
{
|
||||
|
||||
delete algorithm;
|
||||
|
|
@ -52,7 +52,7 @@ int main( int __argc, char** __argv )
|
|||
pop.append (POP_SIZE, random);
|
||||
|
||||
// Wrapper
|
||||
peoParallelAlgorithmWrapper parallelEA( eaAlg, pop);
|
||||
peoWrapper parallelEA( eaAlg, pop);
|
||||
peo :: run();
|
||||
peo :: finalize();
|
||||
if (getNodeRank()==1)
|
||||
|
|
@ -83,7 +83,7 @@ int main( int __argc, char** __argv )
|
|||
|
||||
// Wrapper
|
||||
peo :: init( __argc, __argv );
|
||||
peoParallelAlgorithmWrapper parallelEA2( eaAlg2, pop2);
|
||||
peoWrapper parallelEA2( eaAlg2, pop2);
|
||||
peo :: run();
|
||||
peo :: finalize();
|
||||
if (getNodeRank()==1)
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ int main( int __argc, char** __argv )
|
|||
// Population*/
|
||||
eoPop < Indi > pop;
|
||||
pop.append (POP_SIZE, random);
|
||||
peoParallelAlgorithmWrapper parallelEA( eaAlg, pop);
|
||||
peoWrapper parallelEA( eaAlg, pop);
|
||||
eval.setOwner(parallelEA);
|
||||
transform.setOwner(parallelEA);
|
||||
peo :: run();
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ int main( int __argc, char** __argv )
|
|||
// Parallel algorithm
|
||||
|
||||
eoSyncEasyPSO <Indi> psa(init,checkpoint,eval, velocity, flight);
|
||||
peoParallelAlgorithmWrapper parallelPSO( psa, pop);
|
||||
peoWrapper parallelPSO( psa, pop);
|
||||
eval.setOwner(parallelPSO);
|
||||
peo :: run();
|
||||
peo :: finalize();
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ int main( int __argc, char** __argv )
|
|||
eoPeriodicContinue< Indi > mig_cont( MIG_FREQ );
|
||||
peoPSOSelect<Indi> mig_selec(topology);
|
||||
eoSelectNumber< Indi > mig_select(mig_selec);
|
||||
peoPSOReplacement<Indi> mig_replace;
|
||||
peoWorstPositionReplacement<Indi> mig_replace;
|
||||
|
||||
|
||||
// Second
|
||||
|
|
@ -87,7 +87,7 @@ int main( int __argc, char** __argv )
|
|||
eoPeriodicContinue< Indi > mig_cont2( MIG_FREQ );
|
||||
peoPSOSelect<Indi> mig_selec2(topology2);
|
||||
eoSelectNumber< Indi > mig_select2(mig_selec2);
|
||||
peoPSOReplacement<Indi> mig_replace2;
|
||||
peoWorstPositionReplacement<Indi> mig_replace2;
|
||||
|
||||
|
||||
|
||||
|
|
@ -102,11 +102,11 @@ int main( int __argc, char** __argv )
|
|||
// Parallel algorithm
|
||||
|
||||
eoSyncEasyPSO <Indi> psa(init,checkpoint,eval, velocity, flight);
|
||||
peoParallelAlgorithmWrapper parallelPSO( psa, pop);
|
||||
peoWrapper parallelPSO( psa, pop);
|
||||
eval.setOwner(parallelPSO);
|
||||
mig.setOwner(parallelPSO);
|
||||
eoSyncEasyPSO <Indi> psa2(init2,checkpoint2,eval2, velocity2, flight2);
|
||||
peoParallelAlgorithmWrapper parallelPSO2( psa2, pop2);
|
||||
peoWrapper parallelPSO2( psa2, pop2);
|
||||
eval2.setOwner(parallelPSO2);
|
||||
mig2.setOwner(parallelPSO2);
|
||||
peo :: run();
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ int main (int __argc, char * * __argv)
|
|||
peoSeqTransform <Route> para_transform (transform);
|
||||
eoEPReplacement <Route> replace (2);
|
||||
eoEasyEA< Route > eaAlg( checkpoint, eval, select, para_transform, replace );
|
||||
peoParallelAlgorithmWrapper parallelEA( eaAlg, pop);
|
||||
peoWrapper parallelEA( eaAlg, pop);
|
||||
peo :: run ();
|
||||
peo :: finalize ();
|
||||
|
||||
|
|
@ -62,8 +62,8 @@ int main (int __argc, char * * __argv)
|
|||
|
||||
// Local search
|
||||
peo :: init (__argc, __argv);
|
||||
peoSynchronousMultiStart <Route> initParallelHC (hc);
|
||||
peoParallelAlgorithmWrapper parallelHC (initParallelHC, pop);
|
||||
peoMultiStart <Route> initParallelHC (hc);
|
||||
peoWrapper parallelHC (initParallelHC, pop);
|
||||
initParallelHC.setOwner(parallelHC);
|
||||
peo :: run( );
|
||||
peo :: finalize( );
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ int main (int __argc, char * * __argv)
|
|||
moBestImprSelect <TwoOpt> pmx_two_opt_move_select;
|
||||
moHC <TwoOpt> hc (pmx_two_opt_init, pmx_two_opt_next, pmx_two_opt_incr_eval, pmx_two_opt_move_select, full_eval);
|
||||
eoPop <Route> pop (POP_SIZE, route_init);
|
||||
peoSynchronousMultiStart <Route> initParallelHC (hc);
|
||||
peoParallelAlgorithmWrapper parallelHC (initParallelHC, pop);
|
||||
peoMultiStart <Route> initParallelHC (hc);
|
||||
peoWrapper parallelHC (initParallelHC, pop);
|
||||
initParallelHC.setOwner(parallelHC);
|
||||
peo :: run( );
|
||||
peo :: finalize( );
|
||||
|
|
@ -63,7 +63,7 @@ int main (int __argc, char * * __argv)
|
|||
peoSeqTransform <Route> para_transform (transform);
|
||||
eoEPReplacement <Route> replace (2);
|
||||
eoEasyEA< Route > eaAlg( checkpoint, eval, select, para_transform, replace );
|
||||
peoParallelAlgorithmWrapper parallelEA( eaAlg, pop);
|
||||
peoWrapper parallelEA( eaAlg, pop);
|
||||
peo :: run ();
|
||||
peo :: finalize ();
|
||||
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ int main( int __argc, char** __argv )
|
|||
|
||||
eoPop < Indi > pop(POP_SIZE);
|
||||
eoInitFixedLength < Indi > randomSeq (VEC_SIZE, uGen);
|
||||
peoSynchronousMultiStart <Indi> initRandom (randomSeq);
|
||||
peoParallelAlgorithmWrapper random (initRandom,pop);
|
||||
peoMultiStart <Indi> initRandom (randomSeq);
|
||||
peoWrapper random (initRandom,pop);
|
||||
initRandom.setOwner(random);
|
||||
peo :: run( );
|
||||
peo :: finalize( );
|
||||
|
|
@ -55,7 +55,7 @@ int main( int __argc, char** __argv )
|
|||
peoParaPopEval< Indi > eval(plainEval);
|
||||
eoInitializer <Indi> init(eval,veloRandom,localInit,topology,pop);
|
||||
eoSyncEasyPSO <Indi> psa(init,checkpoint,eval, velocity, flight);
|
||||
peoParallelAlgorithmWrapper parallelPSO( psa, pop);
|
||||
peoWrapper parallelPSO( psa, pop);
|
||||
eval.setOwner(parallelPSO);
|
||||
peo :: run();
|
||||
peo :: finalize();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue