eoLinearTopology< POT > Class Template Reference

One of the local best strategies. More...

#include <eoLinearTopology.h>

Inheritance diagram for eoLinearTopology< POT >:

eoTopology< POT > eoPop< POT > 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.
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.

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

Definition at line 29 of file eoLinearTopology.h.


Constructor & Destructor Documentation

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

Build the topology made of _neighborhoodSize neighborhoods.

Parameters:
_neighborhoods - The size of each neighborhood.

Definition at line 39 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 48 of file eoLinearTopology.h.

References eoLinearTopology< POT >::isSetup, eoLinearTopology< POT >::neighborhoods, and eoLinearTopology< POT >::neighborhoodSize.

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 106 of file eoLinearTopology.h.

References eoLinearTopology< POT >::neighborhoods.

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 146 of file eoLinearTopology.h.

References eoLinearTopology< POT >::neighborhoods, and eoLinearTopology< POT >::retrieveNeighborhoodByIndice().

Referenced by eoLinearTopology< POT >::updateNeighborhood().


The documentation for this class was generated from the following file:
Generated on Fri Jun 22 10:17:02 2007 for EO-PSO by  doxygen 1.4.7