Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. Routing is the algorithm that incorporates new passengers into the current paths of taxis. It does this via BFS from the passengers point in the graph.\\
  2. If the taxi is full, it will search for the next closest taxi. When it finds a taxi that isn't full, it looks to the destinations of the taxi. The algorithm will find the closest destination to the pick up-node. If that node is the same as a existing destination then it will add the pick-up node to the path of the taxi after the destination. If not, it will simulate two new paths with the pick-up node of the new passengers before the closest destination in the first array, and after the closest destination in the second array. Then it will calculate the stress of both arrays. The array with the lowest stress will be used further. If both arrays have the same amount of stress we will use the first array. Next we need to add the drop-off node of the passenger to the destinations of the taxi. This is done by using the new array with the drop-off included. We recalculate the closest destination and add this again to two copied arrays, before and after the closest found destination. The taxi now moves on according to the recalculated path.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement