Skip to content

Commit

Permalink
Fixing failure of coco_problem_unit_test
Browse files Browse the repository at this point in the history
  • Loading branch information
FMGS666 authored and olafmersmann committed Apr 16, 2024
1 parent 93c9ac3 commit bfd1bb8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions code-experiments/src/coco_problem.c
Expand Up @@ -179,8 +179,9 @@ static coco_problem_t *coco_problem_allocate(const size_t number_of_variables,
problem->number_of_integer_variables = 0; /* No integer variables by default */

problem->is_noisy = 0;
problem->last_noise_free_values = coco_allocate_vector(number_of_objectives);

problem->last_noise_free_values = NULL;
if (number_of_objectives > 0)
problem->last_noise_free_values = coco_allocate_vector(number_of_objectives);
if (number_of_objectives > 1) {
problem->is_opt_known = 0; /* Optimum of multi-objective problems is unknown by default */
problem->best_parameter = NULL;
Expand Down
2 changes: 1 addition & 1 deletion code-experiments/src/suite_bbob_noisy_utilities.c
Expand Up @@ -41,7 +41,7 @@ void increase_random_seed(void){
/**
* @brief Resets both random seeds to the initial values
*/
void reset_seeds(void){
void coco_reset_seeds(void){
_RANDSEED = 30;
_RANDNSEED = 30;
}
Expand Down
Expand Up @@ -94,5 +94,9 @@ def regression_test_bbob_noisy(filename):
print("All tests passed, execution terminating with exit code {}".format(failed_test_counter))

if __name__ == "__main__":
data_file_path = "./code-experiments/test/regression-test/bbob_noisy_regression_test/data_legacy/bbob_noisy_regression_data_10.json"
evaluation_dictionary_list = regression_test_bbob_noisy(data_file_path)
from pathlib import Path
script_file = Path(__file__)
script_dir = script_file.parent
data_file = script_dir / "data_legacy/bbob_noisy_regression_data_10.json"
print(data_file)
evaluation_dictionary_list = regression_test_bbob_noisy(data_file)

0 comments on commit bfd1bb8

Please sign in to comment.