def optimal_solution(self, k, l, pos_params): """Create one Pareto-optimal solution with given position parameters.""" # the result vector result = [] result.extend(pos_params) # set the distance parameters for i in range(k, k + l): result.append(0.35) # scale to the correct domains for i in range(k + l): result[i] *= 2.0 * (i + 1) ind = Individual() ind.phenome = result return ind
def optimal_solution(self, k, l, pos_params): """Create one Pareto-optimal solution with given position parameters.""" result = [] result.extend(pos_params) # calculate the distance parameters for i in range(k, k + l): w = [1.0] * len(result) u = r_sum(result, w) tmp1 = abs(math.floor(0.5 - u) + 0.98 / 49.98) tmp2 = 0.02 + 49.98 * (0.98 / 49.98 - (1.0 - 2.0 * u) * tmp1) result.append(pow(0.35, pow(tmp2, -1.0))) # scale to the correct domains for i in range(k + l): result[i] *= 2.0 * (i + 1) ind = Individual() ind.phenome = result return ind
def optimal_solution(self, k, l, pos_params): """Create one Pareto-optimal solution with given position parameters.""" result = [] result.extend(pos_params) result.extend([0.0] * l) # calculate the distance parameters result[k + l - 1] = 0.35 for i in range(k + l - 2, k - 1, -1): result_sub = [] for j in range(i + 1, k + l): result_sub.append(result[j]) w = [1.0] * len(result_sub) tmp1 = r_sum(result_sub, w) result[i] = pow(0.35, pow(0.02 + 1.96 * tmp1, -1.0)) # scale to the correct domains for i in range(k + l): result[i] *= 2.0 * (i + 1) ind = Individual() ind.phenome = result return ind