Skip to content

Commit

Permalink
Patching after review, still need to clean the history and figure out…
Browse files Browse the repository at this point in the history
… why it is not building under windows
  • Loading branch information
lorenzo-consoli committed Nov 22, 2023
1 parent c7cdf40 commit 0f75e39
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 70 deletions.
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ code-experiments/build/**/bbob2009_testcases2.txt
code-experiments/build/**/coco.[ch]
code-experiments/build/**/exdata/
code-experiments/build/c/build/
*.egg-info/
.vscode/*
*.info
*.*dat

code-experiments/build/*/coco.[ch]
code-experiments/build/c/Makefile
code-experiments/build/c/example_experiment
code-experiments/build/java/build/
code-experiments/build/matlab/*.mex
Expand All @@ -32,6 +25,7 @@ code-experiments/build/octave/my_fmincon.m
code-experiments/build/octave/my_optimizer.m
code-experiments/build/python/bbob2009_testcases.txt
code-experiments/build/python/bbob2009_testcases2.txt
code-experiments/build/python/._bbob_problem_best_parameter.txt
code-experiments/build/python/build/
code-experiments/build/python/dist/
code-experiments/build/python/src/cocoex/_version.py
Expand Down
36 changes: 0 additions & 36 deletions code-experiments/build/c/Makefile

This file was deleted.

4 changes: 2 additions & 2 deletions code-experiments/build/python/src/cocoex/interface.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ cdef extern from "coco.h":
# double coco_problem_get_final_target_fvalue1(const coco_problem_t *problem)
size_t coco_problem_get_evaluations(const coco_problem_t *problem)
size_t coco_problem_get_evaluations_constraints(const coco_problem_t *problem)
void reset_seeds()
void coco_reset_seeds()
double coco_problem_get_best_observed_fvalue1(const coco_problem_t *problem)
int coco_problem_final_target_hit(const coco_problem_t *problem)
void bbob_problem_best_parameter_print(const coco_problem_t *problem)
Expand Down Expand Up @@ -125,7 +125,7 @@ cdef class Suite:
cdef coco_suite_t* suite
cdef coco_problem_t* p
cdef bytes _old_level
reset_seeds()
coco_reset_seeds()
if self.initialized:
self.reset()
self._ids = []
Expand Down
2 changes: 1 addition & 1 deletion code-experiments/src/coco.h
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ double coco_random_normal(coco_random_state_t *state);
/**
* @brief Resets seeds
*/
void reset_seeds(void);
void coco_reset_seeds(void);

/**@}*/

Expand Down
30 changes: 7 additions & 23 deletions code-experiments/src/suite_bbob_noisy_utilities.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,10 @@
static long _RANDNSEED = 30; /** < @brief Random seed for sampling Uniform noise*/
static long _RANDSEED = 30; /** < @brief Random seed for sampling Gaussian noise*/

/**
* @brief Increases the normal random seed by one unit
* Needed to sample different values at each time
*/
void increase_random_n_seed(void){
_RANDNSEED += 1;
if (_RANDNSEED > (long) 1.0e9)
_RANDNSEED = 1;
}

/**
* @brief Increases the uniform random seed by one unit
* Needed to sample different values at each time
*/
void increase_random_seed(void){
_RANDSEED += 1;
if (_RANDSEED > (long) 1.0e9)
_RANDSEED = 1;
}

/**
* @brief Resets both random seeds to the initial values
*/
void reset_seeds(void){
void coco_reset_seeds(void){
_RANDSEED = 30;
_RANDNSEED = 30;
}
Expand All @@ -54,7 +34,9 @@ void reset_seeds(void){
double coco_sample_gaussian_noise(void){
double gaussian_noise;
double gaussian_noise_ptr[1] = {0.0};
increase_random_n_seed();
_RANDNSEED += 1;
if (_RANDNSEED > (long) 1.0e9)
_RANDNSEED = 1;
bbob2009_gauss(&gaussian_noise_ptr[0], 1, _RANDNSEED);
gaussian_noise = gaussian_noise_ptr[0];
return gaussian_noise;
Expand All @@ -69,7 +51,9 @@ double coco_sample_gaussian_noise(void){
double coco_sample_uniform_noise(void){
double uniform_noise_term;
double noise_vector[1] = {0.0};
increase_random_seed();
_RANDSEED += 1;
if (_RANDSEED > (long) 1.0e9)
_RANDSEED = 1;
bbob2009_unif(&noise_vector[0], 1, _RANDSEED);
uniform_noise_term = noise_vector[0];
return uniform_noise_term;
Expand Down
2 changes: 1 addition & 1 deletion code-experiments/src/suite_largescale.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static coco_problem_t *coco_get_largescale_problem(const size_t function,
problem_id_template, problem_name_template);
} else if (function == 10) {
problem = f_ellipsoid_permblockdiag_bbob_problem_allocate(function, dimension, instance, rseed,
problem_id_template, problem_name_template);
problem_id_template, problem_name_template);
} else if (function == 11) {
problem = f_discus_generalized_permblockdiag_bbob_problem_allocate(function, dimension, instance, rseed,
problem_id_template, problem_name_template);
Expand Down

0 comments on commit 0f75e39

Please sign in to comment.