-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (28 loc) · 802 Bytes
/
main.py
File metadata and controls
31 lines (28 loc) · 802 Bytes
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
#!/usr/bin/env python
import sys
import argparse
from model import *
import CoveringSolver
import generate_vrp
def main(radius = 10, filename='instances/Instance_0.txt'):
model = ProblemModel.from_file(filename)
print(model)
if 0:
res = CoveringSolver.solve_to_optimality(model, radius)
print("Opt sol found!")
return
if __name__ == '__main__':
rad = 0
if len(sys.argv) <= 1:
rad = float(input("Please enter radius: "))
else:
rad = float(sys.argv[1])
filename = ''
if len(sys.argv) <= 2:
filename = input("Enter file path: ")
else:
filename = sys.argv[2]
main(radius=rad, filename=filename)
if 0:
parser = argparse.ArgumentParser()
parser.add_argument('filename', required=True)