-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.py
67 lines (56 loc) · 2.19 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
__author__ = 'Tony'
from Gis import Gis
class Main:
def main(self):
g_system = Gis()
g_system.selectAllCities()
g_system.selectAllEdges()
delim = '\n*************************************'
print('#### EXPERIMENT 1 ####')
print('g_system.printCities(\'name\', \'S\')')
g_system.printCities('name', 'S')
print(delim)
print('# print full display')
print('g_system.printCities(\'population\', \'F\')')
g_system.printCities('population', 'F')
print(delim)
print('#### EXPERIMENT 2 ####')
print('# select all cities with latitudes between 40N and 50N'
'\n# and longitudes between 85W and 130W.')
g_system.selectCities('latitude', 40, 50)
g_system.selectCities('longitude', 85, 130)
print('Population distribution of cities with latitudes between 40N and 50N'
'\nand longitudes between 85W and 130W')
g_system.printCities('population', 'F')
print(delim)
print('#### EXPERIMENT 3 ####')
print('# print the most populated states in increasing'
'\norder of population')
g_system.printCities('population', 'F')
print(delim)
print('#### EXPERIMENT 4 ####')
print('g_system.testMinMaxConsDistance')
g_system.testMinMaxConsDistance()
g_system.selectAllEdges()
g_system.selectAllCities()
g_system.testMinMaxConsDistance()
print(delim)
print('#### EXPERIMENT 5 ####')
print('# print TSP tour starting from Yakima, WA, with'
'\n# exactly 4 cities on each line except possibly the'
'\n# last line.')
print('g_system.selectAllCities()')
print('g_system.selectAllEdges()')
print('g_system.tour(\'Yakima, WA\')')
g_system.selectAllCities()
g_system.selectAllEdges()
g_system.tour('Yakima, WA')
print(delim)
print('g_system.unselectAllEdges()')
print('g_system.tour(\'Yakima, WA\')')
g_system.unselectAllEdges()
g_system.tour('Yakima, WA')
print(delim)
print('This concludes all of the experiments')
main = Main()
main.main()