Flocc

Agent-based modeling in JavaScript in the browser or on the server. [v0.4.8]

Traffic

If you’ve ever been on a freeway at rush hour, you know the stop-and-start nature of heavy traffic. In this model, an agent with an empty ‘road’ in front of it will attempt to accelerate until it gets close to another agent, at which point it decelerates (i.e. slamming on the brakes). Watch how this behavior sends ‘waves’ backwards to the agents behind it, causing ‘traffic jams.’ Under the right conditions, agents are able to separate such that traffic becomes smooth, but other environments are plagued by disruptive, halting motion.