Skip to content

Commit

Permalink
Count evaluations when using .rank() or rank_indices().
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri Rusin committed Feb 14, 2024
1 parent f93c172 commit 4dae31f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/ioh/problem/dynamic_bin_val/dynamic_bin_val_ranking.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ namespace ioh::problem

std::sort(sorted_bitstrings.begin(), sorted_bitstrings.end(), comparator);

// This is to update the evaluations count and best solution seen so far.
for (auto& bitstring : bitstrings) {
(*this)(bitstring);
}

return sorted_bitstrings;
}

Expand Down Expand Up @@ -144,6 +149,11 @@ namespace ioh::problem
// Sort the indices based on the comparator
std::sort(indices.begin(), indices.end(), comparator);

// This is to update the evaluations count and best solution seen so far.
for (auto& bitstring : bitstrings) {
(*this)(bitstring);
}

return indices;
}

Expand Down

0 comments on commit 4dae31f

Please sign in to comment.