def closest_feasible(individual):
 feasible_ind = numpy.array(individual)
 feasible_ind = numpy.maximum(MIN_BOUND, feasible_ind)
 feasible_ind = numpy.minimum(MAX_BOUND, feasible_ind)
 return feasible_ind

def closest_feasible ( individual ) : feasible_ind = numpy . array ( individual ) feasible_ind = numpy . maximum ( MIN_BOUND , feasible_ind ) feasible_ind = numpy . minimum ( MAX_BOUND , feasible_ind ) return feasible_ind
a function returning a valid individual from an invalid one .