From ef6f05a423b136ec8690e7ad44cd460afbc4c2d1 Mon Sep 17 00:00:00 2001 From: ajnebro Date: Mon, 2 Sep 2024 17:12:43 +0200 Subject: [PATCH] Update file pyproject.toml --- .../nsgaii/nsgaii_solving_mixed_encoding_problem.py | 5 ++++- .../nsgaii_standard_settings_with_real_time_plotting.py | 6 +++--- pyproject.toml | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/examples/multiobjective/nsgaii/nsgaii_solving_mixed_encoding_problem.py b/examples/multiobjective/nsgaii/nsgaii_solving_mixed_encoding_problem.py index 87ccf632..c9b6fdc8 100644 --- a/examples/multiobjective/nsgaii/nsgaii_solving_mixed_encoding_problem.py +++ b/examples/multiobjective/nsgaii/nsgaii_solving_mixed_encoding_problem.py @@ -4,6 +4,7 @@ from jmetal.operator.mutation import CompositeMutation from jmetal.operator.mutation import IntegerPolynomialMutation, PolynomialMutation from jmetal.problem.multiobjective.unconstrained import MixedIntegerFloatProblem +from jmetal.util.observer import VisualizerObserver from jmetal.util.solution import ( get_non_dominated_solutions, print_function_values_to_file, @@ -12,7 +13,7 @@ from jmetal.util.termination_criterion import StoppingByEvaluations if __name__ == "__main__": - problem = MixedIntegerFloatProblem(10, 10, 100, -100, -1000, 1000) + problem = MixedIntegerFloatProblem(60, 20, 100, -100, -1000, 1000) max_evaluations = 25000 algorithm = NSGAII( @@ -29,6 +30,8 @@ termination_criterion=StoppingByEvaluations(max_evaluations=max_evaluations), ) + algorithm.observable.register(observer=VisualizerObserver()) + algorithm.run() front = get_non_dominated_solutions(algorithm.result()) diff --git a/examples/multiobjective/nsgaii/nsgaii_standard_settings_with_real_time_plotting.py b/examples/multiobjective/nsgaii/nsgaii_standard_settings_with_real_time_plotting.py index d2df0aae..869af806 100644 --- a/examples/multiobjective/nsgaii/nsgaii_standard_settings_with_real_time_plotting.py +++ b/examples/multiobjective/nsgaii/nsgaii_standard_settings_with_real_time_plotting.py @@ -17,7 +17,7 @@ if __name__ == "__main__": problem = ZDT1() - problem.reference_front = read_solutions(filename="resources/reference_front/ZDT1.pf") + reference_front = read_solutions(filename="resources/reference_front/ZDT1.pf") max_evaluations = 10000 algorithm = NSGAII( @@ -30,7 +30,7 @@ ) algorithm.observable.register(observer=ProgressBarObserver(max=max_evaluations)) - algorithm.observable.register(observer=VisualizerObserver(reference_front=problem.reference_front)) + algorithm.observable.register(observer=VisualizerObserver(reference_front=reference_front)) algorithm.run() front = algorithm.result() @@ -46,7 +46,7 @@ # Plot interactive front plot_front = InteractivePlot( title="Pareto front approximation. Problem: " + problem.name(), - reference_front=problem.reference_front, + reference_front=reference_front, axis_labels=problem.obj_labels, ) plot_front.plot(front, label=algorithm.label, filename=algorithm.get_name()) diff --git a/pyproject.toml b/pyproject.toml index b440cbbe..73661d75 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,8 +84,8 @@ distributed = [ complete = [ "tqdm", - "numpy>=1.16.0", - "pandas>=0.24.2", + "numpy>=2.0.0", + "pandas>=2.2.0", "plotly>=3.3.0", "matplotlib>=3.0.2", "scipy>=1.3.0",