FA-68258 / Traffic signal timing plans / Member archive
Loop detector count and occupancy binning: vehicles present before period start are counted in the last bin · case 03
Loop detector count and occupancy binning returns a wrong result when vehicles present before period start are counted in the last bin.
Case contract
Input {interval s, bins, events: [[on, off]] seconds relative to period start (on may be negative), max_presence, no_activity}. A vehicle is counted in the bin of its on time if inside the period; occupied time is split across bins by overlap; occupancy percent is floor(occupied*100/interval). Status is 'stuck-on' if any presence lasts >= max_presence, 'no-activity' if there are no events and the period (bins*interval) is >= no_activity, else 'ok'. Return {counts, occ_pct, status}.
Why this case matters
Signal timing arithmetic is exact and integer or rational; a wrong rule silently produces unsafe or inefficient timing plans.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| timing oracle 4 | {"counts": [2, 0, 1], "occ_pct": [53, 0, 0], "status": "ok"} | {"counts": [2, 0, 0], "occ_pct": [53, 0, 0], "status": "ok"} | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗