update config

main
Brett 2025-04-02 18:48:11 -04:00
parent d14b7ee7ce
commit abb4cc26a4
2 changed files with 8 additions and 7 deletions

View File

@ -27,7 +27,7 @@ macro(compile_options target_name)
sanitizers(${target_name}) sanitizers(${target_name})
endmacro() endmacro()
project(blt-gp VERSION 0.4.2) project(blt-gp VERSION 0.4.3)
include(CTest) include(CTest)

View File

@ -292,15 +292,15 @@ namespace blt::gp
}) })
{ {
create_threads(); create_threads();
selection_probabilities.update(config); set_config(config);
} }
explicit gp_program(blt::u64 seed, const prog_config_t& config): seed_func([seed] { explicit gp_program(blt::u64 seed, const prog_config_t& config): seed_func([seed] {
return seed; return seed;
}), config(config) })
{ {
create_threads(); create_threads();
selection_probabilities.update(config); set_config(config);
} }
/** /**
@ -311,13 +311,13 @@ namespace blt::gp
explicit gp_program(std::function<blt::u64()> seed_func): seed_func(std::move(seed_func)) explicit gp_program(std::function<blt::u64()> seed_func): seed_func(std::move(seed_func))
{ {
create_threads(); create_threads();
selection_probabilities.update(config); set_config(config);
} }
explicit gp_program(std::function<blt::u64()> seed_func, const prog_config_t& config): seed_func(std::move(seed_func)), config(config) explicit gp_program(std::function<blt::u64()> seed_func, const prog_config_t& config): seed_func(std::move(seed_func))
{ {
create_threads(); create_threads();
selection_probabilities.update(config); set_config(config);
} }
~gp_program() ~gp_program()
@ -680,6 +680,7 @@ namespace blt::gp
void set_config(const prog_config_t& config) void set_config(const prog_config_t& config)
{ {
this->config = config; this->config = config;
selection_probabilities.update(this->config);
} }
[[nodiscard]] type_provider& get_typesystem() [[nodiscard]] type_provider& get_typesystem()