PaGMO  1.1.5
Public Member Functions | Protected Member Functions | Friends
pagmo::algorithm::pso_generational Class Reference

Particle Swarm optimization generational. More...

#include <pso_generational.h>

Inheritance diagram for pagmo::algorithm::pso_generational:
Inheritance graph
[legend]

Public Member Functions

 pso_generational (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)
 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.
 

Detailed Description

Particle Swarm optimization generational.

As opposed to the main PSO algorithm implemented in Pagmo, that is pagmo::algorithm::pso, this version of Particle Swarm Optimization is generational. In other words, the velocity is first calculated for all particles, then the position is updated.

NOTE: this PSO is suitable for stochastic optimization problems. The random seed is changed at the end of each generation

See also
http://www.particleswarm.info/ for a repository of information related to PSO
http://dx.doi.org/10.1007/s11721-007-0002-0 for a recent survey
http://www.engr.iupui.edu/~shi/Coference/psopap4.html for the first paper on this algorithm
Author
Dario Izzo (dario.nosp@m..izz.nosp@m.o@goo.nosp@m.glem.nosp@m.ail.c.nosp@m.om)
Luis Simoes (luis..nosp@m.f.m..nosp@m.simoe.nosp@m.s@gm.nosp@m.ail.c.nosp@m.om)

Definition at line 52 of file pso_generational.h.

Constructor & Destructor Documentation

pagmo::algorithm::pso_generational::pso_generational ( 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 
)

Constructor.

Allows to specify in detail all the parameters of the algorithm.

Parameters
[in]gennumber of generations
[in]omegaparticles' inertia weight, or alternatively, the constriction coefficient (usage depends on the variant used)
[in]eta1magnitude of the force, applied to the particle's velocity, in the direction of its previous best position
[in]eta2magnitude of the force, applied to the particle's velocity, in the direction of the best position in its neighborhood
[in]vcoeffvelocity coefficient (determining the maximum allowed particle velocity)
[in]variantalgorithm variant to use
[in]neighb_typeswarm topology to use
[in]neighb_paramif the lbest topology is selected (neighb_type=2), it represents each particle's indegree (also outdegree) in the swarm topology. Particles have neighbours up 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).
Exceptions
value_errorif 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.cpp.

Member Function Documentation

void pagmo::algorithm::pso_generational::evolve ( population pop) const
virtual

Evolve implementation.

Run the PSO algorithm for the number of generations specified in the constructors.

Parameters
[in,out]popinput/output pagmo::population to be evolved.

We now set the cleared pop. cur_x is the best_x, re-evaluated with new seed.

Implements pagmo::algorithm::base.

Definition at line 104 of file pso_generational.cpp.

std::string pagmo::algorithm::pso_generational::human_readable_extra ( ) const
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 619 of file pso_generational.cpp.


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