var_names = ["x" + str(i + 1) for i in range(n_var)] obj_names = ["f" + str(i + 1) for i in range(n_obj)] prob = wfg_problem( name=problem_name, n_of_objectives=n_obj, n_of_variables=n_var ) variables = variable_builder( names=var_names, initial_values=prob.lower, lower_bounds=prob.lower, upper_bounds=prob.upper, ) objective = VectorObjective(name=obj_names, evaluator=prob.eval) problem = MOProblem([objective], variables, None) problem.ideal = prob.ideal problem.nadir = ( abs(np.random.normal(size=n_obj, scale=0.15)) + 1 ) * prob.nadir true_nadir = prob.nadir scalar = asf(ideal=problem.ideal, nadir=true_nadir) # a posteriori a_post_rvea = RVEA( problem=problem, interact=False, n_gen_per_iter=gen, n_iterations=4 ) a_post_nsga = NSGAIII( problem=problem, interact=False, n_gen_per_iter=gen, n_iterations=4 ) # interactive int_rvea = RVEA(problem=problem, interact=True, n_gen_per_iter=gen)
# name of constraints, num variables, num objectives, evaluator c1 = ScalarConstraint("c1", len(varsl), len(objl), evaluator=c_1) problem = MOProblem(variables=varsl, objectives=objl, constraints=[c1]) max_bool = list( map(lambda x: True if x < 0 else False, problem._max_multiplier)) max_multiplier = problem._max_multiplier # define ideal and nadir ideal = max_multiplier * np.array([-15, 15, 15]) nadir = max_multiplier * np.array([15, -15, -15]) problem.ideal = ideal problem.nadir = nadir # GLOBAL global method method = NIMBUS(problem, scalar_method="scipy_de") ideal = method._ideal nadir = method._nadir # GLOBAL global plotter idealnadir = np.stack((ideal, nadir)) scaler = MinMaxScaler((-1, 1)) scaler.fit(idealnadir) plotter = Plotter(method._nadir, method._ideal, scaler, max_bool)