highprecisionpso::Neighborhood Class Referenceabstract

This class is an abstract class. It supplies the interface for neighborhood topologies of the particle swarm. More...

#include <neighborhood.h>

Inheritance diagram for highprecisionpso::Neighborhood:

Public Member Functions

virtual ~Neighborhood ()
 The destructor. More...
 
std::vector< mpf_t * > GetGlobalAttractorPosition (Particle *p)
 Returns the position of the global attractor for the given particle. More...
 
virtual std::vector< mpf_t * > GetGlobalAttractorPosition (int particle_id)=0
 Returns the position of the global attractor for the particle with the specified particle_id. More...
 
virtual std::vector< mpf_t * > GetGlobalAttractorPosition ()=0
 Returns the position of the best global attractor. More...
 
mpf_t * GetGlobalAttractorValue (Particle *p)
 Returns the value of the global attractor for the particle p. More...
 
virtual mpf_t * GetGlobalAttractorValue (int particle_id)=0
 Returns the value of the global attractor for the particle with the specified particle_id. More...
 
virtual mpf_t * GetGlobalAttractorValue ()=0
 Returns the value of the best global attractor. More...
 
virtual std::string GetName ()=0
 Returns a string representation of this object. More...
 
virtual void LoadData (std::ifstream *input_stream, ProgramVersion *version_of_stored_data)=0
 Loads data to reset the state of the neighborhood topology to the state which was stored. More...
 
void ProceedAllUpdates ()
 Initializes the processing of all entries in the list of pending updates for the global attractors. More...
 
virtual void StoreData (std::ofstream *output_stream)=0
 Stores the current state of this neighborhood topology such that it can completely restore the current state with this data. More...
 
void UpdateAttractor (std::vector< mpf_t * > position, mpf_t *value, Particle *p)
 Appends the tuple of specified position, value and particle to the list of pending updates for global attractors. More...
 
void UpdateAttractor (std::vector< mpf_t * > position, mpf_t *value, int particle_id)
 Appends the tuple of specified position, value and particle to the list of pending updates for global attractors. More...
 
void UpdateAttractorInstantly (std::vector< mpf_t * > position, mpf_t *value, Particle *p)
 Depending on the neighborhood topology the new position replaces previous global attractors if the new position is better than previous positions. More...
 
virtual void UpdateAttractorInstantly (std::vector< mpf_t * > position, mpf_t *value, int particle_id)=0
 Depending on the neighborhood topology the new position replaces previous global attractors if the new position is better than previous positions. More...
 

Detailed Description

This class is an abstract class. It supplies the interface for neighborhood topologies of the particle swarm.

Constructor & Destructor Documentation

virtual highprecisionpso::Neighborhood::~Neighborhood ( )
virtual

The destructor.

Member Function Documentation

std::vector<mpf_t*> highprecisionpso::Neighborhood::GetGlobalAttractorPosition ( Particle p)

Returns the position of the global attractor for the given particle.

Parameters
pThe particle.
Returns
The position of the global attractor for particle p.
virtual std::vector<mpf_t*> highprecisionpso::Neighborhood::GetGlobalAttractorPosition ( int  particle_id)
pure virtual

Returns the position of the global attractor for the particle with the specified particle_id.

Parameters
particle_idThe index of the particle.
Returns
The position of the global attractor for the particle with index particle_id.

Implemented in highprecisionpso::AdjacencyListNeighborhood, and highprecisionpso::GlobalBest.

virtual std::vector<mpf_t*> highprecisionpso::Neighborhood::GetGlobalAttractorPosition ( )
pure virtual

Returns the position of the best global attractor.

Returns
The position of the best global attractor.

Implemented in highprecisionpso::AdjacencyListNeighborhood, and highprecisionpso::GlobalBest.

mpf_t* highprecisionpso::Neighborhood::GetGlobalAttractorValue ( Particle p)

Returns the value of the global attractor for the particle p.

Parameters
pThe particle.
Returns
The value of the global attractor for particle p.
virtual mpf_t* highprecisionpso::Neighborhood::GetGlobalAttractorValue ( int  particle_id)
pure virtual

Returns the value of the global attractor for the particle with the specified particle_id.

Parameters
particle_idThe index of the particle.
Returns
The value of the global attractor for the particle with index particle_id.

Implemented in highprecisionpso::AdjacencyListNeighborhood, and highprecisionpso::GlobalBest.

virtual mpf_t* highprecisionpso::Neighborhood::GetGlobalAttractorValue ( )
pure virtual

Returns the value of the best global attractor.

Returns
The value of the best global attractor.

Implemented in highprecisionpso::AdjacencyListNeighborhood, and highprecisionpso::GlobalBest.

virtual std::string highprecisionpso::Neighborhood::GetName ( )
pure virtual
virtual void highprecisionpso::Neighborhood::LoadData ( std::ifstream *  input_stream,
ProgramVersion version_of_stored_data 
)
pure virtual

Loads data to reset the state of the neighborhood topology to the state which was stored.

Parameters
input_streamThe stream which contains the data about the state of the neighborhood topology.
version_of_stored_dataThe version of the program when the backup was created.

Implemented in highprecisionpso::AdjacencyListNeighborhood, and highprecisionpso::GlobalBest.

void highprecisionpso::Neighborhood::ProceedAllUpdates ( )

Initializes the processing of all entries in the list of pending updates for the global attractors.

The list of pending updates will be processed depending on mode of updates (Configuration::UPDATE_GLOBAL_ATTRACTOR).

virtual void highprecisionpso::Neighborhood::StoreData ( std::ofstream *  output_stream)
pure virtual

Stores the current state of this neighborhood topology such that it can completely restore the current state with this data.

Parameters
output_streamThe output stream where the state should be stored.

Implemented in highprecisionpso::AdjacencyListNeighborhood, and highprecisionpso::GlobalBest.

void highprecisionpso::Neighborhood::UpdateAttractor ( std::vector< mpf_t * >  position,
mpf_t *  value,
Particle p 
)

Appends the tuple of specified position, value and particle to the list of pending updates for global attractors.

The actual update is executed by the method updateAttractorInstantly. The list of pending updates will be processed depending on mode of updates (Configuration::UPDATE_GLOBAL_ATTRACTOR).

Parameters
positionA new candidate position for a global attractor.
valueThe evaluated function value of this position.
pThe particle, which encountered this new position.
void highprecisionpso::Neighborhood::UpdateAttractor ( std::vector< mpf_t * >  position,
mpf_t *  value,
int  particle_id 
)

Appends the tuple of specified position, value and particle to the list of pending updates for global attractors.

The actual update is executed by the method updateAttractorInstantly. The list of pending updates will be processed depending on mode of updates (Configuration::UPDATE_GLOBAL_ATTRACTOR).

Parameters
positionA new candidate position for a global attractor.
valueThe evaluated function value of this position.
particle_idThe index of the particle, which encountered this new position.
void highprecisionpso::Neighborhood::UpdateAttractorInstantly ( std::vector< mpf_t * >  position,
mpf_t *  value,
Particle p 
)

Depending on the neighborhood topology the new position replaces previous global attractors if the new position is better than previous positions.

Parameters
positionA new candidate position for a global attractor.
valueThe evaluated function value of this position.
pThe particle, which encountered this new position.
virtual void highprecisionpso::Neighborhood::UpdateAttractorInstantly ( std::vector< mpf_t * >  position,
mpf_t *  value,
int  particle_id 
)
pure virtual

Depending on the neighborhood topology the new position replaces previous global attractors if the new position is better than previous positions.

Parameters
positionA new candidate position for a global attractor.
valueThe evaluated function value of this position.
particle_idThe index of the particle, which encountered this new position.

Implemented in highprecisionpso::AdjacencyListNeighborhood, and highprecisionpso::GlobalBest.


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