diff --git a/src/search/operator_cost.cc b/src/search/operator_cost.cc index cd1d708a0e..6240d81777 100644 --- a/src/search/operator_cost.cc +++ b/src/search/operator_cost.cc @@ -41,6 +41,10 @@ void add_cost_type_option_to_feature(plugins::Feature &feature) { "normal"); } +OperatorCost get_cost_type_arguments_from_options(const plugins::Options &opts) { + return opts.get("cost_type"); +} + static plugins::TypedEnumPlugin _enum_plugin({ {"normal", "all actions are accounted for with their real cost"}, {"one", "all actions are accounted for as unit cost"}, diff --git a/src/search/operator_cost.h b/src/search/operator_cost.h index f8837a5a78..f2be204e66 100644 --- a/src/search/operator_cost.h +++ b/src/search/operator_cost.h @@ -5,11 +5,13 @@ class OperatorProxy; namespace plugins { class Feature; +class Options; } enum OperatorCost {NORMAL = 0, ONE = 1, PLUSONE = 2, MAX_OPERATOR_COST}; int get_adjusted_action_cost(const OperatorProxy &op, OperatorCost cost_type, bool is_unit_cost); -void add_cost_type_option_to_feature(plugins::Feature &feature); +extern void add_cost_type_option_to_feature(plugins::Feature &feature); +extern OperatorCost get_cost_type_arguments_from_options(const plugins::Options &opts); #endif diff --git a/src/search/tasks/cost_adapted_task.cc b/src/search/tasks/cost_adapted_task.cc index 34666636b2..069452dcef 100644 --- a/src/search/tasks/cost_adapted_task.cc +++ b/src/search/tasks/cost_adapted_task.cc @@ -38,8 +38,9 @@ class CostAdaptedTaskFeature : public plugins::TypedFeature create_component(const plugins::Options &options, const utils::Context &) const override { - OperatorCost cost_type = options.get("cost_type"); - return make_shared(g_root_task, cost_type); + return make_shared( + g_root_task, + get_cost_type_arguments_from_options(options)); } };