{"record":{"id":"a9ec3ca553224921","repo":"a-b-street/abstreet","slug":"parking-spot-availability-at-went-below-0","errorCode":null,"errorMessage":"parking_spot_availability at {} went below 0","messagePattern":"parking_spot_availability at (.+?) went below 0","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sim/src/analytics.rs","lineNumber":568,"sourceCode":"for (t, filled) in changes {\n    if *t > now {\n        break;\n    }\n    if *t != last_t {\n        // Step functions. Don't interpolate.\n        pts.push((last_t, cnt));\n    }\n    last_t = *t;\n    if *filled {\n        if cnt == 0 {\n            panic!(\"parking_spot_availability at {} went below 0\", t);\n        }\n        cnt -= 1;\n    } else {\n        cnt += 1;\n    }\n}","sourceCodeStart":550,"sourceCodeEnd":586,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/sim/src/analytics.rs#L550-L586","documentation":"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.","triggerScenarios":"Thrown at sim/src/analytics.rs:568 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the capacity passed in matches the parking lane/spot's true capacity in the map","Check for duplicate ParkingEventType::Fill events or missing vacate events in the change log","Regenerate the analytics event log by re-running the simulation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0964f29315820c91b171b585eb51e300164e9197","analyzedAt":"2026-09-13T18:02:03.421Z","contentChangedAt":"2026-09-13T18:02:03.421Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}