diff --git a/src/experiment.c b/src/experiment.c index efa6e80b4ccaa1e31b1c7e96861b0dcc8ba40e5b..de9b25d5bfac8bb3856a28b272f33fb3ef015c11 100644 --- a/src/experiment.c +++ b/src/experiment.c @@ -1,9 +1,3 @@ -/** - * An example of benchmarking random search on a COCO suite. A grid search optimizer is also - * implemented and can be used instead of random search. - * - * Set the global parameter BUDGET_MULTIPLIER to suit your needs. - */ #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -68,7 +62,7 @@ static void timing_data_time_problem(timing_data_t *timing_data, coco_problem_t static void timing_data_finalize(timing_data_t *timing_data); /** - * The main method initializes the random number generator and calls the example experiment on the + * The main method initializes the random number generator and calls the experiment on the * bi-objective suite. */ int main(void) { @@ -95,8 +89,7 @@ int main(void) { } /** - * A simple example of benchmarking random search on a suite with instances from 2016 that can serve also as - * a timing experiment. + * The benchmarking experiment * * @param suite_name Name of the suite (use "bbob" for the single-objective and "bbob-biobj" for the * bi-objective suite). @@ -115,9 +108,9 @@ void experiment(const char *suite_name, /* Set some options for the observer. See documentation for other options. */ char *observer_options = - coco_strdupf("result_folder: RS_on_%s " - "algorithm_name: RS " - "algorithm_info: \"A simple random search algorithm\"", suite_name); + coco_strdupf("result_folder: IBEA_EPS_on_%s " + "algorithm_name: IBEA_EPS " + "algorithm_info: \"IBEA algorithm with espsilon indicator\"", suite_name); /* Initialize the suite and observer */ suite = coco_suite(suite_name, "year: 2016", "dimensions: 2,3,5,10,20,40"); @@ -170,7 +163,6 @@ void experiment(const char *suite_name, coco_observer_free(observer); coco_suite_free(suite); - } /** diff --git a/src/ibea/ibea.cpp b/src/ibea/ibea.cpp index 21d052f180d8b4b02ade0ed55380828e0c28a04c..6a817a0e5841ca0c5a3694d12f1e8753ee40670d 100644 --- a/src/ibea/ibea.cpp +++ b/src/ibea/ibea.cpp @@ -1,3 +1,5 @@ +#include <cmath> + #include "../coco/coco.h" #include "population.h" #include "tournament.h" @@ -15,8 +17,8 @@ void ibea(evaluate_function_t evaluate, { /* Parameters */ int n_individus = 10; /* number of individus per generations */ - int n_generations = 2; /* number of generations */ - int mu = 5; /* number of tournament */ + int n_generations = floor(max_budget/n_individus); /* number of generations */ + int mu = 2; /* number of binary tournament */ double eta = 20; /* polynomiale mutation degree */ double p_combination = 1; double p_mutation = 0.1; diff --git a/src/ibea/mutation.cpp b/src/ibea/mutation.cpp index e495753f8033cee38e8c33caaba03345c441d7e1..d90488f38ccf59155ed6f52651eac7b835bef01b 100644 --- a/src/ibea/mutation.cpp +++ b/src/ibea/mutation.cpp @@ -1,6 +1,7 @@ #include <cstdlib> #include <cmath> #include <algorithm> +#include <cstdio> #include "../coco/coco.h" #include "population.h" @@ -26,6 +27,13 @@ double polynomiale_mutation(double parent, } child = parent + delta_q*(upper_bound - lower_bound); + if (child > upper_bound){ + child = upper_bound; + } + if (child < lower_bound){ + child = lower_bound; + } + return child; }