Browse Source

added instance name and ext_nr to result csv

master
Tom Krüger 4 years ago
parent
commit
a9fe4f1ae0
1 changed files with 16 additions and 2 deletions
  1. +16
    -2
      main.py

+ 16
- 2
main.py View File

@ -58,18 +58,32 @@ def parse_result(res_str):
return res
def parse_instance_path(ipath):
name = pl.Path(ipath).name.strip()
ext_nr = int(name[:-len(".cnf.bz2")][-4:])
instance = name[:-len("_0000.cnf.bz2")]
return instance, ext_nr
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--instance", help="The instance.")
args = parser.parse_args()
res_str = run_alg(args.instance)
iname, ext_nr = parse_instance_path(args.instance)
res = parse_result(res_str)
res_vals = [iname, str(ext_nr)] + list(map(str, res.values()))
print(','.join(map(str, res.values())))
print(','.join(res_vals))


Loading…
Cancel
Save