Keep the correct lane on road

Multi tool use


Keep the correct lane on road
I am trying to make a Traffic Simulator for my bachelor thesis.
I created a map with OpenStreetMap osm and now i am trying to put some cars on roads.
I created a graph for the roads. The graph is like this:
A->B,C,D
C->A,B,E
B->A,C
D->A
E->C
and I generate random the cars on random points A,B,C,D,E,F. After this i use function getShortestPath(start,end)
to get the shortest path for every car and I put the cars to move: foreach(Car c in allCars){Move(c,path)}
getShortestPath(start,end)
foreach(Car c in allCars){Move(c,path)}
But, i have a problem, i don't know how to keep the correct lane of road for every car, all my cars are on the same lane of road.
I am thinking about the direction between two points and the car will be at the right side of the direction.
But I have no idea how to do this....
Thank you!
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.