eoVectorParticle< FitT, PositionType, VelocityType > Class Template Reference

Main class for particle representation of particle swarm optimization. More...

#include <eoVectorParticle.h>

Inheritance diagram for eoVectorParticle< FitT, PositionType, VelocityType >:

PO< F > EO< F > eoObject eoPersistent eoPrintable eoBitParticle< FitT > eoRealParticle< FitT >

List of all members.

Public Types

typedef PositionType AtomType
typedef VelocityType ParticleVelocityType

Public Member Functions

 eoVectorParticle (unsigned _size=0, PositionType _position=PositionType(), VelocityType _velocity=VelocityType(), PositionType _bestPositions=PositionType())
 Default constructor.
void position (const std::vector< PositionType > &_v)
void resize (unsigned _size)
 Resize the tree vectors of the particle: positions, velocities and bestPositions.
void resizeBestPositions (unsigned _size)
 Resize the best positions.
void resizeVelocities (unsigned _size)
 Resize the velocities.
bool operator< (const eoVectorParticle< FitT, PositionType, VelocityType > &_eo) const
 to avoid conflicts between EA and PSO
virtual void printOn (std::ostream &os) const
 Print-on a vector-particle.

Public Attributes

std::vector< PositionType > bestPositions
std::vector< ParticleVelocityType > velocities


Detailed Description

template<class FitT, class PositionType, class VelocityType>
class eoVectorParticle< FitT, PositionType, VelocityType >

Main class for particle representation of particle swarm optimization.

The positions, velocities and the best positions associated to the particle are stored as vectors. Inheriting from PO and std::vector, tree templates arguments are required: the fitness type (which is also the type of the particle's best fitness), the position type and the velocity type.

Definition at line 36 of file eoVectorParticle.h.


Constructor & Destructor Documentation

template<class FitT, class PositionType, class VelocityType>
eoVectorParticle< FitT, PositionType, VelocityType >::eoVectorParticle ( unsigned  _size = 0,
PositionType  _position = PositionType (),
VelocityType  _velocity = VelocityType (),
PositionType  _bestPositions = PositionType () 
) [inline]

Default constructor.

Parameters:
_size Length of the tree vectors (we expect the same size), default is 0
position 
velocity 
bestPositions 

Definition at line 67 of file eoVectorParticle.h.


Member Function Documentation

template<class FitT, class PositionType, class VelocityType>
void eoVectorParticle< FitT, PositionType, VelocityType >::resize ( unsigned  _size  )  [inline]

Resize the tree vectors of the particle: positions, velocities and bestPositions.

Parameters:
_size The new size for positions, velocities and bestPositions

Definition at line 96 of file eoVectorParticle.h.

template<class FitT, class PositionType, class VelocityType>
void eoVectorParticle< FitT, PositionType, VelocityType >::resizeBestPositions ( unsigned  _size  )  [inline]

Resize the best positions.

Parameters:
_size The new size for the best positions.

Definition at line 108 of file eoVectorParticle.h.

template<class FitT, class PositionType, class VelocityType>
void eoVectorParticle< FitT, PositionType, VelocityType >::resizeVelocities ( unsigned  _size  )  [inline]

Resize the velocities.

Parameters:
_size The new size for the velocities.

Definition at line 118 of file eoVectorParticle.h.


The documentation for this class was generated from the following file:

Generated on Thu Jan 1 23:19:52 2009 for EvolvingObjects by  doxygen 1.5.5