diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f638a8..ae74097 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.25) -project(image-gp-6 VERSION 0.0.37) +project(image-gp-6 VERSION 0.0.38) include(FetchContent) diff --git a/lib/blt-gp b/lib/blt-gp index 552b150..6e45ea3 160000 --- a/lib/blt-gp +++ b/lib/blt-gp @@ -1 +1 @@ -Subproject commit 552b150402450c94d983b4df00191a65a947b806 +Subproject commit 6e45ea3d6de5c3686c969f9fdd706c527560cd8c diff --git a/src/custom_transformer.cpp b/src/custom_transformer.cpp index 52c3e8f..0a2a95e 100644 --- a/src/custom_transformer.cpp +++ b/src/custom_transformer.cpp @@ -332,7 +332,10 @@ namespace blt::gp // other arguments are generated. // get a replacement which returns the same type. - operator_id random_replacement = program.get_random().select(program.get_type_non_terminals(current_func_info.return_type.id)); + auto& non_terminals = program.get_type_non_terminals(current_func_info.return_type.id); + if (non_terminals.empty()) + continue; + operator_id random_replacement = program.get_random().select(non_terminals); blt::size_t arg_position = 0; do { @@ -350,8 +353,11 @@ namespace blt::gp exit: auto& replacement_func_info = program.get_operator_info(random_replacement); // replacement function should be valid. let's make a copy of us. - blt::size_t for_bytes = 0; - blt::size_t after_bytes = 0; + auto current_end = c.find_endpoint(program, static_cast(c_node)); + blt::size_t for_bytes = c.total_value_bytes(c_node, current_end); + blt::size_t after_bytes = c.total_value_bytes(current_end); + + auto after_data = } break; case mutation_operator::JUMP_FUNC: