Пример #1
0
def recalculate_fitnesses(ospace, objectives):
    ospace_sqdist = spea2._squared_distances(ospace)
    return np.asarray(
        [spea2._raw_strength_2(ospace, i) + spea2._density_estimator(ospace_sqdist, i) for i in range(len(ospace))]
    )
Пример #2
0
def recalculate_fitnesses(data, objectives):
    ospace_sqdist = spea2._squared_distances(data[:,-(1 + objectives):-1])
    data[:,-1] = np.asarray([spea2._raw_strength_2(data[:,-(1 + objectives):-1], i)
               + spea2._density_estimator(ospace_sqdist, i)
               for i in range(len(data))])