From 379dd61b02fe53794dc9431d2fe8465a59377dc4 Mon Sep 17 00:00:00 2001 From: ClemensBuechner Date: Wed, 17 Jan 2024 18:35:31 +0100 Subject: [PATCH] Ignore effects achieving true facts of future landmarks when preferring operators. --- src/search/landmarks/landmark_heuristic.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/search/landmarks/landmark_heuristic.cc b/src/search/landmarks/landmark_heuristic.cc index becb9e25cd..f208ca7b8f 100644 --- a/src/search/landmarks/landmark_heuristic.cc +++ b/src/search/landmarks/landmark_heuristic.cc @@ -125,17 +125,20 @@ void LandmarkHeuristic::generate_preferred_operators( OperatorProxy op = task_proxy.get_operators()[op_id]; EffectsProxy effects = op.get_effects(); for (EffectProxy effect : effects) { - if (!does_fire(effect, state)) + if (!does_fire(effect, state)) { continue; - FactProxy fact_proxy = effect.get_fact(); - LandmarkNode *lm_node = lm_graph->get_node(fact_proxy.get_pair()); + } + FactPair fact = effect.get_fact().get_pair(); + if (state[fact.var].get_value() == fact.value) { + continue; + } + LandmarkNode *lm_node = lm_graph->get_node(fact); if (lm_node && future.test(lm_node->get_id())) { set_preferred(op); } - if (lm_graph->contains_conjunctive_landmark( - fact_proxy.get_pair())) { + if (lm_graph->contains_conjunctive_landmark(fact)) { vector conjunctive_landmarks = - lm_graph->get_conjunctive_landmarks(fact_proxy.get_pair()); + lm_graph->get_conjunctive_landmarks(fact); for (auto conj_lm : conjunctive_landmarks) { if (future.test(conj_lm->get_id())) { set_preferred(op);