From c98be9edb3f9955653e7175e4e99fe1e4be0b0c8 Mon Sep 17 00:00:00 2001 From: Brett Date: Sat, 23 Mar 2024 03:11:24 -0400 Subject: [PATCH] pathy --- CMakeLists.txt | 2 +- include/lilfbtf/system.h | 4 ++-- src/system.cpp | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c5c764..afbe0f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.25) -project(lilfbtf5 VERSION 0.2.0) +project(lilfbtf5 VERSION 0.2.1) option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF) option(ENABLE_UBSAN "Enable the ub sanitizer" OFF) diff --git a/include/lilfbtf/system.h b/include/lilfbtf/system.h index 862b5fa..b46dbfa 100644 --- a/include/lilfbtf/system.h +++ b/include/lilfbtf/system.h @@ -40,9 +40,9 @@ namespace fb fb::random& engine; type_engine_t& types; - void crossover(); + std::pair crossover(tree_t& p1, tree_t& p2); - void mutate(); + tree_t mutate(tree_t& p); public: explicit gp_population_t(blt::thread_pool& pool, type_engine_t& types, fb::random& engine): pool(pool), engine(engine), types(types) diff --git a/src/system.cpp b/src/system.cpp index fcb6980..9d3ace0 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -19,17 +19,17 @@ namespace fb { - void fb::gp_population_t::crossover() + std::pair gp_population_t::crossover(tree_t& p1, tree_t& p2) { } - void fb::gp_population_t::mutate() + tree_t gp_population_t::mutate(tree_t& p) { } - void fb::gp_population_t::init_pop(const population_init_t init_type, blt::size_t pop_size, blt::size_t min_depth, blt::size_t max_depth, + void gp_population_t::init_pop(const population_init_t init_type, blt::size_t pop_size, blt::size_t min_depth, blt::size_t max_depth, std::optional starting_type, double terminal_chance) { for (blt::size_t i = 0; i < pop_size; i++) @@ -81,7 +81,7 @@ namespace fb } } - void fb::gp_population_t::execute(const individual_eval_func_t& individualEvalFunc, const fitness_eval_func_t& fitnessEvalFunc) + void gp_population_t::execute(const individual_eval_func_t& individualEvalFunc, const fitness_eval_func_t& fitnessEvalFunc) { for (auto& individual : population) { @@ -90,7 +90,7 @@ namespace fb } } - void fb::gp_population_t::breed_new_pop() + void gp_population_t::breed_new_pop() { }