-
Notifications
You must be signed in to change notification settings - Fork 1
/
get_mitrovic_instances.py
29 lines (24 loc) · 1.45 KB
/
get_mitrovic_instances.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
import os
import sys
import requests
links = [
"http://www.sfu.ca/~snezanam/personal/PDPTW/TestInstances/Rnd6_1h-2h-4h-6h-7h-Req/Rnd6_10h_500_000.txt",
"http://www.sfu.ca/~snezanam/personal/PDPTW/TestInstances/Rnd6_1h-2h-4h-6h-7h-Req/Rnd6_10h_500_001.txt",
"http://www.sfu.ca/~snezanam/personal/PDPTW/TestInstances/Rnd6_1h-2h-4h-6h-7h-Req/Rnd6_10h_500_002.txt",
"http://www.sfu.ca/~snezanam/personal/PDPTW/TestInstances/Rnd6_1h-2h-4h-6h-7h-Req/Rnd6_10h_500_003.txt",
"http://www.sfu.ca/~snezanam/personal/PDPTW/TestInstances/Rnd6_1h-2h-4h-6h-7h-Req/Rnd6_10h_500_004.txt",
"http://www.sfu.ca/~snezanam/personal/PDPTW/TestInstances/Rnd6_1h-2h-4h-6h-7h-Req/Rnd6_10h_500_005.txt",
"http://www.sfu.ca/~snezanam/personal/PDPTW/TestInstances/Rnd6_1h-2h-4h-6h-7h-Req/Rnd6_10h_500_006.txt",
"http://www.sfu.ca/~snezanam/personal/PDPTW/TestInstances/Rnd6_1h-2h-4h-6h-7h-Req/Rnd6_10h_500_007.txt",
"http://www.sfu.ca/~snezanam/personal/PDPTW/TestInstances/Rnd6_1h-2h-4h-6h-7h-Req/Rnd6_10h_500_008.txt",
"http://www.sfu.ca/~snezanam/personal/PDPTW/TestInstances/Rnd6_1h-2h-4h-6h-7h-Req/Rnd6_10h_500_009.txt"
]
for link in links:
result = requests.get(link)
print(result.text)
file_name = link.split("/")[-1]
file_location = "./test_instances/input_files/Mitrovic-Minic/"
if (len(sys.argv) > 1):
file_location = sys.argv[1]
with open(os.path.join(file_location, file_name), "w") as f:
f.write(result.text)