Simple Highway Simulator

This little app is a simple simulator of cars on a highway. Play with the parameters or stop any car by touching it. As a game try to maximize the throughput by playing with the parameters. It will show you why traffic will become much more performant and use less resources once everyone drives self-driving cars.

Average speed km/h Loading..
Number of cars Loading..
Throughput cars/min Loading..
Fuel consumption units/car Loading..
Crashes

Hover or click on a car to slow it down.

What's the point?

There are many reasons that I built this app: I was in my vacations in Spain with my family. Some like tanning on the beach or reading books. I like coding. It's an interesting challenge. It gives me some programming practice (I am mostly manager). And the result is an app my kids (6 and 8 years old) also enjoy playing with.

Technical details

Typescript, SVG and a simple state machine for each car (You can call it AI if you want ;-). The cars are not very smart. The code is not very pretty. Edge cases are not handled well. And it performs badly on low-CPU devices. Memory leaks? Probably yes. Find the source code here.

Silvan Mühlemann, 23.10.2016