main
Brett 2024-09-06 00:21:55 -04:00
parent 0dfa4fea93
commit 699806aeff
10 changed files with 19 additions and 8 deletions

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.25) cmake_minimum_required(VERSION 3.25)
project(blt-gp VERSION 0.1.47) project(blt-gp VERSION 0.1.48)
include(CTest) include(CTest)

View File

@ -19,7 +19,7 @@
#include <blt/profiling/profiler_v2.h> #include <blt/profiling/profiler_v2.h>
#include <blt/gp/tree.h> #include <blt/gp/tree.h>
#include <blt/std/logging.h> #include <blt/std/logging.h>
#include <blt/std/format.h> #include <blt/format/format.h>
#include <iostream> #include <iostream>
#include "operations_common.h" #include "operations_common.h"
#include "blt/math/averages.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; 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() int main()
{ {
test t;
BLT_INFO("Starting BLT-GP Symbolic Regression Example"); BLT_INFO("Starting BLT-GP Symbolic Regression Example");
BLT_START_INTERVAL("Symbolic Regression", "Main"); BLT_START_INTERVAL("Symbolic Regression", "Main");
BLT_DEBUG("Setup Fitness cases"); BLT_DEBUG("Setup Fitness cases");

View File

@ -22,6 +22,7 @@
#include <utility> #include <utility>
#include <thread> #include <thread>
#include <blt/std/types.h> #include <blt/std/types.h>
#include <blt/meta/config_generator.h>
#include <blt/gp/generators.h> #include <blt/gp/generators.h>
#include <blt/gp/transformers.h> #include <blt/gp/transformers.h>

View File

@ -40,7 +40,7 @@
#include <blt/std/hashmap.h> #include <blt/std/hashmap.h>
#include <blt/std/types.h> #include <blt/std/types.h>
#include <blt/std/utility.h> #include <blt/std/utility.h>
#include <blt/std/meta.h> #include <blt/meta/meta.h>
#include <blt/std/memory.h> #include <blt/std/memory.h>
#include <blt/std/thread.h> #include <blt/std/thread.h>
#include <blt/gp/fwdecl.h> #include <blt/gp/fwdecl.h>
@ -52,7 +52,7 @@
#include <blt/gp/stack.h> #include <blt/gp/stack.h>
#include <blt/gp/config.h> #include <blt/gp/config.h>
#include <blt/gp/random.h> #include <blt/gp/random.h>
#include "blt/std/format.h" #include "blt/format/format.h"
namespace blt::gp namespace blt::gp
{ {

View File

@ -24,7 +24,7 @@
#include <blt/gp/config.h> #include <blt/gp/config.h>
#include <blt/gp/random.h> #include <blt/gp/random.h>
#include <blt/std/assert.h> #include <blt/std/assert.h>
#include "blt/std/format.h" #include "blt/format/format.h"
namespace blt::gp namespace blt::gp
{ {

View File

@ -25,7 +25,7 @@
#include <blt/std/logging.h> #include <blt/std/logging.h>
#include <blt/std/allocator.h> #include <blt/std/allocator.h>
#include <blt/std/ranges.h> #include <blt/std/ranges.h>
#include <blt/std/meta.h> #include <blt/meta/meta.h>
#include <blt/gp/fwdecl.h> #include <blt/gp/fwdecl.h>
#include <blt/gp/stats.h> #include <blt/gp/stats.h>
#include <utility> #include <utility>

View File

@ -78,6 +78,7 @@ namespace blt::gp
{} {}
std::optional<crossover_t::crossover_point_t> get_crossover_point(gp_program& program, const tree_t& c1, const tree_t& c2) const; std::optional<crossover_t::crossover_point_t> get_crossover_point(gp_program& program, const tree_t& c1, const tree_t& c2) const;
std::optional<blt::ptrdiff_t> 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. * child1 and child2 are copies of the parents, the result of selecting a crossover point and performing standard subtree crossover.

@ -1 +1 @@
Subproject commit 7198a8b0c32e35c9d80d8e44ff17c7199ddde6f8 Subproject commit 7410dfe0ff6196e77856a79b4c92b05a90e35880

View File

@ -17,7 +17,7 @@
*/ */
#include <blt/gp/stats.h> #include <blt/gp/stats.h>
#include <blt/std/logging.h> #include <blt/std/logging.h>
#include "blt/std/format.h" #include "blt/format/format.h"
namespace blt::gp namespace blt::gp
{ {

View File

@ -211,6 +211,11 @@ namespace blt::gp
return crossover_point_t{static_cast<blt::ptrdiff_t>(crossover_point), static_cast<blt::ptrdiff_t>(attempted_point)}; return crossover_point_t{static_cast<blt::ptrdiff_t>(crossover_point), static_cast<blt::ptrdiff_t>(attempted_point)};
} }
std::optional<blt::ptrdiff_t> crossover_t::find_place_of_type(gp_program& program, const tree_t& t, type_id type) const
{
return std::optional<blt::ptrdiff_t>();
}
bool mutation_t::apply(gp_program& program, const tree_t&, tree_t& c) 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())); mutate_point(program, c, program.get_random().get_size_t(0ul, c.get_operations().size()));