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>
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
|
inlinevirtual |
The destructor.
Member Function Documentation
|
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
-
position The vector, which describes the position. aim The vector, which describes the aim.
- Returns
- The difference from the position to the aim.
Reimplemented in highprecisionpso::BoundHandlingTorus.
|
pure virtual |
Returns a string representation of this object.
- Returns
- The name of the object.
Implemented in highprecisionpso::BoundHandlingRandomForth, highprecisionpso::BoundHandlingAbsorption, highprecisionpso::BoundHandlingRandom, highprecisionpso::BoundHandlingHyperbolic, highprecisionpso::BoundHandlingTorus, highprecisionpso::BoundHandlingNearest, highprecisionpso::BoundHandlingReflect, and highprecisionpso::BoundHandlingNoBounds.
|
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
-
p The 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:
- src/bound_handling/bound_handling.h