PaGMO
1.1.5
|
Base class for wrapping NLopt's algorithms. More...
#include <base_nlopt.h>
Protected Member Functions | |
base_nlopt (nlopt::algorithm, bool, bool, int, const double &, const double &) | |
Constructor. More... | |
void | evolve (population &) const |
Evolve method. More... | |
std::string | human_readable_extra () const |
Extra information in human readable format. More... | |
Protected Attributes | |
nlopt::opt | m_opt |
NLOPT optimization method. | |
const std::size_t | m_max_iter |
Maximum number of iterations. | |
const double | m_ftol |
Tolerance on the fitness function variation (stopping criteria) | |
const double | m_xtol |
Tolerance on the decision_vector variation function (stopping criteria) | |
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. | |
Friends | |
class | boost::serialization::access |
Additional Inherited Members | |
Public Member Functions inherited from pagmo::algorithm::base | |
base () | |
Default constructor. More... | |
virtual base_ptr | clone () const =0 |
Clone method. More... | |
virtual | ~base () |
Trivial destructor. More... | |
std::string | human_readable () const |
Return human readable representation of the algorithm. More... | |
virtual std::string | get_name () const |
Get algorithm's name. 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... | |
Base class for wrapping NLopt's algorithms.
NLopt is a free/open-source library for nonlinear optimization, providing a common interface for a number of different free optimization routines available online as well as original implementations of various other algorithms.
This class provides a common interface for NLopt algorithms. The type of algorithm that this class will wrap and the termination conditions can be specified in the constructor.
The evolve() method will select the best individual from the population and will optimise its continuous part using the specified NLopt algorithm. After the optimisation, the individual will be unconditionally re-inserted in the same position in the population.
All algorithms provided in NLopt are single-objective continuous minimisers.
Definition at line 58 of file base_nlopt.h.
|
protected |
Constructor.
Will build a wrapper for the NLopt algorithm algo, specifying the maximum number of iterations allowed and the tolerance (e.g., the relative improvement of the objective function under which the algorithm will stop iterating). The user must also specify whether the chosen NLopt algorithm supports or not constrained optimisation.
[in] | algo | NLopt algorithm (e.g., nlopt::LN_COBYLA). |
[in] | constrained | true if the algorithm supports nonlinear constraints, false otherwise. |
[in] | only_ineq | true if the algorithm only support inequality constraints |
[in] | max_iter | stop-criteria (number of iterations) |
[in] | ftol | stop-criteria (absolute on the obj-fun) |
[in] | xtol | stop-criteria (absolute on the chromosome) |
Definition at line 55 of file base_nlopt.cpp.
|
protectedvirtual |
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.
Definition at line 151 of file base_nlopt.cpp.
|
protectedvirtual |
Extra information in human readable format.
Default implementation returns an empty string.
Reimplemented from pagmo::algorithm::base.
Reimplemented in pagmo::algorithm::nlopt_aug_lag_eq, and pagmo::algorithm::nlopt_aug_lag.
Definition at line 66 of file base_nlopt.cpp.