Rudimentary traffic simulation (with Dijkstra shortest path) in a GLGraphics-rendered city
in
Share your Work
•
6 months ago
Hi,
when i saw a recent post about Dijkstra implementation in P5, I thought It'd be nice to share a recent experiment. It's an attempt to make a traffic simulation in a medium-sized city.
I read GIS data into a GLGraphics VBO (GLModel) using OpenJUMP library, populated the road network with cars and then used Dijkstra to find routes for the cars to drive on. There were quite a few challenges in constructing a navigable network, but it runs quite smoothly in Processing, considering there are millions of polygons to render.
Somewhat more detailed description with video here. I also uploaded the entire sketch with data on the site, you can find the link there, or just download it directly. It's not very good programming, I was a little confused about Java then, but it works.
Hope you like it, I had much fun programming.
Best,
Marko
when i saw a recent post about Dijkstra implementation in P5, I thought It'd be nice to share a recent experiment. It's an attempt to make a traffic simulation in a medium-sized city.
I read GIS data into a GLGraphics VBO (GLModel) using OpenJUMP library, populated the road network with cars and then used Dijkstra to find routes for the cars to drive on. There were quite a few challenges in constructing a navigable network, but it runs quite smoothly in Processing, considering there are millions of polygons to render.
Somewhat more detailed description with video here. I also uploaded the entire sketch with data on the site, you can find the link there, or just download it directly. It's not very good programming, I was a little confused about Java then, but it works.
Hope you like it, I had much fun programming.
Best,
Marko