Skip to content

Commit

Permalink
Cleaning the code
Browse files Browse the repository at this point in the history
  • Loading branch information
FMGS666 committed Sep 7, 2023
1 parent 4a7cde7 commit 04b4bf4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
15 changes: 0 additions & 15 deletions code-experiments/src/suite_bbob_noisy.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ static coco_problem_t *coco_get_bbob_noisy_problem(const size_t function,
const size_t instance) {
coco_problem_t *problem = NULL;

const int verbose = 0;
const char *problem_id_template = "bbob_noisy_f%lu_i%02lu_d%02lu";
const char *problem_name_template = "BBOB-NOISY suite problem f%lu instance %lu in %luD";

Expand Down Expand Up @@ -610,20 +609,6 @@ static coco_problem_t *coco_get_bbob_noisy_problem(const size_t function,
(unsigned long) function_idx, (unsigned long) instance, (unsigned long) dimension);
return NULL; /* Never reached */
}
if (verbose == 1){
printf("\nf%lu_i%02lu_d%02lu, optimal_f_value: %f \n", function_idx, instance, dimension , problem -> best_value[0]);
printf("x: {\n");
for(size_t dim = 0; dim < problem -> number_of_variables - 1; dim ++){
printf("\t%f, \n", *(problem -> best_parameter + dim));

}
printf("\t%f\n", *(problem -> best_parameter + problem -> number_of_variables - 1));
printf("}");
}
if (verbose == 2) {
printf("f%lu_i%02lu_d%02lu, rseed: %lu \n", function_idx, instance, dimension , rseed);

}
return problem;
}

Expand Down
9 changes: 3 additions & 6 deletions code-experiments/src/suite_bbob_noisy_utilities.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,14 @@ void coco_problem_f_evaluate_wrap_noisy(
const double *x,
double *y
){
int test_noise_free_values = 0;
double fopt = *(problem -> best_value);
assert(problem -> evaluate_function != NULL);
assert(problem -> noise_model != NULL);
assert(problem -> noise_model -> noise_sampler != NULL);
problem -> placeholder_evaluate_function(problem, x, y);
if (test_noise_free_values == 0){
*(y) = *(y) - fopt;
problem -> noise_model -> noise_sampler(problem, y);
*(y) = *(y) + fopt;
}
*(y) = *(y) - fopt;
problem -> noise_model -> noise_sampler(problem, y);
*(y) = *(y) + fopt;
}

/**
Expand Down

0 comments on commit 04b4bf4

Please sign in to comment.