class documentation

Parent class for Moarchiving 3 and 4 objective classes, to avoid code duplication

Method __init__ Create a new archive object.
Method __iter__ Undocumented
Method __len__ Undocumented
Method add Undocumented
Method add_list Undocumented
Method compute_hypervolume Undocumented
Method contributing_hypervolume Return the hypervolume contribution of a point in the archive
Method copy Undocumented
Method distance_to_hypervolume_area Return the distance to the hypervolume area of the archive
Method distance_to_pareto_front Return the distance to the Pareto front of the archive, by calculating the distances to the kink points
Method dominates return True if any element of points dominates or is equal to f_val. Otherwise return False.
Method dominators return the list of all f_val-dominating elements in self, including an equal element. len(....dominators(...)) is hence the number of dominating elements which can also be obtained without creating the list with ...
Method hypervolume_improvement Undocumented
Method in_domain return True if f_vals is dominating the reference point, False otherwise. True means that f_vals contributes to the hypervolume if not dominated by other elements.
Method remove Undocumented
Instance Variable head Undocumented
Instance Variable hypervolume_computation_float_type Undocumented
Instance Variable hypervolume_final_float_type Undocumented
Instance Variable n_obj Undocumented
Instance Variable reference_point Undocumented
Property contributing_hypervolumes list of hypervolume contributions of each point in the archive
Property hypervolume Return the hypervolume of the archive
Property hypervolume_plus Return the hypervolume_plus of the archive
Property infos list of complementary information corresponding to each archive entry, corresponding to each of the points in the archive
Method _get_kink_points Undocumented
Method _points_generator returns the points in the archive in a form of a python generator instead of a circular doubly linked list
Method _set_HV Set the hypervolume of the archive
Instance Variable _hypervolume Undocumented
Instance Variable _hypervolume_plus Undocumented
Instance Variable _kink_points Undocumented
Instance Variable _length Undocumented
def __init__(self, list_of_f_vals=None, reference_point=None, infos=None, n_obj=None, hypervolume_final_float_type=None, hypervolume_computation_float_type=None):
def __iter__(self):

Undocumented

def __len__(self):

Undocumented

def add(self, new, info=None, update_hypervolume=True):
def add_list(self, list_of_f_vals, infos=None):
def compute_hypervolume(self):
def contributing_hypervolume(self, f_vals):

Return the hypervolume contribution of a point in the archive

>>> from moarchiving.get_archive import get_mo_archive
>>> get_mo_archive.hypervolume_final_float_type = float
>>> moa = get_mo_archive([[1, 2, 3], [3, 2, 1], [2, 3, 2]], reference_point=[4, 4, 4])
>>> moa.contributing_hypervolume([1, 2, 3])
3.0
>>> moa.contributing_hypervolume([3, 2, 1])
3.0
>>> moa.contributing_hypervolume([2, 3, 2])
1.0
def distance_to_hypervolume_area(self, f_vals):

Return the distance to the hypervolume area of the archive

>>> from moarchiving.get_archive import get_mo_archive
>>> moa = get_mo_archive(reference_point=[1, 1, 1])
>>> moa.distance_to_hypervolume_area([1, 2, 1])
1.0
>>> moa.distance_to_hypervolume_area([1, 1, 1])
0.0
>>> moa.distance_to_hypervolume_area([0, 0, 0])
0.0
>>> moa.distance_to_hypervolume_area([4, 5, 1])
5.0
def distance_to_pareto_front(self, f_vals, ref_factor=1):

Return the distance to the Pareto front of the archive, by calculating the distances to the kink points

>>> from moarchiving.get_archive import get_mo_archive
>>> moa = get_mo_archive([[1, 2, 3], [3, 2, 1], [2, 2, 2]], reference_point=[5, 5, 5])
>>> moa.distance_to_pareto_front([1, 2, 3])
0.0
>>> moa.distance_to_pareto_front([3, 2, 3])
0.0
>>> moa.distance_to_pareto_front([3, 3, 3])
1.0
def dominates(self, f_val):

return True if any element of points dominates or is equal to f_val. Otherwise return False.

>>> from moarchiving.get_archive import get_mo_archive
>>> archive = get_mo_archive([[1, 2, 3], [3, 2, 1]])
>>> archive.dominates([2, 2, 2])
False
>>> archive.dominates([1, 2, 3])
True
>>> archive.dominates([3, 3, 3])
True
def dominators(self, f_val, number_only=False):

return the list of all f_val-dominating elements in self, including an equal element. len(....dominators(...)) is hence the number of dominating elements which can also be obtained without creating the list with number_only=True.

>>> from moarchiving.get_archive import get_mo_archive
>>> archive = get_mo_archive([[1, 2, 3], [3, 2, 1], [2, 2, 2], [3, 0, 3]])
>>> archive.dominators([1, 1, 1])
[]
>>> archive.dominators([3, 3, 3])
[[3, 2, 1], [2, 2, 2], [3, 0, 3], [1, 2, 3]]
>>> archive.dominators([2, 3, 4])
[[2, 2, 2], [1, 2, 3]]
>>> archive.dominators([3, 3, 3], number_only=True)
4
def hypervolume_improvement(self, f_vals):
def in_domain(self, f_vals, reference_point=None):

return True if f_vals is dominating the reference point, False otherwise. True means that f_vals contributes to the hypervolume if not dominated by other elements.

>>> from moarchiving.get_archive import get_mo_archive
>>> archive3obj = get_mo_archive(reference_point=[3, 3, 3])
>>> archive3obj.in_domain([2, 2, 2])
True
>>> archive3obj.in_domain([0, 0, 3])
False
>>> archive4obj = get_mo_archive(reference_point=[3, 3, 3, 3])
>>> archive4obj.in_domain([2, 2, 2, 2])
True
>>> archive4obj.in_domain([0, 0, 0, 3])
False
head =

Undocumented

hypervolume_computation_float_type =

Undocumented

hypervolume_final_float_type =

Undocumented

n_obj =

Undocumented

reference_point =

Undocumented

@property
contributing_hypervolumes =

list of hypervolume contributions of each point in the archive

@property
hypervolume =

Return the hypervolume of the archive

@property
hypervolume_plus =

Return the hypervolume_plus of the archive

@property
infos =

list of complementary information corresponding to each archive entry, corresponding to each of the points in the archive

>>> from moarchiving.get_archive import get_mo_archive
>>> moa = get_mo_archive([[1, 2, 3], [3, 2, 1], [2, 2, 2]], infos=["a", "b", "c"])
>>> moa.infos
['b', 'c', 'a']
def _points_generator(self, include_head=False):

returns the points in the archive in a form of a python generator instead of a circular doubly linked list

def _set_HV(self):

Set the hypervolume of the archive

_hypervolume =

Undocumented

_kink_points =

Undocumented