From 2ffb77c910f19eac2af058e89b544ee9441fc0d5 Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Thu, 12 Sep 2024 14:19:22 +0200 Subject: [PATCH] Prune initial state if bound=0. --- src/search/search_algorithm.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/search/search_algorithm.cc b/src/search/search_algorithm.cc index ee9f30811..61c41d80c 100644 --- a/src/search/search_algorithm.cc +++ b/src/search/search_algorithm.cc @@ -86,12 +86,17 @@ void SearchAlgorithm::set_plan(const Plan &p) { void SearchAlgorithm::search() { initialize(); utils::CountdownTimer timer(max_time); - while (status == IN_PROGRESS) { - status = step(); - if (timer.is_expired()) { - log << "Time limit reached. Abort search." << endl; - status = TIMEOUT; - break; + if (bound == 0) { + log << "Initial state is pruned because the g-bound is 0." << endl; + status = FAILED; + } else { + while (status == IN_PROGRESS) { + status = step(); + if (timer.is_expired()) { + log << "Time limit reached. Abort search." << endl; + status = TIMEOUT; + break; + } } } // TODO: Revise when and which search times are logged.