EvolvingObjects
eoConstrictedVariableWeightVelocity< POT > Class Template Reference

Inertia variable + constriction velocity for particle swarm optimization. More...

#include <eoConstrictedVariableWeightVelocity.h>

Inheritance diagram for eoConstrictedVariableWeightVelocity< POT >:
eoVelocity< POT > eoBF< POT &, unsigned, void > eoFunctorBase binary_function

List of all members.

Public Types

typedef POT::ParticleVelocityType VelocityType

Public Member Functions

 eoConstrictedVariableWeightVelocity (eoTopology< POT > &_topology, const VelocityType &_coeff, eoWeightUpdater< VelocityType > &_weightUpdater, const VelocityType &_c1, const VelocityType &_c2, eoRealVectorBounds &_bounds, eoRealBoundModifier &_bndsModifier, eoRng &_gen=rng)
 Full constructor: Bounds and bound modifier required.
 eoConstrictedVariableWeightVelocity (eoTopology< POT > &_topology, const VelocityType &_coeff, eoWeightUpdater< VelocityType > &_weightUpdater, const VelocityType &_c1, const VelocityType &_c2, eoRealVectorBounds &_bounds, eoRng &_gen=rng)
 Constructor: No bound updater required <-> fixed bounds.
 eoConstrictedVariableWeightVelocity (eoTopology< POT > &_topology, const VelocityType &_coeff, eoWeightUpdater< VelocityType > &_weightUpdater, const VelocityType &_c1, const VelocityType &_c2, eoRng &_gen=rng)
 Constructor: Neither bounds nor bound updater required <-> free velocity.
void operator() (POT &_po, unsigned _indice)
 Evaluate the new velocities of the given particle.
void updateNeighborhood (POT &_po, unsigned _indice)
 Update the neighborhood.

Protected Attributes

eoTopology< POT > & topology
const VelocityType & coeff
eoWeightUpdater< VelocityType > & weightUpdater
const VelocityType & c1
const VelocityType & c2
eoRealVectorBoundsbounds
eoRealBoundModifierbndsModifier
VelocityType weight
eoRnggen
eoDummyRealBoundModifier dummyModifier

Detailed Description

template<class POT>
class eoConstrictedVariableWeightVelocity< POT >

Inertia variable + constriction velocity for particle swarm optimization.

Derivated from abstract eoVelocity, At step t: v(t+1)= K * ( w*v(t) + c1*r1* (xbest(t)-x(t)) + c2*r2* (gbest(t) - x(t))) w is updated each time the velocity performer is called and K is fixed (ci given and Ri chosen at random in [0;1]).

Definition at line 45 of file eoConstrictedVariableWeightVelocity.h.


Constructor & Destructor Documentation

template<class POT >
eoConstrictedVariableWeightVelocity< POT >::eoConstrictedVariableWeightVelocity ( eoTopology< POT > &  _topology,
const VelocityType &  _coeff,
eoWeightUpdater< VelocityType > &  _weightUpdater,
const VelocityType &  _c1,
const VelocityType &  _c2,
eoRealVectorBounds _bounds,
eoRealBoundModifier _bndsModifier,
eoRng _gen = rng 
) [inline]

Full constructor: Bounds and bound modifier required.

Parameters:
_topology- The topology to get the global/local/other best
_coeff- The constriction coefficient
_weightUpdater- An eoWeightUpdater used to update the inertia weight
_c1- The first learning factor used for the particle's best. Type must be POT::ParticleVelocityType
_c2- The second learning factor used for the local/global best(s). Type must be POT::ParticleVelocityType
_bounds- An eoRealBaseVectorBounds: real bounds for real velocities. If the velocities are not real, they won't be bounded by default. Should have a eoBounds ?
_bndsModifier- An eoRealBoundModifier used to modify the bounds (for real bounds only).
_gen- The eo random generator, default=rng

Definition at line 66 of file eoConstrictedVariableWeightVelocity.h.

template<class POT >
eoConstrictedVariableWeightVelocity< POT >::eoConstrictedVariableWeightVelocity ( eoTopology< POT > &  _topology,
const VelocityType &  _coeff,
eoWeightUpdater< VelocityType > &  _weightUpdater,
const VelocityType &  _c1,
const VelocityType &  _c2,
eoRealVectorBounds _bounds,
eoRng _gen = rng 
) [inline]

Constructor: No bound updater required <-> fixed bounds.

Parameters:
_topology- The topology to get the global/local/other best
_coeff- The constriction coefficient
_weightUpdater- An eoWeightUpdater used to update the inertia weight
_c1- The first learning factor used for the particle's best. Type must be POT::ParticleVelocityType
_c2- The second learning factor used for the local/global best(s). Type must be POT::ParticleVelocityType
_bounds- An eoRealBaseVectorBounds: real bounds for real velocities. If the velocities are not real, they won't be bounded by default. Should have a eoBounds ?
_gen- The eo random generator, default=rng

Definition at line 94 of file eoConstrictedVariableWeightVelocity.h.

template<class POT >
eoConstrictedVariableWeightVelocity< POT >::eoConstrictedVariableWeightVelocity ( eoTopology< POT > &  _topology,
const VelocityType &  _coeff,
eoWeightUpdater< VelocityType > &  _weightUpdater,
const VelocityType &  _c1,
const VelocityType &  _c2,
eoRng _gen = rng 
) [inline]

Constructor: Neither bounds nor bound updater required <-> free velocity.

Parameters:
_topology- The topology to get the global/local/other best*
_coeff- The constriction coefficient
_weightUpdater- An eoWeightUpdater used to update the inertia weight
_c1- The first learning factor used for the particle's best. Type must be POT::ParticleVelocityType
_c2- The second learning factor used for the local/global best(s). Type must be POT::ParticleVelocityType
_gen- The eo random generator, default=rng

Definition at line 119 of file eoConstrictedVariableWeightVelocity.h.


Member Function Documentation

template<class POT >
void eoConstrictedVariableWeightVelocity< POT >::operator() ( POT &  _po,
unsigned  _indice 
) [inline, virtual]

Evaluate the new velocities of the given particle.

Need an indice to identify the particle into the topology. Steps are :

  • evaluate r1 and r2, the customed learning factors
  • adjust the size of the bounds (even if dummy)
  • update the weight with the weightUpdater (use the dummy updater if there's no updater provided)
  • modify the bounds with the bounds modifier (use the dummy modifier if there's no modifier provided)
    Parameters:
    _po- A particle
    _indice- The indice (into the topology) of the given particle

Implements eoBF< POT &, unsigned, void >.

Definition at line 145 of file eoConstrictedVariableWeightVelocity.h.

References eoRealVectorBounds::adjust_size(), eoRealBaseVectorBounds::minimum(), and eoRng::uniform().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends