summaryrefslogtreecommitdiffstats
path: root/parse.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-06-12 16:02:07 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-06-16 09:02:11 -0400
commitbf063268ea9a11bc5413864626a4b945b1ecf80b (patch)
tree5b12dd6d045b6a7ea8df8e7845df9e7d2a675ba7 /parse.c
parent8cf40eeaf953b1c2f5c097623572948c4630ee39 (diff)
downloadbfs-bf063268ea9a11bc5413864626a4b945b1ecf80b.tar.xz
Implement exponential deepening search
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/parse.c b/parse.c
index 0faedf4..f990a69 100644
--- a/parse.c
+++ b/parse.c
@@ -2261,6 +2261,8 @@ static struct expr *parse_search_strategy(struct parser_state *state, int arg1,
cmdline->strategy = BFTW_DFS;
} else if (strcmp(arg, "ids") == 0) {
cmdline->strategy = BFTW_IDS;
+ } else if (strcmp(arg, "eds") == 0) {
+ cmdline->strategy = BFTW_EDS;
} else if (strcmp(arg, "help") == 0) {
state->just_info = true;
cfile = cmdline->cout;
@@ -2277,6 +2279,7 @@ list_strategies:
cfprintf(cfile, " ${bld}bfs${rs}: breadth-first search\n");
cfprintf(cfile, " ${bld}dfs${rs}: depth-first search\n");
cfprintf(cfile, " ${bld}ids${rs}: iterative deepening search\n");
+ cfprintf(cfile, " ${bld}eds${rs}: exponential deepening search\n");
return NULL;
}
@@ -2657,9 +2660,10 @@ static struct expr *parse_help(struct parser_state *state, int arg1, int arg2) {
cfprintf(cout, " ${cyn}-D${rs} ${bld}FLAG${rs}\n");
cfprintf(cout, " Turn on a debugging flag (see ${cyn}-D${rs} ${bld}help${rs})\n");
cfprintf(cout, " ${cyn}-O${bld}N${rs}\n");
- cfprintf(cout, " Enable optimization level ${bld}N${rs} (default: 3)\n");
- cfprintf(cout, " ${cyn}-S${rs} ${bld}bfs${rs}|${bld}dfs${rs}|${bld}ids${rs}\n");
- cfprintf(cout, " Use ${bld}b${rs}readth-${bld}f${rs}irst/${bld}d${rs}epth-${bld}f${rs}irst/${bld}i${rs}terative ${bld}d${rs}eepening ${bld}s${rs}earch (default: ${cyn}-S${rs} ${bld}bfs${rs})\n\n");
+ cfprintf(cout, " Enable optimization level ${bld}N${rs} (default: ${bld}3${rs})\n");
+ cfprintf(cout, " ${cyn}-S${rs} ${bld}bfs${rs}|${bld}dfs${rs}|${bld}ids${rs}|${bld}eds${rs}\n");
+ cfprintf(cout, " Use ${bld}b${rs}readth-${bld}f${rs}irst/${bld}d${rs}epth-${bld}f${rs}irst/${bld}i${rs}terative/${bld}e${rs}xponential ${bld}d${rs}eepening ${bld}s${rs}earch\n");
+ cfprintf(cout, " (default: ${cyn}-S${rs} ${bld}bfs${rs})\n\n");
cfprintf(cout, "${bld}Operators:${rs}\n\n");
@@ -3408,6 +3412,9 @@ void dump_cmdline(const struct cmdline *cmdline, enum debug_flags flag) {
case BFTW_IDS:
strategy = "ids";
break;
+ case BFTW_EDS:
+ strategy = "eds";
+ break;
}
assert(strategy);
cfprintf(cerr, "${cyn}-S${rs} ${bld}%s${rs} ", strategy);