-
Notifications
You must be signed in to change notification settings - Fork 0
/
p2q1_main.py
36 lines (23 loc) · 980 Bytes
/
p2q1_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
# p2q1_main.py v1.0
from utility import *
from p2q1 import *
import copy
# do not submit this file. You may modify this file, but your final solution in p2q1.py should run with this original main file
# replace these parameters with different csv file locations
flags_csv = "./data/flags_m4.csv" # <-- change!!!!
p = 500 # <-- change!!!!
v = 1 # <-- change!!!! 1 (non-cycle) or 2 (cycle)
flags = list_reader(flags_csv)
flags_dict = generate_flags_dict(flags)
# call your function
your_route = get_route(p, v, flags)
# print results or error msg (if any)
err_msg, dist, points = get_dist_and_points_q1(your_route, flags_dict, v)
if err_msg !=None:
print("Error : " + err_msg)
else:
print("Points for this route :" + str(points) + ", p :" + str(p))
if points < p:
print("Error : points is lesser than p!")
else:
print("Quality score (dist) for q1 is : " + str(dist)) # smaller score is better