-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
39 lines (30 loc) · 1.02 KB
/
main.py
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
import argparse
from algorithms.single_agent import dqn
parser = argparse.ArgumentParser()
parser.add_argument("--algo",
type=str,
default="dqn",
choices=["dqn", "ppo", "iql"],
help="The algorithm to be used")
parser.add_argument("--mode",
type=str,
default="eval",
choices=["train", "eval"],
help="The mode of inference")
parser.add_argument("--agent",
type=str,
default="single",
choices=["single", "multi"],
help="Type of agents used"
)
def main():
args = parser.parse_args()
if args.agent == "single":
if args.algo == "dqn":
dqn.train() if args.mode == "train" else dqn.evaluate()
elif args.algo == "ppo":
dqn.train() if args.mode == "train" else dqn.evaluate()
else:
pass
if __name__ == '__main__':
main()