highprecisionpso::BoundHandlingRandom Class Reference

This class implements the bound handling strategy random for the particle swarm optimization. More...

#include <random.h>

Inheritance diagram for highprecisionpso::BoundHandlingRandom:

Public Member Functions

 BoundHandlingRandom (bool reset_all)
 The constructor. 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...
 
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...
 

Detailed Description

This class implements the bound handling strategy random for the particle swarm optimization.

If a particle would leave the search space, the new position is set to a random position inside the search space.

Constructor & Destructor Documentation

highprecisionpso::BoundHandlingRandom::BoundHandlingRandom ( bool  reset_all)

The constructor.

Parameters
reset_allSpecifies whether all position entries will be reinitialized randomly, or just the dimensions, which leave the search space.

Member Function Documentation

std::string highprecisionpso::BoundHandlingRandom::GetName ( )
virtual

Returns a string representation of this object.

Returns
The name of the object.

Implements highprecisionpso::BoundHandling.

void highprecisionpso::BoundHandlingRandom::SetParticleUpdate ( Particle p)
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 new position is initialized randomly. Afterwards the specified velocity adjustment is activated with suitable parameters.

Parameters
pThe particle, which should be updated.

Implements highprecisionpso::BoundHandling.


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