Commit d773bb59 authored by danfis's avatar danfis

bin/fdr: largest-first is made default

parent c555ca9b
...@@ -21,8 +21,7 @@ struct options { ...@@ -21,8 +21,7 @@ struct options {
int no_h2; int no_h2;
int no_irr; int no_irr;
int fdr_var_largest; unsigned fdr_var_method;
int fdr_var_largest_multi;
const char *fdr_out; const char *fdr_out;
const char *lifted_mgroup_out; const char *lifted_mgroup_out;
...@@ -61,6 +60,21 @@ static void closeFile(FILE *f) ...@@ -61,6 +60,21 @@ static void closeFile(FILE *f)
fclose(f); fclose(f);
} }
static void setFDRVarLargest(const char *ln, const char *sn)
{
opt.fdr_var_method = PDDL_FDR_VARS_LARGEST_FIRST;
}
static void setFDRVarEssential(const char *ln, const char *sn)
{
opt.fdr_var_method = PDDL_FDR_VARS_ESSENTIAL_FIRST;
}
static void setFDRVarLargestMulti(const char *ln, const char *sn)
{
opt.fdr_var_method = PDDL_FDR_VARS_LARGEST_FIRST_MULTI;
}
static int readOpts(int *argc, char *argv[]) static int readOpts(int *argc, char *argv[])
{ {
bzero(&opt, sizeof(opt)); bzero(&opt, sizeof(opt));
...@@ -68,6 +82,8 @@ static int readOpts(int *argc, char *argv[]) ...@@ -68,6 +82,8 @@ static int readOpts(int *argc, char *argv[])
opt.lifted_mgroup_max_mgroups = 10000; opt.lifted_mgroup_max_mgroups = 10000;
opt.fdr_out = "-"; opt.fdr_out = "-";
opt.fdr_var_method = PDDL_FDR_VARS_LARGEST_FIRST;
pddl_cfg.force_adl = 1; pddl_cfg.force_adl = 1;
optsAddDesc("help", 'h', OPTS_NONE, &opt.help, NULL, optsAddDesc("help", 'h', OPTS_NONE, &opt.help, NULL,
...@@ -127,11 +143,15 @@ static int readOpts(int *argc, char *argv[]) ...@@ -127,11 +143,15 @@ static int readOpts(int *argc, char *argv[])
"Output filename for the mutex groups found before pruning." "Output filename for the mutex groups found before pruning."
" (default: none)"); " (default: none)");
optsAddDesc("fdr-var-largest", 0x0, OPTS_NONE, &opt.fdr_var_largest, NULL, optsAddDesc("var-largest", 0x0, OPTS_NONE, NULL,
OPTS_CB(setFDRVarLargest),
"Allocate FDR variables with largest-first algorithm" "Allocate FDR variables with largest-first algorithm"
" (instead of essential-first)."); " (default).");
optsAddDesc("fdr-var-largest-multi", 0x0, OPTS_NONE, optsAddDesc("var-essential", 0x0, OPTS_NONE, NULL,
&opt.fdr_var_largest_multi, NULL, OPTS_CB(setFDRVarEssential),
"Allocate FDR variables with the essential-first algorithm.");
optsAddDesc("var-largest-multi", 0x0, OPTS_NONE, NULL,
OPTS_CB(setFDRVarLargestMulti),
"Allocate FDR variables with largest-first algorithm and" "Allocate FDR variables with largest-first algorithm and"
" encode one strips fact as multiple fdr values if in more" " encode one strips fact as multiple fdr values if in more"
" mutex groups."); " mutex groups.");
...@@ -432,11 +452,7 @@ static int toFDR(void) ...@@ -432,11 +452,7 @@ static int toFDR(void)
BOR_INFO2(&err, "Translating to FDR ..."); BOR_INFO2(&err, "Translating to FDR ...");
BOR_INFO(&err, "Output file: '%s'", opt.fdr_out); BOR_INFO(&err, "Output file: '%s'", opt.fdr_out);
fdr_var_flag = PDDL_FDR_VARS_ESSENTIAL_FIRST; fdr_var_flag = opt.fdr_var_method;
if (opt.fdr_var_largest)
fdr_var_flag = PDDL_FDR_VARS_LARGEST_FIRST;
if (opt.fdr_var_largest_multi)
fdr_var_flag = PDDL_FDR_VARS_LARGEST_FIRST_MULTI;
FILE *fout = openFile(opt.fdr_out); FILE *fout = openFile(opt.fdr_out);
if (fout == NULL){ if (fout == NULL){
fprintf(stderr, "Error: Could not open file '%s'\n", opt.fdr_out); fprintf(stderr, "Error: Could not open file '%s'\n", opt.fdr_out);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment