From 858a7f5cfeeb90ad8df0f115537fd2fdbf445061 Mon Sep 17 00:00:00 2001 From: Brett Date: Sun, 18 Aug 2024 02:08:48 -0400 Subject: [PATCH] works --- CMakeLists.txt | 2 +- examples/symbolic_regression.cpp | 2 +- include/blt/gp/program.h | 6 ++++-- include/blt/gp/selection.h | 2 -- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 417556f..484f30d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.25) -project(blt-gp VERSION 0.1.7) +project(blt-gp VERSION 0.1.8) include(CTest) diff --git a/examples/symbolic_regression.cpp b/examples/symbolic_regression.cpp index 08364fc..bf75a7e 100644 --- a/examples/symbolic_regression.cpp +++ b/examples/symbolic_regression.cpp @@ -39,7 +39,7 @@ blt::gp::prog_config_t config = blt::gp::prog_config_t() .set_mutation_chance(0.1) .set_reproduction_chance(0) .set_max_generations(50) - .set_pop_size(5000) + .set_pop_size(50000) .set_thread_count(0); blt::gp::type_provider type_system; diff --git a/include/blt/gp/program.h b/include/blt/gp/program.h index 75cf3dd..3a09687 100644 --- a/include/blt/gp/program.h +++ b/include/blt/gp/program.h @@ -409,8 +409,10 @@ namespace blt::gp if (id == 0) { crossover_selection.pre_process(*this, current_pop, current_stats); - mutation_selection.pre_process(*this, current_pop, current_stats); - reproduction_selection.pre_process(*this, current_pop, current_stats); + if (&crossover_selection != &mutation_selection) + mutation_selection.pre_process(*this, current_pop, current_stats); + if (&crossover_selection != &reproduction_selection) + reproduction_selection.pre_process(*this, current_pop, current_stats); perform_elitism(args); diff --git a/include/blt/gp/selection.h b/include/blt/gp/selection.h index db6a197..5c99354 100644 --- a/include/blt/gp/selection.h +++ b/include/blt/gp/selection.h @@ -52,8 +52,6 @@ namespace blt::gp { for (blt::size_t i = 0; i < config.elites; i++) { -// BLT_INFO("%lf >= %lf? // %lf (indexes: %ld %ld)", ind.second.fitness.adjusted_fitness, values[i].second, -// ind.second.fitness.raw_fitness, ind.first, values[i].first); if (ind.second.fitness.adjusted_fitness >= values[i].second) { bool doesnt_contain = true;