This class implements the bound handling strategy torus for the particle swarm optimization. More...
#include <torus.h>
Public Member Functions | |
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... | |
std::string | GetName () |
Returns a string representation of this object. More... | |
void | SetParticleUpdate (Particle *p) |
Updates the position of the particle p according to the current position and the new (already calculated) velocity. More... | |
Public Member Functions inherited from highprecisionpso::BoundHandling | |
virtual | ~BoundHandling () |
The destructor. More... | |
Detailed Description
This class implements the bound handling strategy torus for the particle swarm optimization.
If a particle would leave the search space on one side, it will enter the search space on the other side. The movement is similar to modular arithmetic.
Member Function Documentation
|
virtual |
Calculates the difference vector between the position and the aim.
As the search space repeats, the aim can be reached in positive direction as well as in negative direction. The value with smaller absolute value counts as the difference in that dimension.
- 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 from highprecisionpso::BoundHandling.
|
virtual |
Returns a string representation of this object.
- Returns
- The name of the object.
Implements highprecisionpso::BoundHandling.
|
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 torus is activated. If a particle would leave the search space on one side, it will enter the search space on the other side. The movement is similar to modular arithmetic. No velocity adjustment is executed here.
- Parameters
-
p The particle, which should be updated.
Implements highprecisionpso::BoundHandling.
The documentation for this class was generated from the following file:
- src/bound_handling/torus.h