diff --git a/src/search/evaluator.cc b/src/search/evaluator.cc index d93378750d..db63a23c9f 100644 --- a/src/search/evaluator.cc +++ b/src/search/evaluator.cc @@ -101,9 +101,12 @@ void add_evaluator_options_to_feature(plugins::Feature &feature) { } shared_ptr> get_evaluator_parameters_from_options(const plugins::Options &opts) { - auto parent_parameter_tuple = utils::get_log_parameters_from_options(opts); - auto own_parameter_tuple = make_tuple(opts.get("description")); - return make_shared>(tuple_cat(own_parameter_tuple, *parent_parameter_tuple)); + return make_shared>( + tuple_cat( + make_tuple(opts.get("description")), + *utils::get_log_parameters_from_options(opts) + ) + ); } static class EvaluatorCategoryPlugin : public plugins::TypedCategoryPlugin { diff --git a/src/search/merge_and_shrink/merge_tree_factory.cc b/src/search/merge_and_shrink/merge_tree_factory.cc index 58b62c4fa1..7d9293a163 100644 --- a/src/search/merge_and_shrink/merge_tree_factory.cc +++ b/src/search/merge_and_shrink/merge_tree_factory.cc @@ -58,6 +58,15 @@ void MergeTreeFactory::add_options_to_feature(plugins::Feature &feature) { "use_random"); } +shared_ptr> get_merge_tree_parameters_from_options(const plugins::Options &opts) { + return make_shared>( + make_tuple( + opts.get("random_seed"), + opts.get("update_option") + ) + ); +} + static class MergeTreeFactoryCategoryPlugin : public plugins::TypedCategoryPlugin { public: MergeTreeFactoryCategoryPlugin() : TypedCategoryPlugin("MergeTree") { diff --git a/src/search/merge_and_shrink/merge_tree_factory.h b/src/search/merge_and_shrink/merge_tree_factory.h index d2cd60142b..296dce8c1f 100644 --- a/src/search/merge_and_shrink/merge_tree_factory.h +++ b/src/search/merge_and_shrink/merge_tree_factory.h @@ -50,6 +50,8 @@ class MergeTreeFactory { // Derived classes must call this method in their parsing methods. static void add_options_to_feature(plugins::Feature &feature); }; + +extern std::shared_ptr> get_merge_tree_parameters_from_options(const plugins::Options &opts); } #endif diff --git a/src/search/merge_and_shrink/merge_tree_factory_linear.cc b/src/search/merge_and_shrink/merge_tree_factory_linear.cc index 4cd7069844..9e48e51e69 100644 --- a/src/search/merge_and_shrink/merge_tree_factory_linear.cc +++ b/src/search/merge_and_shrink/merge_tree_factory_linear.cc @@ -139,10 +139,9 @@ class MergeTreeFactoryLinearFeature : public plugins::TypedFeature create_component( const plugins::Options &opts, const utils::Context &) const override { - return make_shared( - opts.get("variable_order"), - opts.get("random_seed"), - opts.get("update_option") + return plugins::make_shared_from_args_tuple_and_args( + get_merge_tree_parameters_from_options(opts), + opts.get("variable_order") ); } }; diff --git a/src/search/plugins/plugin.h b/src/search/plugins/plugin.h index 5688487038..7f06ecc686 100644 --- a/src/search/plugins/plugin.h +++ b/src/search/plugins/plugin.h @@ -122,7 +122,7 @@ class TypedFeature : public FeatureAuto { template std::shared_ptr make_shared_from_args_tuple_and_args(ParentTuple parent_tuple, ChildSingletons ... child_singletons) { return std::apply([](auto ... args) { - return make_shared(args ...); + return std::make_shared(args ...); }, std::tuple_cat(std::make_tuple(child_singletons ...), *parent_tuple) );