class documentation

Class CMOArchive provides additional functionality for constrained multi-objective optimization to the MOArchive classes, while keeping the same interface.

Method __init__ Initialize a CMOArchive object.
Method __iter__ Return an iterator over the objective vectors in the archive.
Method __len__ Return the number of objective vectors in the archive.
Method add Add the objective vector f_vals with corresponding constraints to the archive if it is feasible. If no feasible solution was found yet, also update the indicator.
Method add_list Add a list of objective vectors f_vals with corresponding constraints vectors g_vals and infos to the archive.
Method compute_hypervolume Compute the hypervolume of the archive.
Method contributing_hypervolume Compute the hypervolume contribution of the objective vector f_vals to the archive.
Method copy Return a deep copy of the CMOArchive object.
Method distance_to_hypervolume_area Compute the distance of the objective vector f_vals to the hypervolume area.
Method distance_to_pareto_front Compute the distance of the objective vector f_vals to the Pareto front.
Method dominates Returns True if the objective vector f_vals is dominated by any of the points in the archive.
Method dominators Returns a list of points in the archive that dominate the objective vector f_vals. If number_only is True, only the number of dominators is returned.
Method hypervolume_improvement Compute the hypervolume improvement of the archive if the objective vector f_vals is added.
Method hypervolume_plus_constr_improvement Compute the improvement of the indicator if the objective vector f_vals is added.
Method in_domain Returns True if the objective vector f_vals dominates the reference point.
Method remove Remove a feasible point with objective vector f_vals from the archive.
Instance Variable archive Undocumented
Instance Variable n_obj Undocumented
Instance Variable tau Undocumented
Property contributing_hypervolumes Return the hypervolume contributions of each point in the archive.
Property hypervolume Return the hypervolume indicator.
Property hypervolume_plus Return the hypervolume_plus indicator.
Property hypervolume_plus_constr Return the hypervolume_plus_constr (icmop) indicator.
Property infos Return the list of additional information for each point in the archive.
Instance Variable _hypervolume_plus_constr Undocumented
def __init__(self, list_of_f_vals=None, list_of_g_vals=None, reference_point=None, infos=None, n_obj=None, tau=1, hypervolume_final_float_type=None, hypervolume_computation_float_type=None):

Initialize a CMOArchive object.

Additionally to the list of objective values list_of_f_vals, also list of constraint vectors list_of_g_vals should be provided. The reference point is used for the hypervolume computation and pruning of the archive. The list of additional information infos can be used to store additional information for each objective vector. Tau is a threshold that is used for computing the indicator.

def __iter__(self):

Return an iterator over the objective vectors in the archive.

def __len__(self):

Return the number of objective vectors in the archive.

def add(self, f_vals, g_vals, info=None):

Add the objective vector f_vals with corresponding constraints to the archive if it is feasible. If no feasible solution was found yet, also update the indicator.

>>> from moarchiving.get_archive import get_cmo_archive
>>> moa = get_cmo_archive(reference_point=[5, 5], tau=10)
>>> moa.add([4, 4], 0)
>>> list(moa)
[[4, 4]]
>>> moa.add([3, 4], 1)
>>> list(moa)
[[4, 4]]
>>> moa.add([2, 2], 0)
>>> list(moa)
[[2, 2]]
def add_list(self, list_of_f_vals, list_of_g_vals, infos=None):

Add a list of objective vectors f_vals with corresponding constraints vectors g_vals and infos to the archive.

>>> from moarchiving.get_archive import get_cmo_archive
>>> moa = get_cmo_archive(reference_point=[5, 5], tau=10)
>>> moa.add_list([[4, 4], [3, 3], [2, 2]], [0, 1, 0])
>>> list(moa)
[[2, 2]]
>>> moa.add_list([[1, 6], [1, 3], [3, 0]], [[0], [0], [10]])
>>> list(moa)
[[1, 3], [2, 2]]
def compute_hypervolume(self, reference_point=None):

Compute the hypervolume of the archive.

def contributing_hypervolume(self, f_vals):

Compute the hypervolume contribution of the objective vector f_vals to the archive.

def copy(self):

Return a deep copy of the CMOArchive object.

def distance_to_hypervolume_area(self, f_vals):

Compute the distance of the objective vector f_vals to the hypervolume area.

def distance_to_pareto_front(self, f_vals, ref_factor=1):

Compute the distance of the objective vector f_vals to the Pareto front.

def dominates(self, f_vals):

Returns True if the objective vector f_vals is dominated by any of the points in the archive.

def dominators(self, f_vals, number_only=False):

Returns a list of points in the archive that dominate the objective vector f_vals. If number_only is True, only the number of dominators is returned.

def hypervolume_improvement(self, f_vals):

Compute the hypervolume improvement of the archive if the objective vector f_vals is added.

def hypervolume_plus_constr_improvement(self, f_vals, g_vals):

Compute the improvement of the indicator if the objective vector f_vals is added.

>>> from moarchiving.get_archive import get_cmo_archive
>>> get_cmo_archive.hypervolume_final_float_type = float
>>> moa = get_cmo_archive(reference_point=[5, 5], tau=4) # hv+c = -inf
>>> moa.hypervolume_plus_constr_improvement([1, 1], 10)
inf
>>> moa.add([1, 1], 10) # hv+c = -14
>>> int(moa.hypervolume_plus_constr_improvement([2, 2], 4))
6
>>> moa.add([2, 2], 4) # hv+c = -8
>>> int(moa.hypervolume_plus_constr_improvement([8, 9], 0))
4
>>> moa.add([8, 9], 0) # hv+c = -4
>>> int(moa.hypervolume_plus_constr_improvement([8, 5], 0))
1
>>> moa.add([8, 5], 0) # hv+c = -3
>>> int(moa.hypervolume_plus_constr_improvement([0, 0], 1))
0
>>> moa.add([0, 0], 1) # hv+c = -3
>>> int(moa.hypervolume_plus_constr_improvement([4, 4], 0))
4
>>> moa.add([4, 4], 0) # hv+c = 1
>>> int(moa.hypervolume_plus_constr_improvement([3, 3], 0))
3
def in_domain(self, f_vals, reference_point=None):

Returns True if the objective vector f_vals dominates the reference point.

def remove(self, f_vals):

Remove a feasible point with objective vector f_vals from the archive.

>>> from moarchiving.get_archive import get_cmo_archive
>>> moa = get_cmo_archive([[2, 3], [1, 4], [4, 1]], [0, 0, 0], reference_point=[5, 5])
>>> list(moa)
[[1, 4], [2, 3], [4, 1]]
>>> moa.remove([2, 3])
>>> list(moa)
[[1, 4], [4, 1]]
archive =

Undocumented

n_obj =

Undocumented

tau =

Undocumented

@property
contributing_hypervolumes =

Return the hypervolume contributions of each point in the archive.

@property
hypervolume =

Return the hypervolume indicator.

@property
hypervolume_plus =

Return the hypervolume_plus indicator.

@property
hypervolume_plus_constr =

Return the hypervolume_plus_constr (icmop) indicator.

@property
infos =

Return the list of additional information for each point in the archive.

_hypervolume_plus_constr =

Undocumented