How can I imagine a road system in software?

I am looking to model traffic as a side project, but I am having problems with ideas on how I should represent the road. I like the idea of ​​using a series of waypoints (straight lines using lat / long coords), but with this method it seems difficult to imagine different lanes. I also looked at some other traffic modeling issues, and one of them mentions the use of a bitmap, but I am having problems deciding how it will allow me to easily assign real-world lengths to road segments and lane widths, etc. Does anyone have helpful hints or other ideas that would allow the car to exist at a certain point on the road and be able to switch lanes, etc.?

+3
source share
3 answers

I would start with a grid of related nodes. A node will be a change in the state of the road, for example, an intersection, a start or end lane, an extension of the road itself, etc. Either you make complex connections that store all the information (lanes in both directions: how many lanes in the direction? Lane, etc.) or you save one connection for each lane. To make sure that 2 connections on opposite sides of a node are connected to the same strip, you can use node-based lane identifiers.

Thus, you have a graph on which you can run calculations, and you have all the data to visualize the entire network.

+2
source

, , "" .

, . .

? , , , , , .

, , , , , , .

+1

, . , Logical Road Network, , .

, , . , . .

, , , , .

*------*------*
|\     |\     |
| \    | \    |
|  \   |  \   |
|   \  |   \  |
|    \ |    \ |
|     \|     \|
*------*------*

* - , 4 .

. , , ( ). , , , , . , , , .

, , , , : -)

+1
source

All Articles