-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.py
41 lines (39 loc) · 940 Bytes
/
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
40
41
import argparse
import multiprocessing as mp
from args import Args
from alphatsp.experiments import (
nearestneighbor,
mcts,
exact,
gurobi,
insertion,
policy,
parallel,
selfplay
)
def main(args):
a = Args()
if args.experiment == "nearestneighbor":
nearestneighbor.run(a)
elif args.experiment == "mcts":
mcts.run(a)
elif args.experiment == "exact":
exact.run(a)
elif args.experiment == "gurobi":
gurobi.run(a)
elif args.experiment == "insertion":
insertion.run(a)
elif args.experiment == "policy":
policy.run(a)
elif args.experiment == "parallel":
parallel.run(a)
elif args.experiment == "selfplay":
selfplay.run(a)
else:
raise ValueError("Invalid experiment selection.")
if __name__ == "__main__":
mp.set_start_method('spawn', force=True)
parser = argparse.ArgumentParser()
parser.add_argument("--experiment", type=str, required=True, help="experiment name")
args = parser.parse_args()
main(args)