From 54e374a4e2c0662d3ec894b3d4225141b764a00e Mon Sep 17 00:00:00 2001 From: ClemensBuechner Date: Fri, 8 Sep 2023 13:58:39 +0200 Subject: [PATCH] Rename function to match our conventions. --- src/search/landmarks/landmark_cost_assignment.cc | 4 ++-- src/search/landmarks/landmark_cost_assignment.h | 6 +++--- .../landmarks/landmark_cost_partitioning_heuristic.cc | 5 +++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/search/landmarks/landmark_cost_assignment.cc b/src/search/landmarks/landmark_cost_assignment.cc index d1ba0a65c2..3e6f73ea0d 100644 --- a/src/search/landmarks/landmark_cost_assignment.cc +++ b/src/search/landmarks/landmark_cost_assignment.cc @@ -40,7 +40,7 @@ UniformCostPartitioningAlgorithm::UniformCostPartitioningAlgorithm( use_action_landmarks(use_action_landmarks) { } -double UniformCostPartitioningAlgorithm::compute_cost_partitioned_h_value( +double UniformCostPartitioningAlgorithm::get_cost_partitioned_heuristic_value( const LandmarkStatusManager &lm_status_manager, const State &ancestor_state) { vector achieved_lms_by_op(operator_costs.size(), 0); @@ -175,7 +175,7 @@ lp::LinearProgram OptimalCostPartitioningAlgorithm::build_initial_lp() { {}, lp_solver.get_infinity()); } -double OptimalCostPartitioningAlgorithm::compute_cost_partitioned_h_value( +double OptimalCostPartitioningAlgorithm::get_cost_partitioned_heuristic_value( const LandmarkStatusManager &lm_status_manager, const State &ancestor_state) { /* TODO: We could also do the same thing with action landmarks we diff --git a/src/search/landmarks/landmark_cost_assignment.h b/src/search/landmarks/landmark_cost_assignment.h index 28385b3c71..6451873623 100644 --- a/src/search/landmarks/landmark_cost_assignment.h +++ b/src/search/landmarks/landmark_cost_assignment.h @@ -28,7 +28,7 @@ class CostPartitioningAlgorithm { const LandmarkGraph &graph); virtual ~CostPartitioningAlgorithm() = default; - virtual double compute_cost_partitioned_h_value( + virtual double get_cost_partitioned_heuristic_value( const LandmarkStatusManager &lm_status_manager, const State &ancestor_state) = 0; }; @@ -40,7 +40,7 @@ class UniformCostPartitioningAlgorithm : public CostPartitioningAlgorithm { const LandmarkGraph &graph, bool use_action_landmarks); - virtual double compute_cost_partitioned_h_value( + virtual double get_cost_partitioned_heuristic_value( const LandmarkStatusManager &lm_status_manager, const State &ancestor_state) override; }; @@ -64,7 +64,7 @@ class OptimalCostPartitioningAlgorithm : public CostPartitioningAlgorithm { const LandmarkGraph &graph, lp::LPSolverType solver_type); - virtual double compute_cost_partitioned_h_value( + virtual double get_cost_partitioned_heuristic_value( const LandmarkStatusManager &lm_status_manager, const State &ancestor_state) override; }; diff --git a/src/search/landmarks/landmark_cost_partitioning_heuristic.cc b/src/search/landmarks/landmark_cost_partitioning_heuristic.cc index 8488e479c9..7b9a5d08c4 100644 --- a/src/search/landmarks/landmark_cost_partitioning_heuristic.cc +++ b/src/search/landmarks/landmark_cost_partitioning_heuristic.cc @@ -66,8 +66,9 @@ int LandmarkCostPartitioningHeuristic::get_heuristic_value( const State &ancestor_state) { double epsilon = 0.01; - double h_val = cost_partitioning_algorithm->compute_cost_partitioned_h_value( - *lm_status_manager, ancestor_state); + double h_val = + cost_partitioning_algorithm->get_cost_partitioned_heuristic_value( + *lm_status_manager, ancestor_state); if (h_val == numeric_limits::max()) { return DEAD_END; } else {