highprecisionpso::BoundHandling Class Referenceabstract

This class is an abstract class. It supplies the interface for bound handling strategies of the particle swarm optimization algorithm. More...

#include <bound_handling.h>

Inheritance diagram for highprecisionpso::BoundHandling:

Public Member Functions

virtual ~BoundHandling ()
 The destructor. More...
 
virtual std::vector< mpf_t * > GetDirectionVector (const std::vector< mpf_t * > &position, const std::vector< mpf_t * > &aim)
 Calculates the difference vector between the position and the aim. More...
 
virtual std::string GetName ()=0
 Returns a string representation of this object. More...
 
virtual void SetParticleUpdate (Particle *p)=0
 Updates the position of the particle p according to the current position and the new (already calculated) velocity. More...
 

Detailed Description

This class is an abstract class. It supplies the interface for bound handling strategies of the particle swarm optimization algorithm.

Constructor & Destructor Documentation

virtual highprecisionpso::BoundHandling::~BoundHandling ( )
inlinevirtual

The destructor.

Member Function Documentation

virtual std::vector<mpf_t*> highprecisionpso::BoundHandling::GetDirectionVector ( const std::vector< mpf_t * > &  position,
const std::vector< mpf_t * > &  aim 
)
virtual

Calculates the difference vector between the position and the aim.

The standard implementation just calculates the aim vector minus the position vector. For bound handling strategies, which simulate repeated search spaces, this could be changed.

Parameters
positionThe vector, which describes the position.
aimThe vector, which describes the aim.
Returns
The difference from the position to the aim.

Reimplemented in highprecisionpso::BoundHandlingTorus.

virtual void highprecisionpso::BoundHandling::SetParticleUpdate ( Particle p)
pure virtual

Updates the position of the particle p according to the current position and the new (already calculated) velocity.

The new position is calculated by adding the velocity to the position. If the new position would be outside of the search space bounds then the bound handling strategy should be activated. Afterwards the specified velocity adjustment should be activated with suitable parameters.

Warning
Do not forget to call the velocity adjustment method of the velocity adjustment specified in the configuration section.
Parameters
pThe particle, which should be updated.

Implemented in highprecisionpso::BoundHandlingRandomForth, highprecisionpso::BoundHandlingAbsorption, highprecisionpso::BoundHandlingRandom, highprecisionpso::BoundHandlingHyperbolic, highprecisionpso::BoundHandlingTorus, highprecisionpso::BoundHandlingNearest, highprecisionpso::BoundHandlingReflect, and highprecisionpso::BoundHandlingNoBounds.


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