def hypervolume(front, **kargs):
 wobj = (numpy.array([ind.fitness.wvalues for ind in front]) * (-1))
 ref = kargs.get('ref', None)
 if (ref is None):
  ref = (numpy.max(wobj, axis=0) + 1)
 def contribution(i):
  return hv.hypervolume(numpy.concatenate((wobj[:i], wobj[(i + 1):])), ref)
 contrib_values = map(contribution, range(len(front)))
 return numpy.argmax(contrib_values)

def hypervolume ( front , ** kargs ) : wobj = ( numpy . array ( [ ind . fitness . wvalues for ind in front ] ) * ( - 1 ) ) ref = kargs . get ( 'ref' , None ) if ( ref is None ) : ref = ( numpy . max ( wobj , axis = 0 ) + 1 ) def contribution ( i ) : return hv . hypervolume ( numpy . concatenate ( ( wobj [ : i ] , wobj [ ( i + 1 ) : ] ) ) , ref ) contrib_values = map ( contribution , range ( len ( front ) ) ) return numpy . argmax ( contrib_values )
return the hypervolume of a *front* .