eoVectorParticle< FitT, PositionType, VelocityType > Class Template Reference

Main class for particle representation. More...

#include <eoVectorParticle.h>

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

PO< FitT > EO< FitT > eoObject eoPersistent eoPrintable 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.

Public Attributes

std::vector< PositionType > bestPositions
std::vector< ParticleVelocityTypevelocities

Detailed Description

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

Main class for particle representation.

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 22 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 53 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 82 of file eoVectorParticle.h.

Referenced by eoVectorParticle< FitT, bool, double >::position().

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 94 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 104 of file eoVectorParticle.h.


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