Skip to content

Commit

Permalink
hotfix for bug introduced by dynamicbinval
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobdenobel committed Jun 28, 2024
1 parent 917d1e2 commit c84eb84
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.16
0.3.17
2 changes: 1 addition & 1 deletion include/ioh/common/random.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ namespace ioh::common::random
inline std::vector<double> 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<int>(seed));
const auto uniform_random = uniform(2 * n, seed);

std::vector<double> x(n);

Expand Down
9 changes: 5 additions & 4 deletions include/ioh/problem/structures.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit c84eb84

Please sign in to comment.