diff --git a/CMakeLists.txt b/CMakeLists.txt index 0279803..f24afe7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.25) -project(image-gp-6 VERSION 0.0.26) +project(image-gp-6 VERSION 0.0.27) include(FetchContent) diff --git a/include/config.h b/include/config.h index 5a91e88..c1ee93d 100644 --- a/include/config.h +++ b/include/config.h @@ -34,7 +34,7 @@ inline constexpr blt::size_t POP_SIZE = 64; inline constexpr blt::size_t CHANNELS = 3; inline constexpr blt::u64 u64_size_min = 1; inline constexpr blt::u64 u64_size_max = 9; -inline constexpr float THRESHOLD = 0.3; +inline constexpr float THRESHOLD = 0.5; inline constexpr auto load_image = "../GSab4SWWcAA1TNR.png"; inline blt::gp::image_crossover_t image_crossover; diff --git a/src/main.cpp b/src/main.cpp index 1dd6b0d..e28d6cf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -236,7 +236,12 @@ constexpr auto create_fitness_function() { fitness.raw_fitness = 0; for (blt::size_t i = 0; i < DATA_CHANNELS_SIZE; i++) - fitness.raw_fitness += compare_values(v.rgb_data[i], base_image.rgb_data[i]); + { + auto diff = compare_values(v.rgb_data[i], base_image.rgb_data[i]); + fitness.raw_fitness += diff; + if (diff < 0.01) + fitness.raw_fitness -= fitness.raw_fitness * 0.02; + } fitness.raw_fitness /= (IMAGE_SIZE * IMAGE_SIZE); auto raw = get_fractal_value(v);