diff --git a/src/search/AAA_Mechanical_Changes.md b/src/search/AAA_Mechanical_Changes.md index 2da759564b..b04df71ad0 100644 --- a/src/search/AAA_Mechanical_Changes.md +++ b/src/search/AAA_Mechanical_Changes.md @@ -85,10 +85,10 @@ search │ ├── goal_count_heuristic.h✅ │ ├── hm_heuristic.cc✅ │ ├── hm_heuristic.h✅ -│ ├── lm_cut_heuristic.cc -│ ├── lm_cut_heuristic.h -│ ├── lm_cut_landmarks.cc -│ ├── lm_cut_landmarks.h +│ ├── lm_cut_heuristic.cc✅ +│ ├── lm_cut_heuristic.h✅ +│ ├── lm_cut_landmarks.cc✅ +│ ├── lm_cut_landmarks.h✅ │ ├── max_heuristic.cc✅ │ ├── max_heuristic.h✅ │ ├── relaxation_heuristic.cc✅ diff --git a/src/search/heuristics/lm_cut_heuristic.cc b/src/search/heuristics/lm_cut_heuristic.cc index 34e091270e..4cdb153a31 100644 --- a/src/search/heuristics/lm_cut_heuristic.cc +++ b/src/search/heuristics/lm_cut_heuristic.cc @@ -14,17 +14,18 @@ using namespace std; namespace lm_cut_heuristic { -LandmarkCutHeuristic::LandmarkCutHeuristic(const plugins::Options &opts) - : Heuristic(opts), +LandmarkCutHeuristic::LandmarkCutHeuristic( + const shared_ptr &transform, + bool cache_estimates, + const string &name, + utils::Verbosity verbosity) + : Heuristic(transform, cache_estimates, name, verbosity), landmark_generator(utils::make_unique_ptr(task_proxy)) { if (log.is_at_least_normal()) { log << "Initializing landmark cut heuristic..." << endl; } } -LandmarkCutHeuristic::~LandmarkCutHeuristic() { -} - int LandmarkCutHeuristic::compute_heuristic(const State &ancestor_state) { State state = convert_ancestor_state(ancestor_state); int total_cost = 0; @@ -43,7 +44,7 @@ class LandmarkCutHeuristicFeature : public plugins::TypedFeature create_component( + const plugins::Options &opts, const utils::Context &) const override { + return plugins::make_shared_from_args_tuple_and_args( + Heuristic::get_heuristic_parameters_from_options(opts) + ); + } }; static plugins::FeaturePlugin _plugin; diff --git a/src/search/heuristics/lm_cut_heuristic.h b/src/search/heuristics/lm_cut_heuristic.h index d06434bd91..a9369fd41a 100644 --- a/src/search/heuristics/lm_cut_heuristic.h +++ b/src/search/heuristics/lm_cut_heuristic.h @@ -17,8 +17,11 @@ class LandmarkCutHeuristic : public Heuristic { virtual int compute_heuristic(const State &ancestor_state) override; public: - explicit LandmarkCutHeuristic(const plugins::Options &opts); - virtual ~LandmarkCutHeuristic() override; + LandmarkCutHeuristic( + const std::shared_ptr &transform, + bool cache_estimates, + const std::string &name, + utils::Verbosity verbosity); }; } diff --git a/src/search/heuristics/lm_cut_landmarks.cc b/src/search/heuristics/lm_cut_landmarks.cc index 8fe81d1bb9..ea8c5e6502 100644 --- a/src/search/heuristics/lm_cut_landmarks.cc +++ b/src/search/heuristics/lm_cut_landmarks.cc @@ -53,9 +53,6 @@ LandmarkCutLandmarks::LandmarkCutLandmarks(const TaskProxy &task_proxy) { } } -LandmarkCutLandmarks::~LandmarkCutLandmarks() { -} - void LandmarkCutLandmarks::build_relaxed_operator(const OperatorProxy &op) { vector precondition; vector effects; diff --git a/src/search/heuristics/lm_cut_landmarks.h b/src/search/heuristics/lm_cut_landmarks.h index a658876d45..76b967d164 100644 --- a/src/search/heuristics/lm_cut_landmarks.h +++ b/src/search/heuristics/lm_cut_landmarks.h @@ -88,7 +88,6 @@ class LandmarkCutLandmarks { using LandmarkCallback = std::function; LandmarkCutLandmarks(const TaskProxy &task_proxy); - virtual ~LandmarkCutLandmarks(); /* Compute LM-cut landmarks for the given state.