PaGMO
1.1.5
|
Improved harmony search algorithm. More...
#include <ihs.h>
Public Member Functions | |
ihs (int gen=1, const double &phmcr=0.85, const double &ppar_min=0.35, const double &ppar_max=0.99, const double &bw_min=1E-5, const double &bw_max=1) | |
Constructor. More... | |
base_ptr | clone () const |
Clone method. More... | |
void | evolve (population &) const |
Evolve method. 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. | |
Improved harmony search algorithm.
Harmony search (HS) is a metaheuristic algorithm mimicking the improvisation process of musicians. In the process, each musician (i.e., each variable) plays (i.e., generates) a note (i.e., a value) for finding a best harmony (i.e., the global optimum) all together.
This code implements the so-called improved harmony search algorithm (IHS), in which the probability of picking the variables from the decision vector and the amount of mutation to which they are subject vary respectively linearly and exponentially within each call of the evolve() method.
In this algorithm the number of objective function evaluations is equal to the number of generations. All the individuals in the input population participate in the evolution. A new individual is generated at every iteration, substituting the current worst individual of the population if better. This algorithm will use the comparison methods provided by the problem in order to rank individuals.
This algorithm is suitable for continuous, constrained, mixed-integer and multi-objective optimisation.
pagmo::algorithm::ihs::ihs | ( | int | iterations = 1 , |
const double & | phmcr = 0.85 , |
||
const double & | ppar_min = 0.35 , |
||
const double & | ppar_max = 0.99 , |
||
const double & | bw_min = 1E-5 , |
||
const double & | bw_max = 1 |
||
) |
Constructor.
Allows to specify in detail the parameters of the algorithm.
[in] | iterations | number of iterations. |
[in] | phmcr | rate of choosing from memory. |
[in] | ppar_min | minimum pitch adjustment rate. |
[in] | ppar_max | maximum pitch adjustment rate. |
[in] | bw_min | minimum distance bandwidth. |
[in] | bw_max | maximum distance bandwidth. |
value_error | if phmcr is not in the ]0,1[ interval, ppar min/max are not in the ]0,1[ interval, min/max quantities are less than/greater than max/min quantities. |
|
virtual |
Clone method.
Provided that the derived algorithm implements properly the copy constructor, virtually all implementations of this method will look like this:
return base_ptr(new derived_algorithm(*this));
@return algorithm::base_ptr to a copy of this.
Implements pagmo::algorithm::base.
|
virtual |
Evolve method.
The purpose of this method is to take a pagmo::population as input and evolve it towards the solution of the problem.
[in,out] | p | population to be evolved. |
Implements pagmo::algorithm::base.
|
protectedvirtual |
Extra human readable algorithm info.
Reimplemented from pagmo::algorithm::base.