template<class PARTICLE_TYPE, class OBSERVATION_TYPE>
class ParticleSwarmOptimization< PARTICLE_TYPE, OBSERVATION_TYPE >
Definition at line 41 of file ParticleSwarmOptimization.h.
template<class PARTICLE_TYPE , class OBSERVATION_TYPE >
template<class PARTICLE_TYPE , class OBSERVATION_TYPE >
template<class PARTICLE_TYPE , class OBSERVATION_TYPE >
This function initializes the PSO algorithm. This allows the user to set the number of particles, the size of the particle state Vector (set by K), the minimum and maximum range of the space the PSO algorithm should search, and the propagation model.
The default propagation model for each particle is just Gaussian noise, in that case the propagation model will be a K dimensional Vector, with each element representing sigma for the Gaussian noise for each dimension.
After you call this function, you can call the search() function to run the actual search. You can reset the particles at any time using the reset() function.
- Parameters
-
numParticles | the number of particles that will be used for the search |
K | the size of the particles state Vector |
xMin | the minimum range of the x state Vector (i.e. the space that should be searched) |
xMax | the maximum range of the x state Vector (i.e. the space that should be searched) |
propagationModel | the propagation model used for each particle, this is normally just gaussian noise (see above) |
- Returns
- returns true if the PSO algorithm was initialized successfully, false otherwise
Definition at line 88 of file ParticleSwarmOptimization.h.
template<class PARTICLE_TYPE , class OBSERVATION_TYPE >
Provides direct access to the i'th particle. It is up to the user to ensure that i is within the range [0 numParticles-1].
- Parameters
-
index | the index of the particle you want to access |
- Returns
- returns a reference to the i'th particle
Definition at line 68 of file ParticleSwarmOptimization.h.
template<class PARTICLE_TYPE , class OBSERVATION_TYPE >
Resets each particles state Vector to a random position and velocity. You need to initialize the PSO algorithm first before you can use this function.
- Returns
- returns true if the PSO algorithm was reset successfully, false otherwise
Definition at line 133 of file ParticleSwarmOptimization.h.
template<class PARTICLE_TYPE , class OBSERVATION_TYPE >
Performs the main search. You need to initialize the PSO algorithm first before you can use this function.
- Parameters
-
OBSERVATION_TYPE | &observation: a reference to the observation data used for the search |
- Returns
- returns true if the search ran successfully, false otherwise
Definition at line 151 of file ParticleSwarmOptimization.h.
template<class PARTICLE_TYPE , class OBSERVATION_TYPE >
virtual Float ParticleSwarmOptimization< PARTICLE_TYPE, OBSERVATION_TYPE >::searchIteration |
( |
OBSERVATION_TYPE & |
observation | ) |
|
|
inlinevirtual |
Performs one iteration of the search. Normally, you do not call this function directly but instead call the main search() function. You need to initialize the PSO algorithm first before you can use this function.
- Parameters
-
observation | a reference to the observation data used for the search |
- Returns
- returns true if the search ran successfully, false otherwise
Definition at line 209 of file ParticleSwarmOptimization.h.
template<class PARTICLE_TYPE , class OBSERVATION_TYPE >
Updates the propagation model. You need to initialize the PSO algorithm first before you can use this function.
const propagationModel: the new propagation model
- Returns
- returns true if the propagationModel was updated successfully, false otherwise
Definition at line 254 of file ParticleSwarmOptimization.h.
The documentation for this class was generated from the following file: