Hypervolume utilities#
- class pygmo.hypervolume(points)#
Hypervolume Class
Constructor from points
- Parameters
points (2d array-like object) – the points
- Raises
ValueError – if points is inconsistent
Examples
>>> from pygmo import * >>> points = [[1,2],[0.5, 3],[0.1,3.1]] >>> hv = hypervolume(points = points)
See also the docs of the C++ class
pagmo::hypervolume
.__init__(pop)
Constructor from population
- Parameters
pop (
population
) – the input population- Raises
ValueError – if pop contains a single-objective or a constrained problem
Examples
>>> from pygmo import * >>> pop = population(prob = zdt(prob_id = 1), size = 20) >>> hv = hypervolume(pop = pop)
See also the docs of the C++ class
pagmo::hypervolume
.- compute(ref_point, hv_algo=auto)#
Computes the hypervolume with the supplied algorithm. If no algorithm is supplied, then an exact hypervolume algorithm is automatically selected specific for the point dimension.
- Parameters
ref_point (2d array-like object) – the points
hv_algo (deriving from
_hv_algorithm
) – hypervolume algorithm to be used
- Returns
the computed hypervolume assuming ref_point as reference point
- Return type
- Raises
ValueError – if ref_point is not dominated by the nadir point
See also the docs of the C++ class
pagmo::hypervolume::compute()
.
- contributions(ref_point, hv_algo=auto)#
This method returns the exclusive contribution to the hypervolume of every point. According to hv_algo this computation can be implemented optimally (as opposed to calling for
exclusive()
in a loop).- Parameters
ref_point (2d array-like object) – the points
hv_algo (deriving from
_hv_algorithm
) – hypervolume algorithm to be used
- Returns
the contribution of all points to the hypervolume
- Return type
1D NumPy float array
- Raises
ValueError – if ref_point is not suitable
See also the docs of the C++ class
pagmo::hypervolume::contributions()
.
- exclusive(idx, ref_point, hv_algo=auto)#
Computes the exclusive contribution to the hypervolume of a particular point.
- Parameters
idx (
int
) – index of the pointref_point (array-like object) – the reference point
hv_algo (deriving from
_hv_algorithm
) – hypervolume algorithm to be used
- Returns
the contribution of all points to the hypervolume
- Return type
1D NumPy float array
- Raises
ValueError – if ref_point is not suitable or if idx is out of bounds
OverflowError – if idx is negative or greater than an implementation-defined value
See also the docs of the C++ class
pagmo::hypervolume::exclusive()
.
- greatest_contributor(ref_point, hv_algo=auto)#
Computes the point contributing the most to the total hypervolume.
- Parameters
ref_point (array-like object) – the reference point
hv_algo (deriving from
_hv_algorithm
) – hypervolume algorithm to be used
- Raises
ValueError – if ref_point is not suitable
See also the docs of the C++ class
pagmo::hypervolume::greatest_contributor()
.
- least_contributor(ref_point, hv_algo=auto)#
Computes the point contributing the least to the total hypervolume.
- Parameters
ref_point (array-like object) – the reference point
hv_algo (deriving from
_hv_algorithm
) – hypervolume algorithm to be used
- Raises
ValueError – if ref_point is not suitable
See also the docs of the C++ class
pagmo::hypervolume::least_contributor()
.
- refpoint(offset=0)#
Calculates a mock refpoint by taking the maximum in each dimension over all points saved in the hypervolume object. The result is a point that is necessarily dominated by all other points, and thus can be used for hypervolume computations.
This point is different from the one computed by
nadir()
as only the non dominated front is considered in that method (also its complexity is thus higher)- Parameters
offset (
float
) – the reference point- Returns
the reference point
- Return type
1D NumPy float array
See also the docs of the C++ class
pagmo::hypervolume::refpoint()
.
- class pygmo.hvwfg(stop_dimension=2)#
The hypervolume algorithm from the Walking Fish Group (2011 version).
This object can be passed as parameter to the various methods of the class
hypervolume
as it derives from the hidden base class_hv_algorithm
- Parameters
stop_dimension (
int
) – the input population- Raises
OverflowError – if stop_dimension is negative or greater than an implementation-defined value
Examples
>>> import pygmo as pg >>> hv_algo = pg.hvwfg(stop_dimension = 2)
See also the docs of the C++ class
pagmo::hvwfg
.
- class pygmo.hv2d#
Exact hypervolume algorithm for two dimensional points.
This object can be passed as parameter to the various methods of the class
hypervolume
as it derives from the hidden base class_hv_algorithm
Examples
>>> import pygmo as pg >>> hv_algo = pg.hv2d()
See also the docs of the C++ class
pagmo::hv2d
.
- class pygmo.hv3d#
Exact hypervolume algorithm for three dimensional points.
This object can be passed as parameter to the various methods of the class
hypervolume
as it derives from the hidden base class_hv_algorithm
Examples
>>> import pygmo as pg >>> hv_algo = pg.hv3d()
See also the docs of the C++ class
pagmo::hv3d
.
- class pygmo.bf_fpras(eps=1e-2, delta=1e-2, seed=random)#
Bringmann-Friedrich approximation method. Implementation of the Bringmann-Friedrich approximation scheme (FPRAS), reduced to the special case of approximating the hypervolume indicator.
This object can be passed as parameter to the various methods of the class
hypervolume
as it derives from the hidden base class_hv_algorithm
Examples
>>> import pygmo as pg >>> hv_algo = pg.bf_fpras(eps = 1e-2, delta = 1e-2)
See also the docs of the C++ class
pagmo::bf_fpras
.
- class pygmo.bf_approx#
Bringmann-Friedrich approximation method. Implementation of the Bringmann-Friedrich approximation scheme (FPRAS), reduced to the special case of approximating the least contributor.
This object can be passed as parameter to the various methods of the class
hypervolume
as it derives from the hidden base class_hv_algorithm
Examples
>>> import pygmo as pg >>> hv_algo = pg.bf_approx()
See also the docs of the C++ class
pagmo::bf_approx
.