-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoptions.py
More file actions
58 lines (46 loc) · 2.38 KB
/
options.py
File metadata and controls
58 lines (46 loc) · 2.38 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import os
import argparse
from utils import coords
file_dir = os.path.dirname(__file__)
class PathFindingOptions:
def __init__(self):
self.parser = argparse.ArgumentParser(description='Multi-agent pathfinding options')
self.required = self.parser.add_argument_group('required arguments')
self.optional = self.parser.add_argument_group('optional arguments')
self.required.add_argument('--num_agents',
type = int,
help = 'number of agents to spawn into the world',
required = True)
self.required.add_argument('--starts',
type = coords,
help = 'list of x, y start coordinates for each agent',
nargs = '+',
required = True)
self.required.add_argument('--goals',
type = coords,
help = 'list of x, y goal coordinates for each agent',
nargs = '+',
required = True)
self.required.add_argument('--max_time',
type = int,
help = 'maximum amount of time each agent has to each its goal',
required = True)
self.optional.add_argument("--width",
type = int,
help = 'width of the grid',
default = 20)
self.optional.add_argument("--height",
type = int,
help = 'height of the grid',
default = 20)
self.optional.add_argument('--map_type',
type = str,
help = 'type of map to create',
default = 'combined',
choices = ['mountains', 'plains', 'canyons', 'combined'])
self.optional.add_argument('--no_viz',
help = 'if set, will not run the path finding visualization',
action = 'store_true')
def parse(self):
self.options = self.parser.parse_args()
return self.options