Compare commits
No commits in common. "99b784835b9c4da5d583598c1272f4aa9b167012" and "053a34e30c75fdb245258246fdf3b5d71569d9be" have entirely different histories.
99b784835b
...
053a34e30c
|
@ -27,7 +27,7 @@ macro(compile_options target_name)
|
||||||
sanitizers(${target_name})
|
sanitizers(${target_name})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
project(blt-gp VERSION 0.3.6)
|
project(blt-gp VERSION 0.3.4)
|
||||||
|
|
||||||
include(CTest)
|
include(CTest)
|
||||||
|
|
||||||
|
@ -46,10 +46,6 @@ find_package(Threads REQUIRED)
|
||||||
|
|
||||||
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -g")
|
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -g")
|
||||||
|
|
||||||
if (NOT ${CMAKE_BUILD_TYPE})
|
|
||||||
set(CMAKE_BUILD_TYPE Release)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (NOT TARGET BLT)
|
if (NOT TARGET BLT)
|
||||||
add_subdirectory(lib/blt)
|
add_subdirectory(lib/blt)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
|
@ -106,7 +106,6 @@ namespace blt::gp
|
||||||
|
|
||||||
const tree_t* p1;
|
const tree_t* p1;
|
||||||
const tree_t* p2;
|
const tree_t* p2;
|
||||||
size_t runs = 0;
|
|
||||||
// double parent_val = 0;
|
// double parent_val = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -123,8 +122,6 @@ namespace blt::gp
|
||||||
c1.copy_fast(*p1);
|
c1.copy_fast(*p1);
|
||||||
c2->copy_fast(*p2);
|
c2->copy_fast(*p2);
|
||||||
|
|
||||||
if (++runs >= config.crossover.get().get_config().max_crossover_iterations)
|
|
||||||
return 0;
|
|
||||||
#ifdef BLT_TRACK_ALLOCATIONS
|
#ifdef BLT_TRACK_ALLOCATIONS
|
||||||
crossover_calls.value(1);
|
crossover_calls.value(1);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -72,8 +72,6 @@ namespace blt::gp
|
||||||
{
|
{
|
||||||
// number of times crossover will try to pick a valid point in the tree. this is purely based on the return type of the operators
|
// number of times crossover will try to pick a valid point in the tree. this is purely based on the return type of the operators
|
||||||
u32 max_crossover_tries = 5;
|
u32 max_crossover_tries = 5;
|
||||||
// how many times the crossover function can fail before we will skip this operation.
|
|
||||||
u32 max_crossover_iterations = 10;
|
|
||||||
// if tree have fewer nodes than this number, they will not be considered for crossover
|
// if tree have fewer nodes than this number, they will not be considered for crossover
|
||||||
// should be at least 5 as crossover will not select the root node.
|
// should be at least 5 as crossover will not select the root node.
|
||||||
u32 min_tree_size = 5;
|
u32 min_tree_size = 5;
|
||||||
|
@ -93,11 +91,6 @@ namespace blt::gp
|
||||||
explicit crossover_t(const config_t& config): config(config)
|
explicit crossover_t(const config_t& config): config(config)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
[[nodiscard]] const config_t& get_config() const
|
|
||||||
{
|
|
||||||
return config;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::optional<crossover_point_t> get_crossover_point(gp_program& program, const tree_t& c1, const tree_t& c2) const;
|
std::optional<crossover_point_t> get_crossover_point(gp_program& program, const tree_t& c1, const tree_t& c2) const;
|
||||||
|
|
||||||
std::optional<crossover_point_t> get_crossover_point_traverse(gp_program& program, const tree_t& c1, const tree_t& c2) const;
|
std::optional<crossover_point_t> get_crossover_point_traverse(gp_program& program, const tree_t& c1, const tree_t& c2) const;
|
||||||
|
|
|
@ -106,8 +106,6 @@ void do_run()
|
||||||
{
|
{
|
||||||
for (const auto reproduction_chance : reproduction_chances)
|
for (const auto reproduction_chance : reproduction_chances)
|
||||||
{
|
{
|
||||||
if (crossover_chance == 0 && mutation_chance == 0 && reproduction_chance == 0)
|
|
||||||
continue;
|
|
||||||
for (const auto elite_amount : elite_amounts)
|
for (const auto elite_amount : elite_amounts)
|
||||||
{
|
{
|
||||||
for (const auto population_sizes : population_sizes)
|
for (const auto population_sizes : population_sizes)
|
||||||
|
|
Loading…
Reference in New Issue