diff --git a/.gitignore b/.gitignore index 1fb362e4e..b903e0f1f 100644 --- a/.gitignore +++ b/.gitignore @@ -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 @@ -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 diff --git a/code-experiments/build/c/Makefile b/code-experiments/build/c/Makefile deleted file mode 100644 index 222a5d838..000000000 --- a/code-experiments/build/c/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -## Makefile to build C example programs included with the COCO distribution -## -## NOTE: We have tried to make this Makefile as generic and portable -## as possible. However, there are many (incompatible) versions of -## make floating around. We regularly test using GNU make and BSD make -## from FreeBSD. If you have trouble compiling the examples, please -## try to use GNU make. -## -## On Windows it is best to use either the included NMakefile by running -## -## nmake -f NMakefile -## -## or installing Cygwin and running GNU make from within Cygwin. - -LDFLAGS += -lm -CCFLAGS ?= -g -ggdb -std=c99 -pedantic -Wall -Wextra -Wstrict-prototypes -Wshadow -Wno-sign-compare -Wconversion - -######################################################################## -## Toplevel targets -all: example_experiment - -clean: - rm -f coco.o - rm -f example_experiment.o example_experiment - -######################################################################## -## Programs -example_experiment: example_experiment.o coco.o - ${CC} ${CCFLAGS} -o example_experiment coco.o example_experiment.o ${LDFLAGS} - -######################################################################## -## Additional dependencies -coco.o: coco.h coco.c - ${CC} -c ${CCFLAGS} -o coco.o coco.c -example_experiment.o: coco.h coco.c example_experiment.c - ${CC} -c ${CCFLAGS} -o example_experiment.o example_experiment.c diff --git a/code-experiments/build/python/src/cocoex/interface.pyx b/code-experiments/build/python/src/cocoex/interface.pyx index 118fa6762..933357014 100644 --- a/code-experiments/build/python/src/cocoex/interface.pyx +++ b/code-experiments/build/python/src/cocoex/interface.pyx @@ -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) @@ -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 = [] diff --git a/code-experiments/src/coco.h b/code-experiments/src/coco.h index 4d89f6ec6..82c935b1c 100644 --- a/code-experiments/src/coco.h +++ b/code-experiments/src/coco.h @@ -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); /**@}*/ diff --git a/code-experiments/src/suite_bbob_noisy_utilities.c b/code-experiments/src/suite_bbob_noisy_utilities.c index a43313120..94c522ebe 100644 --- a/code-experiments/src/suite_bbob_noisy_utilities.c +++ b/code-experiments/src/suite_bbob_noisy_utilities.c @@ -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; } @@ -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; @@ -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; diff --git a/code-experiments/src/suite_largescale.c b/code-experiments/src/suite_largescale.c index a6c168078..112f8e25c 100644 --- a/code-experiments/src/suite_largescale.c +++ b/code-experiments/src/suite_largescale.c @@ -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);