From 016b1b937f30ec99b6692b7ad230d59e1b2994ac Mon Sep 17 00:00:00 2001 From: Jana Pazurikova Date: Thu, 16 Jun 2016 15:45:00 +0200 Subject: [PATCH] Minimize the best of population in DE only if allowed by user --- src/diffevolution.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/diffevolution.c b/src/diffevolution.c index 98b6351..d2cfe1e 100644 --- a/src/diffevolution.c +++ b/src/diffevolution.c @@ -95,10 +95,15 @@ void run_diff_evolution(struct subset * const ss) { calculate_charges(ss, so_far_best); calculate_statistics(ss, so_far_best); kd_print_results(so_far_best); - minimize_locally(so_far_best, 1000); - calculate_charges(ss, so_far_best); - calculate_statistics(ss, so_far_best); - kd_print_results(so_far_best); + + /* Minimize the best of the population once more */ + if (s.polish > 2) { + minimize_locally(so_far_best, 500); + calculate_charges(ss, so_far_best); + calculate_statistics(ss, so_far_best); + kd_print_results(so_far_best); + } + float mutation_constant = s.mutation_constant; int iters_with_evolution = 0; int condition = 1;