Skip to content

Commit

Permalink
Merge branch 'conditional_effects'
Browse files Browse the repository at this point in the history
  • Loading branch information
speckdavid committed May 2, 2024
2 parents 1fdc953 + 9739bb2 commit 78018ff
Show file tree
Hide file tree
Showing 59 changed files with 1,825 additions and 1,226 deletions.
8 changes: 4 additions & 4 deletions src/cmake_modules/FastDownwardMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ macro(fast_downward_set_compiler_flags)
# we have to fix this.
if(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag( "-std=c++14" CXX14_FOUND )
if(CXX14_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
check_cxx_compiler_flag( "-std=c++17" CXX17_FOUND )
if(CXX17_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
else()
message(FATAL_ERROR "${CMAKE_CXX_COMPILER} does not support C++14, please use a different compiler")
message(FATAL_ERROR "${CMAKE_CXX_COMPILER} does not support C++17, please use a different compiler")
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
Expand Down
8 changes: 4 additions & 4 deletions src/search/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ add_executable(downward ${PLANNER_SOURCES})

## == Includes ==

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ext)
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/ext)

## == Libraries ==

Expand Down Expand Up @@ -70,19 +70,19 @@ if(PLUGIN_LP_SOLVER_ENABLED AND USE_LP)
string(TOUPPER ${SOLVER} TMP_SOLVER_UPPER_CASE)
mark_as_advanced(TMP_SOLVER_UPPER_CASE)
add_definitions("-D COIN_HAS_${TMP_SOLVER_UPPER_CASE}")
include_directories(${OSI_${SOLVER}_INCLUDE_DIRS})
include_directories(SYSTEM ${OSI_${SOLVER}_INCLUDE_DIRS})
target_link_libraries(downward ${OSI_${SOLVER}_LIBRARIES})
endif()
endforeach()

# Note that basic OSI libs must be added after (!) all OSI solver libs.
add_definitions("-D USE_LP")
include_directories(${OSI_INCLUDE_DIRS})
include_directories(SYSTEM ${OSI_INCLUDE_DIRS})
target_link_libraries(downward ${OSI_LIBRARIES})

find_package(ZLIB REQUIRED)
if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIRS})
include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS})
target_link_libraries(downward ${ZLIB_LIBRARIES})
endif()
endif()
Expand Down
50 changes: 27 additions & 23 deletions src/search/DownwardFiles.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -806,40 +806,44 @@ fast_downward_plugin(
NAME SYMBOLIC
HELP "Plugin containing the base for symbolic search"
SOURCES
symbolic/sym_bucket
symbolic/opt_order
symbolic/sym_variables
symbolic/sym_enums
symbolic/sym_utils
symbolic/sym_state_space_manager
symbolic/transition_relation
symbolic/original_state_space
symbolic/sym_params_search
symbolic/sym_estimate
symbolic/closed_list
symbolic/frontier
symbolic/open_list
symbolic/closed_list
symbolic/searches/bidirectional_search
symbolic/searches/uniform_cost_search
symbolic/searches/sym_search
symbolic/searches/top_k_uniform_cost_search
symbolic/search_engines/symbolic_search
symbolic/search_engines/symbolic_uniform_cost_search
symbolic/search_engines/top_k_symbolic_uniform_cost_search
symbolic/search_engines/top_q_symbolic_uniform_cost_search
symbolic/opt_order
symbolic/plan_reconstruction/reconstruction_node
symbolic/plan_reconstruction/sym_solution_cut
symbolic/plan_reconstruction/sym_solution_registry
symbolic/plan_reconstruction/reconstruction_node
symbolic/plan_selection/iterative_cost_selector
symbolic/plan_selection/plan_selector
symbolic/plan_selection/top_k_selector
symbolic/plan_selection/top_k_even_selector
symbolic/plan_selection/simple_selector
symbolic/plan_selection/top_k_even_selector
symbolic/plan_selection/top_k_selector
symbolic/plan_selection/unordered_selector
symbolic/plan_selection/validation_selector
symbolic/search_engines/symbolic_search
symbolic/search_engines/symbolic_uniform_cost_search
symbolic/search_engines/top_k_symbolic_uniform_cost_search
symbolic/search_engines/top_q_symbolic_uniform_cost_search
symbolic/searches/bidirectional_search
symbolic/searches/sym_search
symbolic/searches/top_k_uniform_cost_search
symbolic/searches/uniform_cost_search
symbolic/sym_axiom/sym_axiom_compilation
symbolic/sym_bucket
symbolic/sym_enums
symbolic/sym_estimate
symbolic/sym_function_creator
DEPENDS SDAC
symbolic/sym_mutexes
symbolic/sym_parameters
symbolic/sym_state_space_manager
symbolic/sym_transition_relations
symbolic/sym_utils
symbolic/sym_variables
symbolic/transition_relations/conjunctive_transition_relation
symbolic/transition_relations/transition_relation
symbolic/transition_relations/disjunctive_transition_relation
tasks/effect_aggregated_task
DEPENDS SDAC
)

fast_downward_add_plugin_sources(PLANNER_SOURCES)
Expand Down
2 changes: 1 addition & 1 deletion src/search/symbolic/closed_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void ClosedList::insert(int h, BDD S) {
closed[h] = S;
}

if (mgr->hasTransitions0()) {
if (mgr->has_zero_cost_transition()) {
zeroCostClosed[h].push_back(S);
}
closedTotal += S;
Expand Down
3 changes: 1 addition & 2 deletions src/search/symbolic/closed_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ class ClosedList {
SymSolutionCut getCheapestCut(BDD states, int g,
bool fw) const;

std::vector<SymSolutionCut>
getAllCuts(BDD states, int g, bool fw, int lower_bound) const;
std::vector<SymSolutionCut> getAllCuts(BDD states, int g, bool fw, int lower_bound) const;

inline BDD getClosed() const {return closedTotal;}

Expand Down
22 changes: 11 additions & 11 deletions src/search/symbolic/frontier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void Frontier::set(int g, Bucket &bdd) {
}

bool Frontier::nextStepZero() const {
return !Szero.empty() || (S.empty() && mgr->hasTransitions0());
return !Szero.empty() || (S.empty() && mgr->has_zero_cost_transition());
}

Result Frontier::prepare(int maxTime, int maxNodes, bool fw,
Expand All @@ -44,10 +44,10 @@ Result Frontier::prepare(int maxTime, int maxNodes, bool fw,

if (!Smerge.empty()) {
if (Smerge.size() > 1) {
mgr->mergeBucket(Smerge, 60000, 10000000);
mgr->merge_bucket(Smerge, 60000, 10000000);
}

if (mgr->hasTransitions0()) {
if (mgr->has_zero_cost_transition()) {
S.insert(S.end(), Smerge.begin(), Smerge.end());
assert(Szero.empty());
Szero.swap(Smerge);
Expand All @@ -57,9 +57,9 @@ Result Frontier::prepare(int maxTime, int maxNodes, bool fw,
}

// If there are zero cost operators, merge S
if (mgr->hasTransitions0() && Szero.empty()) {
if (mgr->has_zero_cost_transition() && Szero.empty()) {
if (S.size() > 1) {
mgr->mergeBucket(S, 60000, 10000000);
mgr->merge_bucket(S, 60000, 10000000);
}
}

Expand Down Expand Up @@ -102,16 +102,16 @@ ResultExpansion Frontier::expand_zero(int maxTime, int maxNodes, bool fw) {
// Image with respect to 0-cost actions
utils::Timer image_time;

mgr->setTimeLimit(maxTime);
mgr->set_time_limit(maxTime);
// Compute image, storing the result on Simg
try {
for (size_t i = 0; i < Szero.size(); i++) {
Simg.push_back(map<int, Bucket>());
mgr->zero_image(fw, Szero[i], Simg[i][0], maxNodes);
}
mgr->unsetTimeLimit();
mgr->unset_time_limit();
} catch (BDDError e) {
mgr->unsetTimeLimit();
mgr->unset_time_limit();
return ResultExpansion(true, TruncatedReason::IMAGE_ZERO, image_time());
}

Expand All @@ -122,17 +122,17 @@ ResultExpansion Frontier::expand_zero(int maxTime, int maxNodes, bool fw) {

ResultExpansion Frontier::expand_cost(int maxTime, int maxNodes, bool fw) {
utils::Timer image_time;
mgr->setTimeLimit(maxTime);
mgr->set_time_limit(maxTime);
// cout << maxTime << " + " << maxNodes << endl;
try {
for (size_t i = 0; i < S.size(); i++) {
Simg.push_back(map<int, Bucket>());
mgr->cost_image(fw, S[i], Simg[i], maxNodes);
}
mgr->unsetTimeLimit();
mgr->unset_time_limit();
} catch (BDDError e) {
// Update estimation
mgr->unsetTimeLimit();
mgr->unset_time_limit();

return ResultExpansion(false, TruncatedReason::IMAGE_COST, image_time());
}
Expand Down
2 changes: 1 addition & 1 deletion src/search/symbolic/open_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using namespace std;
namespace symbolic {
void OpenList::insert(const Bucket &bucket, int g) {
assert(!bucket.empty());
copyBucket(bucket, open[g]);
copy_bucket(bucket, open[g]);
}

void OpenList::insert(const BDD &bdd, int g) {
Expand Down
3 changes: 0 additions & 3 deletions src/search/symbolic/open_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ class OpenList {
void insert(const Bucket &bucket, int g);
void insert(const BDD &bdd, int g);

void extract_states(int f, int g, Bucket &res);
void extract_states_directly(int g, Bucket &res);
void extract_states(Bucket &bucket, int f, int g, Bucket &res, bool open);
int minG() const;

int minNextG(const Frontier &frontier, int min_action_cost) const;
Expand Down
Loading

0 comments on commit 78018ff

Please sign in to comment.