class MOArchiveParent:
Known subclasses: moarchiving.moarchiving3obj.MOArchive3obj
, moarchiving.moarchiving4obj.MOArchive4obj
Constructor: MOArchiveParent(list_of_f_vals, reference_point, infos, n_obj, ...)
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 |
Undocumented |
Method | compute |
Undocumented |
Method | contributing |
Return the hypervolume contribution of a point in the archive |
Method | copy |
Undocumented |
Method | distance |
Return the distance to the hypervolume area of the archive |
Method | distance |
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 |
Undocumented |
Method | in |
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 |
Undocumented |
Instance Variable | hypervolume |
Undocumented |
Instance Variable | n |
Undocumented |
Instance Variable | reference |
Undocumented |
Property | contributing |
list of hypervolume contributions of each point in the archive |
Property | hypervolume |
Return the hypervolume of the archive |
Property | hypervolume |
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 |
Undocumented |
Method | _points |
returns the points in the archive in a form of a python generator instead of a circular doubly linked list |
Method | _set_ |
Set the hypervolume of the archive |
Instance Variable | _hypervolume |
Undocumented |
Instance Variable | _hypervolume |
Undocumented |
Instance Variable | _kink |
Undocumented |
Instance Variable | _length |
Undocumented |
Create a new archive object.
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
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
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
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
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
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
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']
returns the points in the archive in a form of a python generator instead of a circular doubly linked list