diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2020-06-12 16:02:07 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2020-06-16 09:02:11 -0400 |
commit | bf063268ea9a11bc5413864626a4b945b1ecf80b (patch) | |
tree | 5b12dd6d045b6a7ea8df8e7845df9e7d2a675ba7 /parse.c | |
parent | 8cf40eeaf953b1c2f5c097623572948c4630ee39 (diff) | |
download | bfs-bf063268ea9a11bc5413864626a4b945b1ecf80b.tar.xz |
Implement exponential deepening search
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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); |