How the Ramp-Metering Game on traffic-simulation.de Works

Updated

The Ramp-Metering Game on traffic-simulation.de is a browser-based interactive exercise built on the same microsimulation model as the site's Onramp scenario. You act as the ramp controller: you decide how much traffic is released from the onramp onto the main road, and the simulation shows what happens to the merging traffic and the highway flow as a result. It runs directly in the page and needs a browser with HTML5 canvas support — if canvas isn't available, the page shows a "Your browser does not support the HTML5 canvas tag" message instead of the animation.

What the game is actually testing

Ramp metering is the practice of holding vehicles at an onramp and releasing them in controlled amounts so they merge into gaps in the main flow rather than arriving in a platoon. The game turns that control decision into something you do by hand and watch in real time.

The underlying model is a microscopic traffic simulation: individual vehicles with their own car-following and lane-changing behavior, not a single averaged flow. That matters because congestion on an onramp usually starts as a local effect — one vehicle forced to slow for a merge — and then propagates backward. In the game you see that propagation happen rather than reading about it.

How a round works

  1. The simulation starts with traffic on the main road and vehicles waiting on the onramp.
  2. You control the release from the onramp — how many vehicles enter the main road and when.
  3. Vehicles merge according to the model's lane-changing rules, which include a politeness factor and a lane-change threshold.
  4. The animation shows the result: whether merging vehicles find gaps, whether the main flow slows, and whether a queue builds on the ramp or on the highway.
  5. You adjust your metering and observe how the outcome changes.

The goal is to keep the merge from turning into congestion — releasing too aggressively pushes vehicles into the main flow faster than gaps appear, while releasing too conservatively lets the ramp queue grow.

The parameters behind the behavior

The game sits on top of the same parameter set exposed in the Onramp scenario. The page lists these controls:

Group Parameters
Traffic flow General inflow, onramp flow, truck percentage
Car-following Desired speed v0, time gap T, maximum acceleration a
Lane-changing Politeness, lane-change threshold, right bias for cars, right bias for trucks
Display Timelapse

These are the levers that determine how the simulated drivers behave. Politeness and the lane-change threshold govern how readily a driver accepts a gap; the right bias makes vehicles prefer returning to the right lane. Changing them changes how forgiving the merge is, which in turn changes how hard your metering job is.

What you can learn from it

The game is a way to feel the trade-off that real ramp metering faces:

  • Release too much and merging vehicles disrupt the main flow, speeds drop, and a shockwave forms.
  • Release too little and the ramp itself becomes the bottleneck, with a queue that can eventually spill back.
  • The useful range is in between, and it shifts depending on the inflow, truck share, and driver parameters.

Because it uses the same model as the Onramp scenario, you can move between the two: experiment freely in the game, then inspect the parameter values in the scenario to see which settings produced the behavior you observed.

Practical notes

  • The simulation runs in the browser; no installation is described on the page.
  • Offline sources are linked from GitHub, and the model is documented in the book Traffic Flow Dynamics (and its German edition, Verkehrsdynamik), both referenced on the page.
  • The page is credited to Martin Treiber.

If your browser doesn't render the canvas, the game won't run — that's the one hard requirement stated on the page.