diff --git a/src/search/landmarks/landmark.h b/src/search/landmarks/landmark.h index bca8024547..7473f61672 100644 --- a/src/search/landmarks/landmark.h +++ b/src/search/landmarks/landmark.h @@ -3,7 +3,7 @@ #include "../task_proxy.h" -#include +#include namespace landmarks { class Landmark { @@ -31,8 +31,8 @@ class Landmark { bool is_true_in_goal; bool is_derived; - std::set first_achievers; - std::set possible_achievers; + std::unordered_set first_achievers; + std::unordered_set possible_achievers; bool is_true_in_state(const State &state) const; }; diff --git a/src/search/landmarks/landmark_cost_partitioning_algorithms.cc b/src/search/landmarks/landmark_cost_partitioning_algorithms.cc index 807346007c..b669b7e785 100644 --- a/src/search/landmarks/landmark_cost_partitioning_algorithms.cc +++ b/src/search/landmarks/landmark_cost_partitioning_algorithms.cc @@ -22,7 +22,7 @@ CostPartitioningAlgorithm::CostPartitioningAlgorithm( : lm_graph(graph), operator_costs(operator_costs) { } -const set &CostPartitioningAlgorithm::get_achievers( +const unordered_set &CostPartitioningAlgorithm::get_achievers( const Landmark &landmark, bool past) const { // Return relevant achievers of the landmark according to its status. if (past) { @@ -60,7 +60,7 @@ double UniformCostPartitioningAlgorithm::get_cost_partitioned_heuristic_value( for (auto &node : nodes) { int id = node->get_id(); if (future.test(id)) { - const set &achievers = + const unordered_set &achievers = get_achievers(node->get_landmark(), past.test(id)); if (achievers.empty()) return numeric_limits::max(); @@ -93,7 +93,7 @@ double UniformCostPartitioningAlgorithm::get_cost_partitioned_heuristic_value( for (auto &node : nodes) { int id = node->get_id(); if (future.test(id)) { - const set &achievers = + const unordered_set &achievers = get_achievers(node->get_landmark(), past.test(id)); bool covered_by_action_lm = false; for (int op_id : achievers) { @@ -120,7 +120,7 @@ double UniformCostPartitioningAlgorithm::get_cost_partitioned_heuristic_value( // TODO: Iterate over Landmarks instead of LandmarkNodes int id = node->get_id(); assert(future.test(id)); - const set &achievers = + const unordered_set &achievers = get_achievers(node->get_landmark(), past.test(id)); double min_cost = numeric_limits::max(); for (int op_id : achievers) { @@ -216,7 +216,7 @@ double OptimalCostPartitioningAlgorithm::get_cost_partitioned_heuristic_value( for (int lm_id = 0; lm_id < num_cols; ++lm_id) { const Landmark &landmark = lm_graph.get_node(lm_id)->get_landmark(); if (future.test(lm_id)) { - const set &achievers = + const unordered_set &achievers = get_achievers(landmark, past.test(lm_id)); if (achievers.empty()) return numeric_limits::max(); diff --git a/src/search/landmarks/landmark_cost_partitioning_algorithms.h b/src/search/landmarks/landmark_cost_partitioning_algorithms.h index 833ead053f..a4a6cdf80d 100644 --- a/src/search/landmarks/landmark_cost_partitioning_algorithms.h +++ b/src/search/landmarks/landmark_cost_partitioning_algorithms.h @@ -5,7 +5,7 @@ #include "../lp/lp_solver.h" -#include +#include #include class OperatorsProxy; @@ -21,7 +21,7 @@ class CostPartitioningAlgorithm { const LandmarkGraph &lm_graph; const std::vector operator_costs; - const std::set &get_achievers( + const std::unordered_set &get_achievers( const Landmark &landmark, bool past) const; public: CostPartitioningAlgorithm(const std::vector &operator_costs, diff --git a/src/search/landmarks/landmark_sum_heuristic.cc b/src/search/landmarks/landmark_sum_heuristic.cc index 07cfc0068e..ac687a56b2 100644 --- a/src/search/landmarks/landmark_sum_heuristic.cc +++ b/src/search/landmarks/landmark_sum_heuristic.cc @@ -44,7 +44,7 @@ LandmarkSumHeuristic::LandmarkSumHeuristic(const plugins::Options &opts) } int LandmarkSumHeuristic::get_min_cost_of_achievers( - const set &achievers) const { + const unordered_set &achievers) const { int min_cost = numeric_limits::max(); for (int id : achievers) { OperatorProxy op = get_operator_or_axiom(task_proxy, id); diff --git a/src/search/landmarks/landmark_sum_heuristic.h b/src/search/landmarks/landmark_sum_heuristic.h index 6a9a21ab08..c47af5b090 100644 --- a/src/search/landmarks/landmark_sum_heuristic.h +++ b/src/search/landmarks/landmark_sum_heuristic.h @@ -10,7 +10,8 @@ class LandmarkSumHeuristic : public LandmarkHeuristic { std::vector min_first_achiever_costs; std::vector min_possible_achiever_costs; - int get_min_cost_of_achievers(const std::set &achievers) const; + int get_min_cost_of_achievers( + const std::unordered_set &achievers) const; void compute_landmark_costs(); int get_heuristic_value(const State &ancestor_state) override;