pagmo::
decompose
¶Decompose meta-problem.
This meta-problem decomposes a multi-objective input problem (user-defined or a pagmo::problem), resulting in a single-objective pagmo::problem with a fitness function combining the original fitness functions. In particular, three different decomposition methods are here made available:
In the case of \(n\) objectives, we indicate with: \( \mathbf f(\mathbf x) = [f_1(\mathbf x), \ldots, f_n(\mathbf x)] \) the vector containing the original multiple objectives, with: \( \boldsymbol \lambda = (\lambda_1, \ldots, \lambda_n) \) a \(n\)-dimensional weight vector and with: \( \mathbf z^* = (z^*_1, \ldots, z^*_n) \) a- \(n\) dimensional reference point. We also ussume \(\lambda_i > 0, \forall i=1..n\) and \(\sum_i \lambda_i = 1\)
The decomposed problem is thus a single objective optimization problem having the following single objective, according to the decomposition method chosen:
where \(d_1 = (\mathbf f - \mathbf z^*) \cdot \hat {\mathbf i}_{\lambda}\), \(d_2 = \vert (\mathbf f - \mathbf z^*) - d_1 \hat {\mathbf i}_{\lambda})\vert\) and \( \hat {\mathbf i}_{\lambda} = \frac{\boldsymbol \lambda}{\vert \boldsymbol \lambda \vert}\)
Inherits from pagmo::problem
Public Functions
decompose
(T &&p, const vector_double &weight, const vector_double &z, const std::string &method = "weighted", bool adapt_ideal = false)¶Constructor from problem.
Wraps a user-defined problem so that its fitness will be decomposed using one of three decomposition methods. pagmo::translate objects can be used as user-defined problems in the construction of a pagmo::problem.
T
- Any type from which pagmo::problem is constructable
p
- The input problem.
method
- an std::string containing the decomposition method chosen
weight
- the vector of weights \(\boldsymbol \lambda\)
z
- the reference point \(\mathbf z^*\)
adapt_ideal
- when true the reference point is adapted at each fitness evaluation to be the ideal point
std::invalid_argument
- if the problem of type T
is single objective
std::invalid_argument
- if the problem of type T
is constrained
std::invalid_argument
- if method
is not one of [“weighted”, “tchebycheff” or “bi”]
std::invalid_argument
- if weight
is not of size \(n\)
std::invalid_argument
- if z
is not of size \(n\)
std::invalid_argument
- if weight
is not such that \(\lambda_i > 0, \forall i=1..n\)
std::invalid_argument
- if weight
is not such that \(\sum_i \lambda_i = 1\)
fitness
(const vector_double &x) const¶Fitness of the decomposed problem.
get_nobj
() const¶A decomposed problem has one objective.
gradient_sparsity
() const¶Returns a dense gradient_sparsity for the decomposed problem.
hessians_sparsity
() const¶Returns a dense hessians_sparsity for the decomposed problem.
get_z
() const¶Gets the current reference point (may be different from the one the object was constructed with)
get_name
() const¶Appends “[decomposed]” to the user-defined problem name.
get_extra_info
() const¶Extra informations.
serialize
(Archive &ar)¶Serialize.
extract
() const¶Extracts the user-defined problem.
Extracts the original problem that was provided by the user, thus granting access to additional resources there implemented.
nullptr
if T
does not correspond exactly to the original problem type used in the constructor. T
- The type of the orignal user-defined problem
get_bounds
() const¶Box-bounds.
get_nec
() const¶Number of equality constraints.
get_nic
() const¶Number of inequality constraints.
set_seed
(unsigned int seed)¶Sets the seed for the stochastic variables.
Sets the seed to be used in the fitness function to instantiate all stochastic variables.
seed
- seed
has_set_seed
() const¶Check if the user-defined problem implements a set_seed method.
If the user defined problem implements a set_seed method, this will return true, false otherwise. The value returned can also be forced by the user by implementing the additional method
bool has_set_seed() const
in the user-defined problem