Compare commits

...

2 Commits

Author SHA1 Message Date
Brett abb4cc26a4 update config 2025-04-02 18:48:11 -04:00
Brett d14b7ee7ce allow setting config 2025-04-02 18:46:27 -04:00
3 changed files with 14 additions and 8 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.1) 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()
@ -677,6 +677,12 @@ namespace blt::gp
return config; return config;
} }
void set_config(const prog_config_t& config)
{
this->config = config;
selection_probabilities.update(this->config);
}
[[nodiscard]] type_provider& get_typesystem() [[nodiscard]] type_provider& get_typesystem()
{ {
return storage.system; return storage.system;

@ -1 +1 @@
Subproject commit 0ebbc198c5b80ca99e537460ef92fd806864fa3e Subproject commit 9a05c86b02c9c45c2b384c531007416148ec4b56