From c84eb84eb9d81381fde1607cb33cd4173e822630 Mon Sep 17 00:00:00 2001 From: jacobdenobel Date: Fri, 28 Jun 2024 14:04:30 +0200 Subject: [PATCH] hotfix for bug introduced by dynamicbinval --- VERSION | 2 +- include/ioh/common/random.hpp | 2 +- include/ioh/problem/structures.hpp | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index ec96a621..e5a9958c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.16 +0.3.17 diff --git a/include/ioh/common/random.hpp b/include/ioh/common/random.hpp index 1f6a7b8d..94437469 100644 --- a/include/ioh/common/random.hpp +++ b/include/ioh/common/random.hpp @@ -283,7 +283,7 @@ namespace ioh::common::random inline std::vector normal(const size_t n, const unsigned long seed, const double lb = 0, const double ub = 1) { assert(2 * n < 6000); - const auto uniform_random = uniform(2 * n, static_cast(seed)); + const auto uniform_random = uniform(2 * n, seed); std::vector x(n); diff --git a/include/ioh/problem/structures.hpp b/include/ioh/problem/structures.hpp index 04bf15b8..4ccd3653 100644 --- a/include/ioh/problem/structures.hpp +++ b/include/ioh/problem/structures.hpp @@ -256,13 +256,16 @@ namespace ioh ++evaluations; const bool has_internal_improved = meta_data.optimization_type(current_internal.y, current_best_internal.y); - if (has_internal_improved) + has_improved = meta_data.optimization_type(current.y, current_best.y); + + // TODO: Clean this up; dont use the meta data like this + if (meta_data.problem_id >= 10'000 && meta_data.problem_id <= 10'004 && has_internal_improved) { current_best_internal = current_internal; } // This calls the operator() of a class. See: include/ioh/common/optimization_type.hpp:64 - if (meta_data.optimization_type(current.y, current_best.y)) + if (has_improved) { y_unconstrained_best = y_unconstrained; current_best_internal = current_internal; @@ -274,8 +277,6 @@ namespace ioh if (std::abs(objective.y - current.y) < meta_data.final_target) final_target_found = true; } - - has_improved = has_internal_improved; } [[nodiscard]] std::string repr() const override