Compare commits

..

No commits in common. "9ff86161bb7caddbd6ac942c4373465a8af573aa" and "34a3343a89e7a4329952d8853212f5a937392294" have entirely different histories.

3 changed files with 6 additions and 10 deletions

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.25) cmake_minimum_required(VERSION 3.25)
project(blt-gp VERSION 0.0.83) project(blt-gp VERSION 0.0.81)
include(CTest) include(CTest)
@ -14,9 +14,7 @@ set(CMAKE_CXX_STANDARD 17)
set(THREADS_PREFER_PTHREAD_FLAG ON) set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
if (NOT TARGET BLT)
add_subdirectory(lib/blt) add_subdirectory(lib/blt)
endif()
include_directories(include/) include_directories(include/)
file(GLOB_RECURSE PROJECT_BUILD_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") file(GLOB_RECURSE PROJECT_BUILD_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")

View File

@ -52,8 +52,7 @@ namespace blt::gp
{ {
for (blt::size_t i = 0; i < config.elites; i++) 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, //BLT_INFO("%lf >= %lf? // %lf", ind.second.fitness.adjusted_fitness, values[i].second, ind.second.fitness.raw_fitness);
ind.second.fitness.raw_fitness, ind.first, values[i].first);
if (ind.second.fitness.adjusted_fitness >= values[i].second) if (ind.second.fitness.adjusted_fitness >= values[i].second)
{ {
bool doesnt_contain = true; bool doesnt_contain = true;
@ -142,8 +141,7 @@ namespace blt::gp
while (next_pop.get_individuals().size() < config.population_size) while (next_pop.get_individuals().size() < config.population_size)
{ {
int sel = random.get_i32(0, 3); int sel = random.get_i32(0, 3);
switch (sel) switch (sel){
{
case 0: case 0:
// everyone gets a chance once per loop. // everyone gets a chance once per loop.
if (random.choice(config.crossover_chance)) if (random.choice(config.crossover_chance))

View File

@ -77,8 +77,8 @@ namespace blt::gp
public: public:
struct config_t struct config_t
{ {
blt::size_t replacement_min_depth = 2; blt::size_t replacement_min_depth = 3;
blt::size_t replacement_max_depth = 6; blt::size_t replacement_max_depth = 7;
std::reference_wrapper<tree_generator_t> generator; std::reference_wrapper<tree_generator_t> generator;