-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunner.py
More file actions
executable file
·34 lines (26 loc) · 1.18 KB
/
runner.py
File metadata and controls
executable file
·34 lines (26 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import argparse
from benchmarking_utils import run_fd
def main():
parser = argparse.ArgumentParser(description='Running fast-downward in different modes')
parser.add_argument("-d", "--domain", type=str, required=True)
parser.add_argument("-i", "--instance", type=str, required=True)
parser.add_argument("-m", "--mode", choices=('blind', 'lama', 'opt'), default='lama')
parser.add_argument("-v", "--verbose", action='store_true')
args = parser.parse_args()
domain = args.domain
instance = args.instance
mode = args.mode
verbose = args.verbose
modes = {'blind': "--search astar(blind())",
'lama': "--alias lama-first ",
'opt': "--alias seq-opt-lmcut"}
instance_id = instance.split("/")[-1].split(".")[0]
if 'blind' == mode:
task = f"--plan-file {instance_id}.plan --sas-file {instance_id}.sas {domain} {instance} {modes[mode]}"
else: # alias
task = f"{modes[mode]} --plan-file {instance_id}.plan --sas-file {instance_id}.sas {domain} {instance}"
plan = run_fd(task=task, instance_id=instance_id, verbose=verbose)
if plan and verbose:
print(f"{plan}")
if __name__ == "__main__":
main()