Spielerando

Detect how long a traffic or supply jam lasted without the jam hiding itself

A jam is a drop below normal, but normal itself is measured from recent history, and during a long jam recent history is the jam. The detector then forgets there is a problem. This entry shows how to keep the reference fixed for the jam's whole length.

Why this works

If you compare a jam with the recent past, a long jam slowly becomes its own normal and disappears. Fix the yardstick at the moment trouble starts and judge recovery against that fixed level. Then a long standstill is reported as a long standstill.

When not to use it

Do not use it when the normal level truly changes, such as night and day, a new road or a rule change. A frozen yardstick would keep a jam open long after things settled at a new level. Then compare with the same time yesterday.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • A diagram of every state
  • 29 lines of example code with 4 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Detect how long a traffic or supply jam lasted without the jam hiding itself" (read_entry traffic-jam-with-frozen-baseline) in my game. Build it step by step, and show me how you checked that it works.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP