Optimist  0.0.0
A C++ library for optimization
Loading...
Searching...
No Matches
Optimist::Optimizer::ExponentialDecrease1< Scalar > Class Template Reference

Inertia weight functor, which decreases exponentially over time. More...

#include <ParticleSwarm.hh>

Public Member Functions

 ExponentialDecrease1 ()
 ExponentialDecrease1 (const Scalar min_weight, const Scalar max_weight)
Scalar operator() (const Integer iteration, const Integer max_iterations) const

Private Attributes

Scalar m_min_weight {0.4}
Scalar m_max_weight {0.9}

Detailed Description

template<typename Scalar>
class Optimist::Optimizer::ExponentialDecrease1< Scalar >
Template Parameters
ScalarFloating-point number type. The inertia weight is calculated by the following formula:

\[ w = wMin + (wMax - wMin) * \exp\left(-\frac{t}{\frac{tMax}{10}}\right) \text{.} \]

Constructor & Destructor Documentation

◆ ExponentialDecrease1() [1/2]

template<typename Scalar>
Optimist::Optimizer::ExponentialDecrease1< Scalar >::ExponentialDecrease1 ( )
inline

Class constructor with minimum and maximum weights equal to 0.4 and 0.9, respectively.

◆ ExponentialDecrease1() [2/2]

template<typename Scalar>
Optimist::Optimizer::ExponentialDecrease1< Scalar >::ExponentialDecrease1 ( const Scalar min_weight,
const Scalar max_weight )
inline

Class constructor that accepts the minimum and maximum weight of the exponential decrease.

Parameters
[in]min_weightLower bound of the inertia weight
[in]max_weightUpper bound of the inertia weight

Member Function Documentation

◆ operator()()

template<typename Scalar>
Scalar Optimist::Optimizer::ExponentialDecrease1< Scalar >::operator() ( const Integer iteration,
const Integer max_iterations ) const
inline

Get the inertia weight.

Parameters
[in]iterationCurrent iteration.
[in]max_iterationsMaximum number of iterations.
Returns
The inertia weight.

Member Data Documentation

◆ m_max_weight

template<typename Scalar>
Scalar Optimist::Optimizer::ExponentialDecrease1< Scalar >::m_max_weight {0.9}
private

Maximum inertia weight.

◆ m_min_weight

template<typename Scalar>
Scalar Optimist::Optimizer::ExponentialDecrease1< Scalar >::m_min_weight {0.4}
private

Minimum inertia weight.


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