PaGMO  1.1.5
Public Types | Public Member Functions | Protected Member Functions | Friends
pagmo::problem::decompose Class Reference

Decompose meta-problem. More...

#include <decompose.h>

Inheritance diagram for pagmo::problem::decompose:
Inheritance graph
[legend]

Public Types

enum  method_type { WEIGHTED =0, TCHEBYCHEFF =1, BI =2 }
 Mechanism used to perform the problem decomposition. More...
 
- Public Types inherited from pagmo::problem::base
typedef decision_vector::size_type size_type
 Problem's size type: the same as pagmo::decision_vector's size type.
 
typedef fitness_vector::size_type f_size_type
 Fitness' size type: the same as pagmo::fitness_vector's size type.
 
typedef constraint_vector::size_type c_size_type
 Constraints' size type: the same as pagmo::constraint_vector's size type.
 

Public Member Functions

 decompose (const base &=zdt(1, 2), method_type=WEIGHTED, const std::vector< double > &=std::vector< double >(), const std::vector< double > &=std::vector< double >(), const bool=false)
 
base_ptr clone () const
 Clone method.
 
std::string get_name () const
 Get problem's name. More...
 
const std::vector< double > & get_weights () const
 
void compute_decomposed_fitness (fitness_vector &, const fitness_vector &) const
 Computes the decomposed fitness. More...
 
void compute_decomposed_fitness (fitness_vector &, const fitness_vector &, const fitness_vector &) const
 Computes the decomposed fitness. More...
 
void compute_original_fitness (fitness_vector &, const decision_vector &) const
 Computes the original fitness. More...
 
fitness_vector get_ideal_point () const
 Gets the ideal point.
 
void set_ideal_point (const fitness_vector &f)
 Sets the ideal point.
 
- Public Member Functions inherited from pagmo::problem::base_meta
 base_meta (const base &p=ackley(1), int n=1, int ni=0, int nf=1, int nc=0, int nic=0, const std::vector< double > &c_tol=std::vector< double >())
 Constructor.
 
 base_meta (const base_meta &p)
 Copy constructor.
 
- Public Member Functions inherited from pagmo::problem::base
 base (int, int=0, int=1, int=0, int=0, const double &=0)
 Constructor from global dimension, integer dimension, fitness dimension, global constraints dimension, inequality constraints dimension and constraints tolerance. More...
 
 base (int, int, int, int, int, const std::vector< double > &)
 Constructor from global dimension, integer dimension, fitness dimension, global constraints dimension, inequality constraints dimension and constraints tolerance. More...
 
 base (const double &, const double &, int, int=0, int=1, int=0, int=0, const double &=0)
 Constructor from values for lower and upper bounds, global dimension, integer dimension, fitness dimension, global constraints dimension, inequality constraints dimension and constraints tolerance. More...
 
 base (const decision_vector &, const decision_vector &, int=0, int=1, int=0, int=0, const double &=0)
 Constructor from upper/lower bounds, integer dimension, fitness dimension, global constraints dimension, inequality constraints dimension and constraints tolerance. More...
 
template<std::size_t N>
 base (const double(&v1)[N], const double(&v2)[N], int ni=0, int nf=1, int nc=0, int nic=0, const double &c_tol=0)
 Constructor from raw arrays, integer dimension, fitness dimension, global constraints dimension, inequality constraints dimension and constraints tolerance. More...
 
template<class Iterator1 , class Iterator2 >
 base (Iterator1 start1, Iterator1 end1, Iterator2 start2, Iterator2 end2, int ni=0, int nf=1, int nc=0, int nic=0, const double &c_tol=0)
 Constructor from iterators, integer dimension, fitness dimension, global constraints dimension, inequality constraints dimension and constraints tolerance. More...
 
virtual ~base ()
 Trivial destructor. More...
 
std::string human_readable () const
 Return human readable representation of the problem. More...
 
bool operator== (const base &) const
 Equality operator. More...
 
bool operator!= (const base &) const
 Inequality operator. More...
 
bool is_compatible (const base &) const
 Compatibility operator. More...
 
bool compare_x (const decision_vector &, const decision_vector &) const
 Compare decision vectors. More...
 
bool verify_x (const decision_vector &) const
 Verify compatibility of decision vector x with problem. More...
 
bool compare_fc (const fitness_vector &, const constraint_vector &, const fitness_vector &, const constraint_vector &) const
 Simultaneous fitness-constraint comparison. More...
 
virtual void pre_evolution (population &) const
 Pre-evolution hook. More...
 
virtual void post_evolution (population &) const
 Post-evolution hook. More...
 
virtual void set_sparsity (int &lenG, std::vector< int > &iGfun, std::vector< int > &jGvar) const
 Sets the sparsity pattern of the gradient. More...
 
const decision_vectorget_lb () const
 Lower bounds getter. More...
 
const decision_vectorget_ub () const
 Upper bounds getter. More...
 
void set_bounds (const decision_vector &, const decision_vector &)
 Bounds setter from pagmo::decision_vector. More...
 
template<class Iterator1 , class Iterator2 >
void set_bounds (Iterator1 start1, Iterator1 end1, Iterator2 start2, Iterator2 end2)
 Bounds setter from iterators. More...
 
template<std::size_t N>
void set_bounds (const double(&v1)[N], const double(&v2)[N])
 Bounds setter from raw arrays. More...
 
void set_bounds (const double &, const double &)
 Set bounds to specified values. More...
 
void set_bounds (int, const double &, const double &)
 Set bounds to specified values. More...
 
void set_lb (const decision_vector &)
 Set lower bounds from pagmo::decision_vector. More...
 
void set_lb (int, const double &)
 Set specific lower bound to value. More...
 
void set_lb (const double &)
 Set all lower bounds to value. More...
 
template<class Iterator >
void set_lb (Iterator start, Iterator end)
 Lower bounds setter from iterators. More...
 
template<std::size_t N>
void set_lb (const double(&v)[N])
 Lower bounds setter from raw array. More...
 
void set_ub (const decision_vector &)
 Set upper bounds from pagmo::decision_vector. More...
 
void set_ub (int, const double &)
 Set specific upper bound to value. More...
 
void set_ub (const double &)
 Set all upper bounds to value. More...
 
template<class Iterator >
void set_ub (Iterator start, Iterator end)
 Upper bounds setter from iterators. More...
 
template<std::size_t N>
void set_ub (const double(&v)[N])
 Upper bounds setter from raw array. More...
 
unsigned int get_fevals () const
 Return number of function evaluations. More...
 
unsigned int get_cevals () const
 Return number of constraints function evaluations. More...
 
size_type get_dimension () const
 Return global dimension. More...
 
size_type get_i_dimension () const
 Return integer dimension. More...
 
f_size_type get_f_dimension () const
 Return fitness dimension. More...
 
c_size_type get_c_dimension () const
 Return global constraints dimension. More...
 
c_size_type get_ic_dimension () const
 Return inequality constraints dimension. More...
 
const std::vector< double > & get_c_tol () const
 Return constraints tolerance. More...
 
double get_diameter () const
 Get the diameter of the problem. More...
 
constraint_vector compute_constraints (const decision_vector &) const
 Compute constraints and return constraint vector. More...
 
void compute_constraints (constraint_vector &, const decision_vector &) const
 Compute constraints and write them into contraint vector. More...
 
bool compare_constraints (const constraint_vector &, const constraint_vector &) const
 Compare constraint vectors. More...
 
bool test_constraint (const constraint_vector &, const c_size_type &) const
 Test i-th constraint of c (using tolerance information). More...
 
bool feasibility_x (const decision_vector &) const
 Test feasibility of decision vector. More...
 
bool feasibility_c (const constraint_vector &) const
 Test feasibility of constraint vector. More...
 
fitness_vector objfun (const decision_vector &) const
 Return fitness of pagmo::decision_vector. More...
 
void objfun (fitness_vector &, const decision_vector &) const
 Write fitness of pagmo::decision_vector into pagmo::fitness_vector. More...
 
bool compare_fitness (const fitness_vector &, const fitness_vector &) const
 Compare fitness vectors. More...
 
void reset_caches () const
 Reset internal caches. More...
 
const std::vector< constraint_vector > & get_best_c (void) const
 Get the best known constraint vector. More...
 
const std::vector< decision_vector > & get_best_x (void) const
 Get the best known decision vector. More...
 
const std::vector< fitness_vector > & get_best_f (void) const
 Get the best known fitness vector. More...
 
void set_best_x (const std::vector< decision_vector > &)
 Sets the best known decision vectors. More...
 

Protected Member Functions

std::string human_readable_extra () const
 Extra information in human readable format. More...
 
void objfun_impl (fitness_vector &, const decision_vector &) const
 Implementation of the objective function.
 
- Protected Member Functions inherited from pagmo::problem::base_meta
bool compare_fitness_impl (const fitness_vector &f1, const fitness_vector &f2) const
 Implementation of fitness vectors comparison. More...
 
bool compare_constraints_impl (const constraint_vector &c1, const constraint_vector &c2) const
 Implementation of constraint vector comparison. More...
 
bool compare_fc_impl (const fitness_vector &f1, const constraint_vector &c1, const fitness_vector &f2, const constraint_vector &c2) const
 Implementation of simultaneous fitness-constraint comparison. More...
 
- Protected Member Functions inherited from pagmo::problem::base
virtual bool equality_operator_extra (const base &) const
 Extra requirements for equality. More...
 
void estimate_sparsity (const decision_vector &, int &lenG, std::vector< int > &iGfun, std::vector< int > &jGvar) const
 Heuristics to estimate the sparsity pattern of the problem. More...
 
void estimate_sparsity (int &lenG, std::vector< int > &iGfun, std::vector< int > &jGvar) const
 Heuristics to estimate the sparsity pattern of the problem. More...
 
virtual void compute_constraints_impl (constraint_vector &, const decision_vector &) const
 Implementation of constraint computation. More...
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Static Public Attributes inherited from pagmo::problem::base
static const std::size_t cache_capacity = 5
 Capacity of the internal caches.
 
- Protected Attributes inherited from pagmo::problem::base_meta
base_ptr m_original_problem
 Smart pointer to the original problem instance.
 

Detailed Description

Decompose meta-problem.

Implements a meta-problem class resulting in a decomposed version of the multi-objective input problem, i.e. a single-objective problem having as fitness function some kind of combination of the original fitness functions

Being $ F(X) = (F_1(X), \ldots, F_n(X)) $ the original multi-objective fitness function and $ w = (w_1, \ldots, w_n) $ $ z = (z_1, \ldots, z_n) $ respectively a weight vector and a reference point, the decomposed problem has as single-objective fitness function one of the following according to which decomposition methods is choosed:

WEIGHTED: $ F_d(X) = \sum_{i=1}^n w_i F_i(X) $

TCHEBYCHEFF $ F_d(X) = max_{1 \leq i \leq m} w_i \vert F_i(X) - z_i \vert $

Author
Andrea Mambrini (andre.nosp@m.a.ma.nosp@m.mbrin.nosp@m.i@gm.nosp@m.ail.c.nosp@m.om)
See also
"Q. Zhang -- MOEA/D: A Multiobjective Evolutionary Algorithm Based on Decomposition"

Definition at line 62 of file decompose.h.

Member Enumeration Documentation

Mechanism used to perform the problem decomposition.

Enumerator
WEIGHTED 

The fitness function is the weighted sum of the multiple original fitnesses.

TCHEBYCHEFF 

The Tchebycheff method is used to perform the decomposition.

BI 

The Boundary Intersection method is used to perform the decomposition.

Definition at line 66 of file decompose.h.

Constructor & Destructor Documentation

pagmo::problem::decompose::decompose ( const base p = zdt(1,2),
method_type  method = WEIGHTED,
const std::vector< double > &  weights = std::vector<double>(),
const std::vector< double > &  z = std::vector<double>(),
const bool  adapt_ideal = false 
)

Constructor

Parameters
[in]pbase::problem to be decomposed
[in]methoddecomposition method (WEIGHTS, TCHEBYCHEFF, BI)
[in]weightsthe weight vector (by default is set to random weights)
[in]zideal reference point (used in Tchebycheff and Boundary Intersection (BI) methods, by default it is set to 0)
[in]adapt_idealif true it updates the ideal reference point each time the objective function is called checking if the computed fitness is better (assumes minimization)
See also
For the uniform random generation of weights vector see Appendix 2 in "A. Jaszkiewicz - On the Performance of Multiple-Objective Genetic Local Search on the 0/1 Knapsack Problem—A Comparative Experiment"
For the different decomposition methods see "Q. Zhang - MOEA/D: A Multiobjective Evolutionary Algorithm Based on Decomposition"

Definition at line 50 of file decompose.cpp.

Member Function Documentation

void pagmo::problem::decompose::compute_decomposed_fitness ( fitness_vector f,
const fitness_vector original_fit 
) const

Computes the decomposed fitness.

Computes the decomposed fitness from the original multi-objective fitness using the data member m_weights

Parameters
fdecomposed fitness vector
original_fitoriginal multi-objective fitness vector

Definition at line 167 of file decompose.cpp.

void pagmo::problem::decompose::compute_decomposed_fitness ( fitness_vector f,
const fitness_vector original_fit,
const fitness_vector weights 
) const

Computes the decomposed fitness.

Computes the decomposed fitness from the original multi-objective one and a weight vector

Parameters
[out]fdecomposed fitness vector
[in]original_fitoriginal multi-objective fitness vector
[in]weightsweights vector

Definition at line 180 of file decompose.cpp.

void pagmo::problem::decompose::compute_original_fitness ( fitness_vector f,
const decision_vector x 
) const

Computes the original fitness.

Computes the original fitness of the multi-objective problem. It also updates the ideal point in case m_adapt_ideal is true

Parameters
[out]fnon-decomposed fitness vector
[in]xchromosome

Definition at line 151 of file decompose.cpp.

std::string pagmo::problem::decompose::get_name ( ) const
virtual

Get problem's name.

Default implementation will return the problem's mangled C++ name.

Returns
name of the problem.

Reimplemented from pagmo::problem::base.

Definition at line 221 of file decompose.cpp.

const std::vector< double > & pagmo::problem::decompose::get_weights ( ) const

Get the weights vector

Returns
the weight vector

Definition at line 256 of file decompose.cpp.

std::string pagmo::problem::decompose::human_readable_extra ( ) const
protectedvirtual

Extra information in human readable format.

Default implementation returns an empty string.

Returns
std::string containing additional problem-specific human-readable representation of the problem.

Reimplemented from pagmo::problem::base.

Definition at line 226 of file decompose.cpp.


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