Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Perhaps these questions are appropriate for this post.

I'm beginning to delve into this space and I've not managed to get any satisfactory answers to these questions, despite my month(s) long search.

1) How does one build a traffic (i.e state-space system), forgetting the visualization aspect of things ? Just generating sparse matrices, and adding elements to interact (add/subtract) from these matrices would be a great start! Any way to do this in a compiled language ?

2) Are there any libraries out there that help you simulate traffic in an existing network of roads, extracted from OpenStreetMaps perhaps?



1) There are different choices you can make about simulating individual agents or aggregate flows along roads. Assuming you're interested in the former, you can advance the simulation in discrete time-steps using approaches like the intelligent driver model mentioned in another thread. Chapter 4 of https://apps.cs.utexas.edu/tech_reports/reports/tr/TR-2157.p... is a different approach to the discrete time system that tries to handle complications that come up when applying to OpenStreetMap, like having a vehicle cross multiple roads and intersections in a single 0.1 second timestep, due to really short roads. If you're willing to throw away detailed movement (including acceleration and lane-changing), you can try a discrete-event approach, where you say "this vehicle enters one end of a road at time t, don't calculate anything for it until t + best_case_time_to_cross". https://dabreegster.github.io/abstreet/trafficsim/index.html has some ideas there.

2) Another option with much less detailed traffic simulation, but much more UI focus, is abstreet.org


This doesn't exactly answer your question, but what I settled on during my dissertation (granted, that was a few years ago now) was SUMO: https://www.eclipse.org/sumo/

IIRC you could import maps from from open street map, but I'm not sure if it has a "headless" mode, without all the visualisation.


having your route to office simulated with this would be super cool on osm


On 2) there's Matsim and AequilibraE off the top of my head.


For 2, Eclipse Sumo allows import of a road network from openstreetmap.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: