
Ask HN: Traffic/Parking Lot Simulation? - jforjuancho
Greetings,<p>Just wondering if anyone has any pointers on how to get started in things like parking lot simulation, traffic simulation and public transit simulation?<p>Thanks!
======
mtmail
Have a look at the projects by
[https://sharedstreets.io/](https://sharedstreets.io/) Some of it is open
source, e.g. [https://github.com/sharedstreets/speed-
prediction](https://github.com/sharedstreets/speed-prediction)

~~~
jforjuancho
Thanks

------
mindcrime
I'm far from an expert, but I can share a thought or two. I think all of the
you examples you cited would fall into the overall umbrella of "discrete event
simulation"[1]. This would be discrete as opposed to something like fluid
dynamics or weather modeling, which would be closer to "continuous
simulation"[6].

Anyway, within the realm of discrete event simulation, there are a lot of
different techniques and tools. You can always code up a simulation using any
standard programming language: your Java, Python, C++, Go, etc. But there are
also purpose built tools and libraries for this as well. As you might expect,
a lot of tools[2] in this space are F/OSS.

Not on that list, but also a possible option, is NetLogo[3]. It's advertised
as a "Multi-agent system" simulation environment, but can absolutely be used
for various kinds of DES. Once nice thing about NetLogo is that it's very
popular and has a vibrant community, and a lot of pre-existing models you can
use to learn from, or as a base for your own models.

If you're a Python person, Simpy[4] is very popular as well.

Here's a super simple simulation[5] involving a traffic light, using Simpy.

Also, a technique that might not be _specifically_ useful in your domain, but
which is widely used for many kinds of simulation, and which is probably worth
knowing about, is Monte Carlo simulation[7].

See also: the Wikipedia page[8] on "traffic simulation".

You may also find that this starts to overlap some with "queuing theory"[9] in
places.

[1]: [https://en.wikipedia.org/wiki/Discrete-
event_simulation](https://en.wikipedia.org/wiki/Discrete-event_simulation)

[2]:
[https://en.wikipedia.org/wiki/List_of_discrete_event_simulat...](https://en.wikipedia.org/wiki/List_of_discrete_event_simulation_software#Open_Source)

[3]:
[http://ccl.northwestern.edu/netlogo/index.shtml](http://ccl.northwestern.edu/netlogo/index.shtml)

[4]:
[https://simpy.readthedocs.io/en/latest/](https://simpy.readthedocs.io/en/latest/)

[5]: [https://www.geeksforgeeks.org/basics-of-discrete-event-
simul...](https://www.geeksforgeeks.org/basics-of-discrete-event-simulation-
using-simpy/)

[6]:
[https://en.wikipedia.org/wiki/Continuous_simulation](https://en.wikipedia.org/wiki/Continuous_simulation)

[7]:
[https://en.wikipedia.org/wiki/Monte_Carlo_method](https://en.wikipedia.org/wiki/Monte_Carlo_method)

[8]:
[https://en.wikipedia.org/wiki/Traffic_simulation](https://en.wikipedia.org/wiki/Traffic_simulation)

[9]:
[https://en.wikipedia.org/wiki/Queueing_theory](https://en.wikipedia.org/wiki/Queueing_theory)

~~~
jforjuancho
Thanks, this will keep me busy for a good couple of weekends :D!

