Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
a4becea
set build_configs and aliases for prototype.
SimonDold Jul 22, 2025
87afabd
add factory for EagerSearch.
SimonDold Jul 23, 2025
2c2bfe3
simplify search commons
SimonDold Jul 24, 2025
59c14e1
add factory for tiebreakingopenlist(factory).
SimonDold Jul 24, 2025
0cfa0a9
remove lm_cut from prototype.
SimonDold Jul 24, 2025
b01b8c5
add factory for evaluators.
SimonDold Jul 24, 2025
c6a89a3
squash with previous.
SimonDold Jul 24, 2025
d64c0ce
simplify key.
SimonDold Jul 25, 2025
83f2e43
simplify depth
SimonDold Jul 25, 2025
d2cc749
add alias
SimonDold Jul 25, 2025
28a74bb
fix reusing indentation.
SimonDold Jul 25, 2025
3cb8c30
reduce diff to main
SimonDold Jul 25, 2025
5908362
comment
SimonDold Jul 25, 2025
2668af3
fix depth in get_task_specific call.
SimonDold Jul 25, 2025
c5f0f1b
reduce includes.
SimonDold Jul 25, 2025
2a7fe80
naming (reduce diff)
SimonDold Jul 25, 2025
310199c
add [[maybe_unused]] to blind.
SimonDold Jul 25, 2025
0a311c0
add more [[maybe_unused]]
SimonDold Jul 25, 2025
3b73dc8
remove unused field.
SimonDold Jul 25, 2025
97db67e
adjust component class to meeting comments (visibility, names, key)
SimonDold Jul 25, 2025
5fbd724
add factory for iterated search.
SimonDold Jul 25, 2025
695e868
reduce zombie code.
SimonDold Jul 27, 2025
ad65442
reduce zombie code
SimonDold Jul 28, 2025
29f53ca
some templating
SimonDold Jul 29, 2025
397e86c
make create_task_specific uniform.
SimonDold Jul 29, 2025
4b6c0a5
style.
SimonDold Jul 29, 2025
e3c5718
some cleanup
SimonDold Jul 29, 2025
633f7b4
remove zombie code
SimonDold Jul 29, 2025
d46d420
unify create_task_specific on weighted_eval
SimonDold Jul 29, 2025
92351c8
minor cleanups
SimonDold Jul 29, 2025
2d3dcf6
simplify create_task_specific.
SimonDold Aug 1, 2025
e54f6af
some working state
SimonDold Aug 3, 2025
a4e0a5a
add args wrapping.
SimonDold Aug 7, 2025
edf22ac
remove zombie code.
SimonDold Aug 7, 2025
8b4d17f
reduce diff.
SimonDold Aug 7, 2025
fbb13c1
remove unused code.
SimonDold Aug 7, 2025
901c36b
add comment.
SimonDold Aug 8, 2025
0eb19fb
add lmcut to prototype.
SimonDold Aug 8, 2025
79ba6c0
uncrustify
SimonDold Aug 8, 2025
6937fbc
reduce diff.
SimonDold Aug 8, 2025
d5c7681
Merge branch 'main' into issue559-2025
SimonDold Aug 8, 2025
18a5e04
prep style
SimonDold Aug 8, 2025
9bd9b8b
style
SimonDold Aug 8, 2025
7b19140
using TaskIndependentGEvaluator.
SimonDold Aug 8, 2025
602fe07
style
SimonDold Aug 8, 2025
3ecaf4c
minor renaming
SimonDold Aug 8, 2025
bc1a96d
deal with forward decalration.
SimonDold Sep 5, 2025
b1e5990
use WrapArgs to reduce diff.
SimonDold Sep 6, 2025
f53eb35
tox style
SimonDold Sep 6, 2025
724df1e
fix comment.
SimonDold Sep 6, 2025
d12b0c9
reduce diff by adding conditional wrapping in options and plugin.
SimonDold Sep 6, 2025
f4b59a5
reduce diff by adding more conditional wrapping to plugin.
SimonDold Sep 6, 2025
b6215a6
reduce diff by adding variadic constructor.
SimonDold Sep 6, 2025
23f6598
deal with forward declaration in a cleaner way.
SimonDold Sep 7, 2025
b388842
delay wrapping.
SimonDold Sep 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion build_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,16 @@
glibcxx_debug = ["-DCMAKE_BUILD_TYPE=Debug", "-DUSE_LP=NO", "-DUSE_GLIBCXX_DEBUG=YES"]
minimal = ["-DCMAKE_BUILD_TYPE=Release", "-DDISABLE_LIBRARIES_BY_DEFAULT=YES"]

DEFAULT = "release"
prototype = ["-DCMAKE_BUILD_TYPE=Release",
"-DDISABLE_LIBRARIES_BY_DEFAULT=YES",
"-DLIBRARY_ITERATED_SEARCH_ENABLED=YES",
"-DLIBRARY_CORE_TASKS_ENABLED=YES",
"-DLIBRARY_PLUGIN_EAGER_ENABLED=YES",
"-DLIBRARY_PLUGIN_ASTAR_ENABLED=YES",
"-DLIBRARY_LANDMARK_CUT_HEURISTIC_ENABLED=YES",
"-DLIBRARY_BLIND_SEARCH_HEURISTIC_ENABLED=YES",
]

DEFAULT = "prototype"
#DEFAULT = "release"
DEBUG = "debug"
113 changes: 113 additions & 0 deletions driver/aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,119 @@ def _get_lama(pref):
ALIASES["seq-opt-lmcut"] = [
"--search", "astar(lmcut())"]

# issue559

ALIASES["issue559_testA"] = [
"--search",
" eager(open=tiebreaking([blind()]))"
" "] # TODO issue559 remove this
ALIASES["issue559_testB"] = [
"--search",
" let(h, blind(description=\"MyBlind\"), eager(open=tiebreaking([sum([h,h,h]),h])))"
" "] # TODO issue559 remove this
ALIASES["issue559_testC"] = [
"--search",
"let(h, blind(description=\"AllTimeBlind\"),"
" iterated([astar(description=\"ASTAR_1\",eval=h),"
" eager(tiebreaking([sum([g(\"my_G_Eval\"), "
" h]), "
" h],"
" unsafe_pruning=false"
" ),"
" reopen_closed=true,"
" f_eval=sum([g(), "
" h]))"
" ]))"] # TODO issue559 remove this
ALIASES["issue559_test0"] = [
"--search",
"let(h, lmcut(description=\"AllTimeLMcut\"),"
" eager(tiebreaking([sum([g(\"my_G_Eval\"), "
" h]), "
" h],"
" unsafe_pruning=false"
" ),"
" reopen_closed=true,"
" f_eval=sum([g(), "
" h]))"
" )"] # TODO issue559 remove this
ALIASES["issue559_test1"] = [
"--search",
"let(h, lmcut(description=\"AllTimeLMcut\"),"
" iterated([astar(description=\"ASTAR_1\",eval=h),"
" eager(tiebreaking([sum([g(\"my_G_Eval\"), "
" h]), "
" h],"
" unsafe_pruning=false"
" ),"
" reopen_closed=true,"
" f_eval=sum([g(), "
" h]))"
" ]))"] # TODO issue559 remove this
ALIASES["issue559_test2"] = [
"--search",
"let(h, lmcut(description=\"AllTimeLMcut\"),"
" iterated([astar(description=\"ASTAR_1\",eval=h),"
" eager(tiebreaking([sum([g(\"my_G_Eval\"), "
" h]), "
" h],"
" unsafe_pruning=false"
" ),"
" reopen_closed=true,"
" f_eval=sum([g(), "
" h])),"
" eager(tiebreaking([sum([g(), "
" blind()]), "
" blind()],"
" unsafe_pruning=false"
" )"
" ,description=\"eager3\")"
" ],pass_bound=false))"] # TODO issue559 remove this
ALIASES["issue559_test3"] = [
"--search",
"let(h, lmcut(description=\"AllTimeLMcut\"),"
" iterated([astar(description=\"ASTAR_1\",eval=h),"
" eager(tiebreaking([sum([g(\"my_G_Eval\"), "
" h]), "
" h],"
" unsafe_pruning=false"
" ),"
" reopen_closed=true,"
" f_eval=sum([g(), "
" h])),"
" eager(tiebreaking([sum([g(), "
" blind(transform=adapt_costs(normal))]), "
" blind()],"
" unsafe_pruning=false"
" )"
" ,description=\"eager3\")"
" ],pass_bound=false))"] # TODO issue559 remove this
ALIASES["issue559_test4"] = [
"--search",
"let(h, lmcut(description=\"AllTimeLMcut\"),"
" iterated("
"[iterated([astar(description=\"ASTAR_1\",eval=h),"
" eager(tiebreaking([sum([g(\"my_G_Eval\"), "
" h]), "
" h],"
" unsafe_pruning=false"
" ),"
" reopen_closed=true,"
" f_eval=sum([g(), "
" h]))"
"],pass_bound=false), iterated(["
" eager(tiebreaking([sum([g(), "
" blind(transform=adapt_costs(normal))]), "
" blind()],"
" unsafe_pruning=false"
" )"
" ,description=\"eager3\")"
" ])"
"],pass_bound=false))"] # TODO issue559 remove this


# issue559



PORTFOLIOS = {}
for portfolio in PORTFOLIO_DIR.iterdir():
Expand Down
4 changes: 2 additions & 2 deletions src/search/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,9 @@ create_fast_downward_library(
SOURCES
search_algorithms/search_common
DEPENDS
alternation_open_list
#issue559 #alternation_open_list
g_evaluator
best_first_open_list
#issue559 #best_first_open_list
sum_evaluator
tiebreaking_open_list
weighted_evaluator
Expand Down
22 changes: 12 additions & 10 deletions src/search/command_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,21 @@ static vector<string> replace_old_style_predefinitions(
return new_args;
}

static shared_ptr<SearchAlgorithm> parse_cmd_line_aux(
const vector<string> &args) {
static shared_ptr<TaskIndependentComponentType<SearchAlgorithm>>
parse_cmd_line_aux(const vector<string> &args) {
string plan_filename = "sas_plan";
int num_previously_generated_plans = 0;
bool is_part_of_anytime_portfolio = false;

using SearchPtr = shared_ptr<SearchAlgorithm>;
SearchPtr search_algorithm = nullptr;
using TISearchPtr =
shared_ptr<TaskIndependentComponentType<SearchAlgorithm>>;
TISearchPtr ti_search_algorithm = nullptr;
// TODO: Remove code duplication.
for (size_t i = 0; i < args.size(); ++i) {
const string &arg = args[i];
bool is_last = (i == args.size() - 1);
if (arg == "--search") {
if (search_algorithm)
if (ti_search_algorithm)
input_error("multiple --search arguments defined");
if (is_last)
input_error("missing argument after --search");
Expand All @@ -108,7 +109,8 @@ static shared_ptr<SearchAlgorithm> parse_cmd_line_aux(
parser::ASTNodePtr parsed = parser::parse(tokens);
parser::DecoratedASTNodePtr decorated = parsed->decorate();
plugins::Any constructed = decorated->construct();
search_algorithm = plugins::any_cast<SearchPtr>(constructed);
ti_search_algorithm =
plugins::any_cast<TISearchPtr>(constructed);
} catch (const plugins::BadAnyCast &) {
input_error(
"Could not interpret the argument of --search as a search algorithm.");
Expand Down Expand Up @@ -165,18 +167,18 @@ static shared_ptr<SearchAlgorithm> parse_cmd_line_aux(
}
}

if (search_algorithm) {
PlanManager &plan_manager = search_algorithm->get_plan_manager();
if (ti_search_algorithm) {
PlanManager &plan_manager = ti_search_algorithm->get_plan_manager();
plan_manager.set_plan_filename(plan_filename);
plan_manager.set_num_previously_generated_plans(
num_previously_generated_plans);
plan_manager.set_is_part_of_anytime_portfolio(
is_part_of_anytime_portfolio);
}
return search_algorithm;
return ti_search_algorithm;
}

shared_ptr<SearchAlgorithm> parse_cmd_line(
shared_ptr<TaskIndependentComponentType<SearchAlgorithm>> parse_cmd_line(
int argc, const char **argv, bool is_unit_cost) {
vector<string> args;
bool active = true;
Expand Down
6 changes: 4 additions & 2 deletions src/search/command_line.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
#include <memory>
#include <string>

template<typename T>
class TaskIndependentComponentType;
class SearchAlgorithm;

extern std::shared_ptr<SearchAlgorithm> parse_cmd_line(
int argc, const char **argv, bool is_unit_cost);
extern std::shared_ptr<TaskIndependentComponentType<SearchAlgorithm>>
parse_cmd_line(int argc, const char **argv, bool is_unit_cost);

extern std::string get_revision_info();
extern std::string get_usage(const std::string &progname);
Expand Down
Loading
Loading