PaGMO
1.1.5
|
Particle Swarm optimization generational with racing. More...
#include <pso_generational_racing.h>
Public Member Functions | |
pso_generational_racing (int gen=1, double omega=0.7298, double eta1=2.05, double eta2=2.05, double vcoeff=0.5, int variant=5, int neighb_type=2, int neighb_param=4, unsigned int nr_eval_per_x=5, unsigned int max_fevals=std::numeric_limits< unsigned int >::max()) | |
Constructor. More... | |
base_ptr | clone () const |
Clone method. | |
void | evolve (population &) const |
Evolve implementation. More... | |
std::string | get_name () const |
Algorithm name. | |
Public Member Functions inherited from pagmo::algorithm::base | |
base () | |
Default constructor. More... | |
virtual | ~base () |
Trivial destructor. More... | |
std::string | human_readable () const |
Return human readable representation of the algorithm. More... | |
void | set_screen_output (const bool p) |
Setter-Getter for protected m_screen_output data. More... | |
bool | get_screen_output () const |
Gets screen output. More... | |
void | reset_rngs (const unsigned int) const |
Resets the seed of the internal rngs using a user-provided seed. More... | |
Protected Member Functions | |
std::string | human_readable_extra () const |
Extra human readable algorithm info. More... | |
Friends | |
class | boost::serialization::access |
Additional Inherited Members | |
Protected Attributes inherited from pagmo::algorithm::base | |
bool | m_screen_output |
Indicates to the derived class whether to print stuff on screen. | |
rng_double | m_drng |
Random number generator for double-precision floating point values. | |
rng_uint32 | m_urng |
Random number generator for unsigned integer values. | |
unsigned int | m_fevals |
A counter for the number of function evaluations. | |
Particle Swarm optimization generational with racing.
Compared to the generational version of Particle Swarm Optimization, this PSO is further extended with racing mechanisms for individuals.
Definition at line 43 of file pso_generational_racing.h.
pagmo::algorithm::pso_generational_racing::pso_generational_racing | ( | int | gen = 1 , |
double | omega = 0.7298 , |
||
double | eta1 = 2.05 , |
||
double | eta2 = 2.05 , |
||
double | vcoeff = 0.5 , |
||
int | variant = 5 , |
||
int | neighb_type = 2 , |
||
int | neighb_param = 4 , |
||
unsigned int | nr_eval_per_x = 5 , |
||
unsigned int | max_fevals = std::numeric_limits<unsigned int>::max() |
||
) |
Constructor.
Allows to specify in detail all the parameters of the algorithm.
[in] | gen | number of generations |
[in] | omega | particles' inertia weight, or alternatively, the constriction coefficient (usage depends on the variant used) |
[in] | eta1 | magnitude of the force, applied to the particle's velocity, in the direction of its previous best position |
[in] | eta2 | magnitude of the force, applied to the particle's velocity, in the direction of the best position in its neighborhood |
[in] | vcoeff | velocity coefficient (determining the maximum allowed particle velocity) |
[in] | variant | algorithm variant to use |
[in] | neighb_type | swarm topology to use |
[in] | neighb_param | if the lbest topology is selected (neighb_type=2), it represents each particle's indegree (also outdegree) in the swarm topology. Particles have neighbours u to a radius of k = neighb_param / 2 in the ring. If the Randomly-varying neighbourhood topology is selected (neighb_type=4), neighb_param represents each particle's maximum outdegree in the swarm topology. The minimum outdegree is 1 (the particle always connects back to itself). |
[in] | nr_eval_per_x | Expected number of times an objective function will be evaluated for each individual during racing. |
[in] | max_fevals | Maximum allowed number of fevals as the additional termination condition to gen number |
value_error | if m_omega is not in the [0,1] interval, eta1, eta2 are not in the [0,1] interval, vcoeff is not in ]0,1], variant is not one of 1 .. 6, neighb_type is not one of 1 .. 4 |
Definition at line 58 of file pso_generational_racing.cpp.
|
virtual |
Evolve implementation.
Run the PSO algorithm with incorporation of racing mechanism.
The main differences between this variant of PSO compared to the original PSO algorithm are as follows:
(1) Racing is invoked during the selection of best neighbour in locally connected toplogy. This is in contrast to the original PSO-generational algorithm, where the averaged fitness value w.r.t to current seed is used. Each of such race typically involves a small number of individuals, depending on the specific connection toplogy.
(2) During the update of memory best positions of each particle, racing is again used. Each of such race involves two decision vector, namely the current memory best position and the new candidate position.
(3) With the gbest scheme, a race over all individuals is used to identify the single best.
[in,out] | pop | input/output pagmo::population to be evolved. |
Implements pagmo::algorithm::base.
Definition at line 215 of file pso_generational_racing.cpp.
|
protectedvirtual |
Extra human readable algorithm info.
Will return a formatted string displaying the parameters of the algorithm.
Reimplemented from pagmo::algorithm::base.
Definition at line 874 of file pso_generational_racing.cpp.