PaGMO  1.1.5
Public Member Functions | Static Public Member Functions | Friends
pagmo::util::hypervolume Class Reference

Hypervolume class. More...

#include <hypervolume.h>

Public Member Functions

 hypervolume ()
 Default constructor. More...
 
 hypervolume (const hypervolume &)
 Copy constructor. More...
 
 hypervolume (const boost::shared_ptr< population >, const bool verify=true)
 Constructor from population. More...
 
 hypervolume (const std::vector< fitness_vector > &, const bool verify=true)
 Constructor from a vector of points. More...
 
double compute (const fitness_vector &, const hv_algorithm::base_ptr) const
 Compute hypervolume. More...
 
double compute (const fitness_vector &) const
 Compute hypervolume. More...
 
double exclusive (const unsigned int, const fitness_vector &, const hv_algorithm::base_ptr) const
 Compute exclusive contribution. More...
 
double exclusive (const unsigned int, const fitness_vector &) const
 Compute exclusive contribution. More...
 
unsigned int least_contributor (const fitness_vector &, const hv_algorithm::base_ptr) const
 Find the least contributing individual. More...
 
unsigned int least_contributor (const fitness_vector &) const
 Find the least contributing individual. More...
 
unsigned int greatest_contributor (const fitness_vector &, const hv_algorithm::base_ptr) const
 Find the most contributing individual. More...
 
unsigned int greatest_contributor (const fitness_vector &) const
 Find the most contributing individual. More...
 
std::vector< double > contributions (const fitness_vector &, const hv_algorithm::base_ptr) const
 Contributions method. More...
 
std::vector< double > contributions (const fitness_vector &) const
 Contributions method. More...
 
void set_copy_points (const bool)
 Setter for 'copy_points' flag. More...
 
bool get_copy_points ()
 Getter for 'copy_points' flag.
 
void set_verify (const bool)
 Setter for the 'verify' flag. More...
 
bool get_verify ()
 Getter for the 'verify' flag.
 
fitness_vector get_nadir_point (const double epsilon=0.0) const
 Calculate the nadir point. More...
 
hypervolume_ptr clone () const
 Clone method. More...
 
const std::vector< fitness_vectorget_points () const
 Get points. More...
 

Static Public Member Functions

static double get_expected_operations (const unsigned int n, const unsigned int d)
 Get expected numer of operations. More...
 

Friends

class boost::serialization::access
 

Detailed Description

Hypervolume class.

This class allows for setting up, and solving the hypervolume computation problems. Construction of the problem is either done using the population object, or from a fixed set of points.

Author
Krzysztof Nowak (kn@ki.nosp@m.ryx..nosp@m.net)

Definition at line 49 of file hypervolume.h.

Constructor & Destructor Documentation

pagmo::util::hypervolume::hypervolume ( )

Default constructor.

Initiates hypervolume with empty set of points. Used for serialization purposes.

Definition at line 84 of file hypervolume.cpp.

pagmo::util::hypervolume::hypervolume ( const hypervolume hv)

Copy constructor.

Will perform a deep copy of hypervolume object

Parameters
[in]hvhypervolume object to be copied

Definition at line 77 of file hypervolume.cpp.

pagmo::util::hypervolume::hypervolume ( const boost::shared_ptr< population pop,
const bool  verify = true 
)

Constructor from population.

Constructs a hypervolume object, where points are elicited from the referenced population object.

Parameters
[in]popreference to population object from which Pareto front is computed
[in]verifyflag stating whether the points should be verified after the construction. This turns off the validation for the further computation as well, use 'set_verify' flag to alter it later.

Definition at line 45 of file hypervolume.cpp.

pagmo::util::hypervolume::hypervolume ( const std::vector< fitness_vector > &  points,
const bool  verify = true 
)

Constructor from a vector of points.

Constructs a hypervolume object from a provided set of points.

Parameters
[in]pointsvector of points for which the hypervolume is computed
[in]verifyflag stating whether the points should be verified after the construction. This turns off the validation for the further computation as well, use 'set_verify' flag to alter it later.

Definition at line 64 of file hypervolume.cpp.

Member Function Documentation

hypervolume_ptr pagmo::util::hypervolume::clone ( ) const

Clone method.

Returns a clone of the object instance.

Returns
shared pointer to hypervolume class instance.

Definition at line 481 of file hypervolume.cpp.

double pagmo::util::hypervolume::compute ( const fitness_vector r_point,
const hv_algorithm::base_ptr  hv_algorithm 
) const

Compute hypervolume.

Computes hypervolume for given reference point, using given algorithm object.

Parameters
[in]r_pointfitness vector describing the reference point
[in]hv_algorithminstance of the algorithm object used for the computation
Returns
value representing the hypervolume

Definition at line 219 of file hypervolume.cpp.

double pagmo::util::hypervolume::compute ( const fitness_vector r_point) const

Compute hypervolume.

Computes hypervolume for given reference point. This method chooses the hv_algorithm dynamically.

Parameters
[in]r_pointfitness vector describing the reference point
Returns
value representing the hypervolume

Definition at line 243 of file hypervolume.cpp.

std::vector< double > pagmo::util::hypervolume::contributions ( const fitness_vector r_point,
const hv_algorithm::base_ptr  hv_algorithm 
) const

Contributions method.

This method returns the exclusive contribution to the hypervolume by every point. The concrete algorithm can implement this feature optimally (as opposed to calling for the exclusive contributor in a loop).

Parameters
[in]r_pointfitness vector describing the reference point
[in]hv_algorithminstance of the algorithm object used for the computation
Returns
vector of exclusive contributions by every point

Definition at line 383 of file hypervolume.cpp.

std::vector< double > pagmo::util::hypervolume::contributions ( const fitness_vector r_point) const

Contributions method.

This method returns the exclusive contribution to the hypervolume by every point. The concrete algorithm can implement this feature optimally (as opposed to calling for the exclusive contributor in a loop). The hv_algorithm itself is chosen dynamically, so the best performing method is employed for given task.

Parameters
[in]r_pointfitness vector describing the reference point
Returns
vector of exclusive contributions by every point

Definition at line 414 of file hypervolume.cpp.

double pagmo::util::hypervolume::exclusive ( const unsigned int  p_idx,
const fitness_vector r_point,
const hv_algorithm::base_ptr  hv_algorithm 
) const

Compute exclusive contribution.

Computes exclusive hypervolume for given indivdual.

Parameters
[in]p_idxindex of the individual for whom we compute the exclusive contribution to the hypervolume
[in]r_pointfitness vector describing the reference point
[in]hv_algorithminstance of the algorithm object used for the computation
Returns
value representing the hypervolume

Definition at line 258 of file hypervolume.cpp.

double pagmo::util::hypervolume::exclusive ( const unsigned int  p_idx,
const fitness_vector r_point 
) const

Compute exclusive contribution.

Computes exclusive hypervolume for given indivdual. This methods chooses the hv_algorithm dynamically.

Parameters
[in]p_idxindex of the individual for whom we compute the exclusive contribution to the hypervolume
[in]r_pointfitness vector describing the reference point
Returns
value representing the hypervolume

Definition at line 288 of file hypervolume.cpp.

double pagmo::util::hypervolume::get_expected_operations ( const unsigned int  n,
const unsigned int  d 
)
static

Get expected numer of operations.

Returns the expected average amount of elementary operations for given front size (n) and dimension size (d). This method is used by the approximated algorithms that fall back to exact computation.

Parameters
[in]nsize of the front
[in]ddimension size
Returns
expected number of operations for given n and d

Definition at line 429 of file hypervolume.cpp.

fitness_vector pagmo::util::hypervolume::get_nadir_point ( const double  epsilon = 0.0) const

Calculate the nadir point.

Calculates the nadir point, used as the reference point

Parameters
[in]epsilonvalue that is to be added to each objective to assure strict domination nadir point by each other point in a set
Returns
value representing the hypervolume

Definition at line 448 of file hypervolume.cpp.

const std::vector< fitness_vector > pagmo::util::hypervolume::get_points ( ) const

Get points.

Will return a vector containing the points as they were set up during construction of the hypervolume object.

Returns
const reference to the vector containing the fitness_vectors representing the points in the hyperspace.

Definition at line 470 of file hypervolume.cpp.

unsigned int pagmo::util::hypervolume::greatest_contributor ( const fitness_vector r_point,
const hv_algorithm::base_ptr  hv_algorithm 
) const

Find the most contributing individual.

Establish the individual contributing the most to the total hypervolume.

Parameters
[in]r_pointfitness vector describing the reference point
[in]hv_algorithminstance of the algorithm object used for the computation
Returns
index of the most contributing point

Definition at line 345 of file hypervolume.cpp.

unsigned int pagmo::util::hypervolume::greatest_contributor ( const fitness_vector r_point) const

Find the most contributing individual.

Establish the individual contributing the most to the total hypervolume. This method chooses the best performing hv_algorithm dynamically

Parameters
[in]r_pointfitness vector describing the reference point
Returns
index of the most contributing point

Definition at line 369 of file hypervolume.cpp.

unsigned int pagmo::util::hypervolume::least_contributor ( const fitness_vector r_point,
const hv_algorithm::base_ptr  hv_algorithm 
) const

Find the least contributing individual.

Establishes the individual contributing the least to the total hypervolume.

Parameters
[in]r_pointfitness vector describing the reference point
[in]hv_algorithminstance of the algorithm object used for the computation
Returns
index of the least contributing point

Definition at line 302 of file hypervolume.cpp.

unsigned int pagmo::util::hypervolume::least_contributor ( const fitness_vector r_point) const

Find the least contributing individual.

Establishes the individual contributing the least to the total hypervolume. This method chooses the best performing hv_algorithm dynamically

Parameters
[in]r_pointfitness vector describing the reference point
Returns
index of the least contributing point

Definition at line 331 of file hypervolume.cpp.

void pagmo::util::hypervolume::set_copy_points ( const bool  copy_points)

Setter for 'copy_points' flag.

Sets the hypervolume as a single use object. It is used in cases where we are certain that we can alter the original set of points from the hypervolume object. This is useful when we don't want to make a copy of the points first, as most algorithms alter the original set.

This may result in unexpected behaviour when used incorrectly (e.g. requesting the computation twice out of the same object)

Parameters
[in]copy_pointsboolean value stating whether the hypervolume computation may use original set

Definition at line 99 of file hypervolume.cpp.

void pagmo::util::hypervolume::set_verify ( const bool  verify)

Setter for the 'verify' flag.

Turns off the verification phase. By default, the hypervolume object verifies whether certain characteristics of the point set hold, such as valid dimension sizes or a reference point that suits the minimisation. In order to optimize the computation when the rules above are certain, we can turn off that phase.

This may result in unexpected behaviour when used incorrectly (e.g. requesting the computation of empty set of points)

Parameters
[in]verifyboolean value stating whether the hypervolume computation is to be executed without verification

Definition at line 120 of file hypervolume.cpp.


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