File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed
Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change 11import random
2+ import warnings
23from copy import deepcopy
34from itertools import chain
45
@@ -414,16 +415,20 @@ def ind_stats_with_cv(ind):
414415
415416def pop_hv (algorithm = None ):
416417 def func (fitness_values ):
417- hv = pygmo .hypervolume (fitness_values )
418- ref_point = hv .refpoint (offset = 1 )
419- # https://esa.github.io/pygmo/tutorials/advanced_hypervolume_computation_and_analysis.html#pushing-efficiency-further
420- hv .copy_points = False
421- # hv.set_verify(False)
422-
423- if algorithm :
424- return hv .compute (ref_point , hv_algo = algorithm )
425- else :
426- return hv .compute (ref_point )
418+ try :
419+ hv = pygmo .hypervolume (fitness_values )
420+ ref_point = hv .refpoint (offset = 1 )
421+ # https://esa.github.io/pygmo/tutorials/advanced_hypervolume_computation_and_analysis.html#pushing-efficiency-further
422+ hv .copy_points = False
423+ # hv.set_verify(False)
424+
425+ if algorithm :
426+ return hv .compute (ref_point , hv_algo = algorithm )
427+ else :
428+ return hv .compute (ref_point )
429+ except Exception as exc :
430+ warnings .warn (f"Error computing hypervolume: { exc } " )
431+ return np .nan
427432
428433 return func
429434
You can’t perform that action at this time.
0 commit comments