Uploaded by 鄭博仁

report

advertisement
Homework 2: Route Finding
Report
Please keep the title of each section and delete examples. Note that please keep the questions liste
d in Part III.
Part I. Implementation (6%):
● Please screenshot your code snippets of Part 1 ~ Part 4, and explain your implementation.
(The explination are all in the beginning of the code)
Part1 : BFS
Part2 : DFS(stack)
Part3 : UCS
Part4 : A*
Part6 : A*_time
Part II. Results & Analysis (12%):
● Please screenshot the results. For instance,
Test1: from National Yang Ming Chiao Tung University (ID: 2270143902)
to Big City Shopping Mall (ID: 1079387396)
BFS:
DFS (stack):
UCS:
A*:
A*_time:
Test2: from Hsinchu Zoo(ID: 426882161)
to COSTCO Hsinchu Store(ID: 1737223506)
BFS:
DFS(stack):
UCS:
A*:
A*_time:
Test3: from National Experimental High SchoolAt Hsinchu Science Park(ID: 1718165260)
to Nanliao Fighing Port(ID: 8513026827)
BFS:
DFS:
UCS:
A*:
A*_time:
Part III. Question Answering (12%):
1.Please describe a problem you encountered and how you solved it.
The data in the csv files are string type so I didnt know how to store them at first. Then I find I can
import “defaultdict”to make dict easier to declare, but when I need to use the value, I still need t
o change the type of them, which is the mistake I usually made this time.
2. Besides speed limit and distance, could you please come up with another attribute that is essent
ial for route finding in the real world? Please explain the rationale.
Traffic congestion: Congestion may significantly slow the speed of the traffic flow, and in most m
ap app in real life, congestion detection is installed, which use green, yellow, and red to express th
e degree of congestion.
3. As mentioned in the introduction, a navigation system involves mapping, localization, and rout
e finding. Please suggest possible solutions for mapping and localization components?
Mapping: We can use satellites to take pictures from the sky, and then organize them into maps
Localization: We can receive GPS signals from outer space through satellite receivers, and then ob
tain the received position after some geometric calculations
4. The estimated time of arrival (ETA) is one of the features of Uber Eats. To provide accurate es
timates for users, Uber Eats needs to dynamically update ETA based on their mechanism. Plea
se define a dynamic heuristic equation for ETA and explain the rationale of your design. Hint:
You can consider meal prep time, delivery priority, multiple orders, etc.
I will divide the time calculation into three parts: meal is not ready ; meal is ready but delivery per
son has not reach ; delivery person has got the meal.
heuristic function: distance/max speed
(a) Meal is not ready:
Time = sum_roads(distance/max speed) from store to user + meal prep time
(b) Meal is ready but delivery person has not reach:
Time = sum_roads(distance/max speed) from store to user + sum_roads(distance/max speed) f
rom store to delivery person
(c) Delivery person has got the meal:
Time = sum_roads(distance/max speed) from delivery person to user
Download