This class is an abstract class. It supplies the interface for neighborhood topologies of the particle swarm. More...
#include <neighborhood.h>
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 |
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
-
p The particle.
- Returns
- The position of the global attractor for particle p.
|
pure virtual |
Returns the position of the global attractor for the particle with the specified particle_id.
- Parameters
-
particle_id The 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.
|
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
-
p The particle.
- Returns
- The value of the global attractor for particle p.
|
pure virtual |
Returns the value of the global attractor for the particle with the specified particle_id.
- Parameters
-
particle_id The 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.
|
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.
|
pure virtual |
Returns a string representation of this object.
- Returns
- The name of the object.
Implemented in highprecisionpso::WheelNeighborhood, highprecisionpso::GridNeighborhood, highprecisionpso::RingNeighborhood, highprecisionpso::LBestNeighborhood, highprecisionpso::AdjacencyListNeighborhood, and highprecisionpso::GlobalBest.
|
pure virtual |
Loads data to reset the state of the neighborhood topology to the state which was stored.
- Parameters
-
input_stream The stream which contains the data about the state of the neighborhood topology. version_of_stored_data The 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).
|
pure virtual |
Stores the current state of this neighborhood topology such that it can completely restore the current state with this data.
- Parameters
-
output_stream The 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
-
position A new candidate position for a global attractor. value The evaluated function value of this position. p The 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
-
position A new candidate position for a global attractor. value The evaluated function value of this position. particle_id The 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
-
position A new candidate position for a global attractor. value The evaluated function value of this position. p The particle, which encountered this new position.
|
pure virtual |
Depending on the neighborhood topology the new position replaces previous global attractors if the new position is better than previous positions.
- Parameters
-
position A new candidate position for a global attractor. value The evaluated function value of this position. particle_id The 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:
- src/neighborhood/neighborhood.h