class CMOArchive:
Constructor: CMOArchive(list_of_f_vals, list_of_g_vals, reference_point, infos, ...)
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 |
Add a list of objective vectors f_vals with corresponding constraints vectors g_vals and infos to the archive. |
Method | compute |
Compute the hypervolume of the archive. |
Method | contributing |
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 |
Compute the distance of the objective vector f_vals to the hypervolume area. |
Method | distance |
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 |
Compute the hypervolume improvement of the archive if the objective vector f_vals is added. |
Method | hypervolume |
Compute the improvement of the indicator if the objective vector f_vals is added. |
Method | in |
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 |
Undocumented |
Instance Variable | tau |
Undocumented |
Property | contributing |
Return the hypervolume contributions of each point in the archive. |
Property | hypervolume |
Return the hypervolume indicator. |
Property | hypervolume |
Return the hypervolume_plus indicator. |
Property | hypervolume |
Return the hypervolume_plus_constr (icmop) indicator. |
Property | infos |
Return the list of additional information for each point in the archive. |
Instance Variable | _hypervolume |
Undocumented |
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.
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]]
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]]
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.
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
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]]