Ryan’s Status Report 4/10/21

This week I continued working on our data analysis program. I wrote the speed limit function which uses GPS coordinates and the speed of the vehicle to check whether the car is exceeding the speed limit. The function makes an API call with the GPS coordinates to get a “placeId” for each pair of coordinates. We make another API call using this placeId to get the speed limit of the road associated with it. We then compare the speed limit with our current speed to identify whether the car is speeding. Because each API call costs money, I added some database functionality that saves the speed limit associated with each placeId. This enables us to bypass the second API call if we have been in that location before. I am also in the process of adding functionality to save the GPS coordinates associated with each placeId so that we can bypass the first API call if we receive coordinates that we have received before. However, because of the accuracy of the GPS, I do not believe we will always get the same exact coordinates even if we are in the same place, which is why I implemented the placeId –> speed limit association first. Additionally, I refactored the analysis program to use threading for each of our separate efficiency/infraction checks instead of the checks happening sequentially. This is because they are all independent work, and I predict the speed limit function will take relatively longer than the other functions because it will have to wait on responses to the API calls. I do not want the speed limit check to be a bottleneck for the other functions, so threading seemed like the best option to avoid this issue. In order to implement the threading properly, I had to break up the main function into separate functions so that each thread calls a unique function for the separate checks our program makes.

Leave a Reply

Your email address will not be published. Required fields are marked *