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

Improved harmony search algorithm. More...

#include <ihs.h>

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

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.
 

Detailed Description

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.

See also
http://en.wikipedia.org/wiki/Harmony_search for an introduction on harmony search.
http://dx.doi.org/10.1016/j.amc.2006.11.033 for the paper that introduces and explains improved harmony search.
Author
Francesco Biscani (blues.nosp@m.carn.nosp@m.i@gma.nosp@m.il.c.nosp@m.om)
Dario Izzo (dario.nosp@m..izz.nosp@m.o@goo.nosp@m.glem.nosp@m.ail.c.nosp@m.om)

Definition at line 62 of file ihs.h.

Constructor & Destructor Documentation

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.

Parameters
[in]iterationsnumber of iterations.
[in]phmcrrate of choosing from memory.
[in]ppar_minminimum pitch adjustment rate.
[in]ppar_maxmaximum pitch adjustment rate.
[in]bw_minminimum distance bandwidth.
[in]bw_maxmaximum distance bandwidth.
Exceptions
value_errorif 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.

Definition at line 59 of file ihs.cpp.

Member Function Documentation

base_ptr pagmo::algorithm::ihs::clone ( ) const
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.

Definition at line 73 of file ihs.cpp.

void pagmo::algorithm::ihs::evolve ( population p) const
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.

Parameters
[in,out]ppopulation to be evolved.

Implements pagmo::algorithm::base.

Definition at line 78 of file ihs.cpp.

std::string pagmo::algorithm::ihs::human_readable_extra ( ) const
protectedvirtual

Extra human readable algorithm info.

Returns
a formatted string displaying the parameters of the algorithm.

Reimplemented from pagmo::algorithm::base.

Definition at line 172 of file ihs.cpp.


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