From 699806aeff9216b9593b8eda8a2db2638531ccdc Mon Sep 17 00:00:00 2001 From: Brett Date: Fri, 6 Sep 2024 00:21:55 -0400 Subject: [PATCH] meow? --- CMakeLists.txt | 2 +- examples/symbolic_regression.cpp | 6 +++++- include/blt/gp/config.h | 1 + include/blt/gp/program.h | 4 ++-- include/blt/gp/selection.h | 2 +- include/blt/gp/stack.h | 2 +- include/blt/gp/transformers.h | 1 + lib/blt | 2 +- src/stats.cpp | 2 +- src/transformers.cpp | 5 +++++ 10 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a27092..bbb9149 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.25) -project(blt-gp VERSION 0.1.47) +project(blt-gp VERSION 0.1.48) include(CTest) diff --git a/examples/symbolic_regression.cpp b/examples/symbolic_regression.cpp index 5c1c33f..80b378e 100644 --- a/examples/symbolic_regression.cpp +++ b/examples/symbolic_regression.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include "operations_common.h" #include "blt/math/averages.h" @@ -80,8 +80,12 @@ float example_function(float x) return x * x * x * x + x * x * x + x * x + x; } +BLT_MAKE_CONFIG_TYPE(test, BLT_MAKE_GETTER_AND_SETTER(int, silly) BLT_MAKE_GETTER(int, billy)); + int main() { + test t; + BLT_INFO("Starting BLT-GP Symbolic Regression Example"); BLT_START_INTERVAL("Symbolic Regression", "Main"); BLT_DEBUG("Setup Fitness cases"); diff --git a/include/blt/gp/config.h b/include/blt/gp/config.h index fb91439..c9df164 100644 --- a/include/blt/gp/config.h +++ b/include/blt/gp/config.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include diff --git a/include/blt/gp/program.h b/include/blt/gp/program.h index fca001d..288a12f 100644 --- a/include/blt/gp/program.h +++ b/include/blt/gp/program.h @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include @@ -52,7 +52,7 @@ #include #include #include -#include "blt/std/format.h" +#include "blt/format/format.h" namespace blt::gp { diff --git a/include/blt/gp/selection.h b/include/blt/gp/selection.h index e9c9b28..b6e4272 100644 --- a/include/blt/gp/selection.h +++ b/include/blt/gp/selection.h @@ -24,7 +24,7 @@ #include #include #include -#include "blt/std/format.h" +#include "blt/format/format.h" namespace blt::gp { diff --git a/include/blt/gp/stack.h b/include/blt/gp/stack.h index 4a883ab..6c7e7f8 100644 --- a/include/blt/gp/stack.h +++ b/include/blt/gp/stack.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/blt/gp/transformers.h b/include/blt/gp/transformers.h index 15c5765..65aa279 100644 --- a/include/blt/gp/transformers.h +++ b/include/blt/gp/transformers.h @@ -78,6 +78,7 @@ namespace blt::gp {} std::optional get_crossover_point(gp_program& program, const tree_t& c1, const tree_t& c2) const; + std::optional find_place_of_type(gp_program& program, const tree_t& t, type_id type) const; /** * child1 and child2 are copies of the parents, the result of selecting a crossover point and performing standard subtree crossover. diff --git a/lib/blt b/lib/blt index 7198a8b..7410dfe 160000 --- a/lib/blt +++ b/lib/blt @@ -1 +1 @@ -Subproject commit 7198a8b0c32e35c9d80d8e44ff17c7199ddde6f8 +Subproject commit 7410dfe0ff6196e77856a79b4c92b05a90e35880 diff --git a/src/stats.cpp b/src/stats.cpp index 2ee9322..c9d0d3e 100644 --- a/src/stats.cpp +++ b/src/stats.cpp @@ -17,7 +17,7 @@ */ #include #include -#include "blt/std/format.h" +#include "blt/format/format.h" namespace blt::gp { diff --git a/src/transformers.cpp b/src/transformers.cpp index 82693a2..cfa1f04 100644 --- a/src/transformers.cpp +++ b/src/transformers.cpp @@ -211,6 +211,11 @@ namespace blt::gp return crossover_point_t{static_cast(crossover_point), static_cast(attempted_point)}; } + std::optional crossover_t::find_place_of_type(gp_program& program, const tree_t& t, type_id type) const + { + return std::optional(); + } + bool mutation_t::apply(gp_program& program, const tree_t&, tree_t& c) { mutate_point(program, c, program.get_random().get_size_t(0ul, c.get_operations().size()));