highprecisionpso::DeltaUpdater Class Reference

The delta updater implements a specific position and velocity update procedure. More...

#include <delta_updater.h>

Inheritance diagram for highprecisionpso::DeltaUpdater:

Public Member Functions

 DeltaUpdater (double delta)
 The constructor, where the fixed bound for sum of absolute velocities and distance to the global optimum can be specified. More...
 
 DeltaUpdater (double initial_delta, double gamma)
 The constructor, where the adaptable bound for the sum of absolute velocities and distance to the global optimum can be specified. More...
 
virtual std::vector< bool > DimensionsOfDeltaUpdate (Particle *p)
 Determines in which dimensions the delta update should be applied. More...
 
std::string GetName ()
 Returns a string representation of this object. More...
 
void LoadData (std::ifstream *input_stream, ProgramVersion *version_of_stored_data)
 Loads data to reset the state of the position and velocity updater to the state which was stored. More...
 
std::vector< std::vector< unsigned long long > > NumberOfDeltaUpdates ()
 Returns the number of delta updates per particle and dimension. More...
 
void StoreData (std::ofstream *output_stream)
 Stores the current state of this position and velocity updater such that it can completely restore the current state with this data. More...
 
void Update (Particle *p)
 Processes a single movement of the specified particle. More...
 
- Public Member Functions inherited from highprecisionpso::PositionAndVelocityUpdater
virtual ~PositionAndVelocityUpdater ()
 

Protected Attributes

mpf_t * delta_
 
const double gamma_
 
const double initial_delta_
 

Detailed Description

The delta updater implements a specific position and velocity update procedure.

In most cases this updater acts according to the standard movement equations, but if the velocity and the distance to the global attractor drops below some bound the velocity is reinitialized with small random values. This variant is described in the paper "Particle Swarm Optimization Almost Surely Finds Local Optima" by M. Schmitt and R. Wanka published in Proceedings of GECCO 2013.

Constructor & Destructor Documentation

highprecisionpso::DeltaUpdater::DeltaUpdater ( double  delta)

The constructor, where the fixed bound for sum of absolute velocities and distance to the global optimum can be specified.

Parameters
deltaThe bound for velocities and the distance to the global attractor.
highprecisionpso::DeltaUpdater::DeltaUpdater ( double  initial_delta,
double  gamma 
)

The constructor, where the adaptable bound for the sum of absolute velocities and distance to the global optimum can be specified.

The bound is initially the value of initial_delta. For each usage of the non standard movement equations the bound is multiplied by gamma.

Parameters
initial_deltaThe initial bound for velocities and the distance to the global attractor.
gammaThe scaling factor after each non standard move of a particle.

Member Function Documentation

virtual std::vector<bool> highprecisionpso::DeltaUpdater::DimensionsOfDeltaUpdate ( Particle p)
virtual

Determines in which dimensions the delta update should be applied.

If the sum of absolute values of the velocity plus the distance to the global attractor drops below a bound for all dimensions of the current particle, then the velocity is reinitialized with some small values. In all other cases the standard movement equations for the particle swarm algorithm are used. This variant is described in the paper "Particle Swarm Optimization Almost Surely Finds Local Optima" by M. Schmitt and R. Wanka published in Proceedings of GECCO 2013.

Parameters
pThe particle, which should be updated.
Returns
A boolean vector, which contains a truth value for each dimension specifying whether the delta update should be applied to the respective dimension.

Reimplemented in highprecisionpso::DeltaUpdaterTCS.

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

Returns a string representation of this object.

Returns
The name of the object.

Implements highprecisionpso::PositionAndVelocityUpdater.

Reimplemented in highprecisionpso::DeltaUpdaterTCS.

void highprecisionpso::DeltaUpdater::LoadData ( std::ifstream *  input_stream,
ProgramVersion version_of_stored_data 
)
virtual

Loads data to reset the state of the position and velocity updater to the state which was stored.

Parameters
input_streamThe stream which contains the data about the state of the position and velocity updater.
version_of_stored_dataThe version of the program when the backup was created.

Reimplemented from highprecisionpso::PositionAndVelocityUpdater.

std::vector<std::vector<unsigned long long> > highprecisionpso::DeltaUpdater::NumberOfDeltaUpdates ( )

Returns the number of delta updates per particle and dimension.

For each particle and each dimension the number of delta updates is counted.

Returns
The current counters for all particles and dimensions enclosed in a vector of vectors.
void highprecisionpso::DeltaUpdater::StoreData ( std::ofstream *  output_stream)
virtual

Stores the current state of this position and velocity updater such that it can completely restore the current state with this data.

Parameters
output_streamThe output stream where the state should be stored.

Reimplemented from highprecisionpso::PositionAndVelocityUpdater.

void highprecisionpso::DeltaUpdater::Update ( Particle p)
virtual

Processes a single movement of the specified particle.

According to the result of function DimensionsOfDeltaUpdate for some dimensions the velocities are reseted to some small random values. In all other dimensions the standard movement equations apply.

Parameters
pThe particle, which should be updated.

Implements highprecisionpso::PositionAndVelocityUpdater.


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