-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtask1-2test.py
37 lines (32 loc) · 1.07 KB
/
task1-2test.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
from data.data import get_coords
from main import predict_traffic_flow
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--scats",
default="4034",
help="SCATS site number.")
parser.add_argument(
"--direction",
default="E",
help="The approach to the site (N, S, E, W, NE, NW, SE)")
parser.add_argument(
"--time",
default="13:30",
help="The time in 24 hr notation")
parser.add_argument(
"--date",
default="1/10/2006",
help="The day of the month")
parser.add_argument(
"--model",
default="lstm",
help="Model to use for prediction (lstm, gru, saes)")
args = parser.parse_args()
lat, long = get_coords('data/Scats Data October 2006.csv', args.scats, args.direction)
if (lat == -1):
print(args.direction + " is not a valid direction for " + args.scats)
else:
flow_prediction = predict_traffic_flow(lat, long, args.time, args.model)
print(flow_prediction)