a-b-street/abstreet · error

parking_spot_availability at

Error message

parking_spot_availability at {} went below 0

What it means

parking_spot_availability replays occupancy changes against a lane's capacity to produce a free-spots step function. This fires when a 'filled' event arrives while cnt is already 0 — i.e. the event log claims more spots were occupied than the capacity allows, so the counter would go negative. It signals inconsistent parking events (duplicate fills, wrong capacity, or missing vacate events) in the analytics data.

Solutions

  1. Verify the capacity passed in matches the parking lane/spot's true capacity in the map
  2. Check for duplicate ParkingEventType::Fill events or missing vacate events in the change log
  3. Regenerate the analytics event log by re-running the simulation
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at sim/src/analytics.rs:568 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of a-b-street/abstreet@0964f29315 (2026-09-13). Data as JSON: /api/errors/a9ec3ca553224921. Report an issue: GitHub.

Appendix: source

Thrown at sim/src/analytics.rs:568

for (t, filled) in changes {
    if *t > now {
        break;
    }
    if *t != last_t {
        // Step functions. Don't interpolate.
        pts.push((last_t, cnt));
    }
    last_t = *t;
    if *filled {
        if cnt == 0 {
            panic!("parking_spot_availability at {} went below 0", t);
        }
        cnt -= 1;
    } else {
        cnt += 1;
    }
}

View on GitHub (pinned to 0964f29315)