EvolvingObjects
eoLinearTopology< POT > Class Template Reference

One of the local best strategies for particle swarm optimization. More...

#include <eoLinearTopology.h>

Inheritance diagram for eoLinearTopology< POT >:
eoTopology< POT > eoPop< POT > vector eoObject eoPersistent eoPrintable

List of all members.

Public Member Functions

 eoLinearTopology (unsigned _neighborhoodSize)
 Build the topology made of _neighborhoodSize neighborhoods.
void setup (const eoPop< POT > &_pop)
 Build the neighborhoods contained in the topology.
unsigned retrieveNeighborhoodByIndice (unsigned _indice)
 Retrieve the neighboorhood of a particle.
void updateNeighborhood (POT &_po, unsigned _indice)
 Update the neighborhood: update the particle's best fitness and the best particle of the corresponding neighborhood.
POT & best (unsigned _indice)
 Return the best informative of a particle.
virtual POT & globalBest ()
void printOn ()
 Print the structure of the topology on the standrad output.

Protected Attributes

std::vector
< eoSocialNeighborhood< POT > > 
neighborhoods
unsigned neighborhoodSize
bool isSetup

Detailed Description

template<class POT>
class eoLinearTopology< POT >

One of the local best strategies for particle swarm optimization.

Each particle has a fixed number of neighbours, ans the neighborhood is social. The topology is never modified during the flight.

Examples:
t-eoEasyPSO.cpp, t-eoExtendedVelocity.cpp, and t-eoSyncEasyPSO.cpp.

Definition at line 43 of file eoLinearTopology.h.


Constructor & Destructor Documentation

template<class POT>
eoLinearTopology< POT >::eoLinearTopology ( unsigned  _neighborhoodSize) [inline]

Build the topology made of _neighborhoodSize neighborhoods.

Parameters:
_neighborhoodSize- The size of each neighborhood.

Definition at line 53 of file eoLinearTopology.h.


Member Function Documentation

template<class POT>
void eoLinearTopology< POT >::setup ( const eoPop< POT > &  _pop) [inline, virtual]

Build the neighborhoods contained in the topology.

Parameters:
_pop- The population used to build the neighborhoods. If it remains several particle (because _pop.size()neighborhoodSize !=0), there are inserted in the last neighborhood. So it may be possible to have a bigger neighborhood.

Implements eoTopology< POT >.

Definition at line 62 of file eoLinearTopology.h.

References eoSocialNeighborhood< POT >::best(), and eoSocialNeighborhood< POT >::put().

template<class POT>
unsigned eoLinearTopology< POT >::retrieveNeighborhoodByIndice ( unsigned  _indice) [inline]

Retrieve the neighboorhood of a particle.

Returns:
_indice - The particle indice (in the population)

Definition at line 120 of file eoLinearTopology.h.

Referenced by eoLinearTopology< POT >::best(), and eoLinearTopology< POT >::updateNeighborhood().

template<class POT>
POT& eoLinearTopology< POT >::best ( unsigned  _indice) [inline, virtual]

Return the best informative of a particle.

Could be itself.

Parameters:
_indice- The indice of a particle in the population
Returns:
POT & - The best particle in the neighborhood of the particle whose indice is _indice

Implements eoTopology< POT >.

Definition at line 160 of file eoLinearTopology.h.

References eoLinearTopology< POT >::retrieveNeighborhoodByIndice().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends