Add transponder outages (frac_adsb_outage) - #13
Merged
Merged
Conversation
The simulator never stopped ADS-B: every has_adsb aircraft was tagged in every node frame and pushed every second, so the backend's known-track hold (a node track claimed to a hex staying claimed after ADS-B stops) could not be exercised live. SimulatedAircraft now carries an outage window (adsb_outage_start_s / adsb_outage_end_s, world-clock seconds) plus an adsb_silent property. has_adsb and adsb_hex are untouched — the aircraft still HAS a transponder, it is silent. While silent the node frame gets a None ADS-B slot (exactly what a dark aircraft gets), the ADS-B push skips the aircraft entirely, and the summary / ground-truth payload carry adsb_silent so the server can tell a silent transponder apart from a genuinely dark target. SimulationWorld.frac_adsb_outage defaults to 0.0 (off), rolls at spawn, and is applied by the config poll alongside frac_dark. Raising the knob at runtime also rolls aircraft already in the air (schedule_adsb_outages), so verification does not have to wait for a fleet turnover. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The simulator never stopped ADS-B. Every
has_adsbaircraft was tagged in every node frame and pushed to the server every second for its whole life, so the backend's "known-track hold" (a node track claimed to an ADS-B hex staying claimed after the broadcast stops) had no way to be exercised against simulated traffic.This adds a transponder-outage model: an ADS-B aircraft goes silent mid-flight and comes back.
has_adsbandadsb_hexare deliberately untouched — the aircraft still HAS a transponder, it is simply not broadcasting, which is what separates this from a dark target.Default is
0.0(off): nothing changes for anyone who does not set the knob.Changes
SimulatedAircraft:adsb_outage_start_s/adsb_outage_end_s(world-clock seconds),sim_now_s(clock refreshed eachstep()), and anadsb_silentproperty.SimulationWorld.frac_adsb_outage(default0.0) — the fraction OF the ADS-B population that gets an outage. Rolled at spawn: start 20–120 s after spawn, duration 60–240 s. Those bounds are module constants: long enough to age past the backend's 45 s fix cap and 60 s map expiry, short enough to recur several times in a 20-minute capture.schedule_adsb_outages()rolls live ADS-B aircraft that have no window yet (start 5–60 s out), so raising the knob at runtime does not have to wait for a fleet turnover. Aircraft that already carry a window are skipped, so a 5 s config poll cannot re-roll the same aircraft forever.generate_detections_for_node: while silent, the ADS-B list gets aNoneslot — exactly what a dark aircraft gets. Delay/Doppler/SNR and the miss model are unchanged, so the echo is still there.get_aircraft_summaryreportsadsb_silent;build_ground_truth_payloadpasses it through;build_adsb_push_payloadskips silent aircraft (that push IS the broadcast)._poll_simulation_configappliescfg["frac_adsb_outage"](default0.0) alongsidefrac_dark, and re-rolls in-flight aircraft when it is on.Test coverage
New
tests/test_adsb_outage.py: knob at 1.0 vs 0.0, dark aircraft never scheduled, half-open silence window, runtime re-roll (including the idempotence of repeated polls), tag present before/after andNoneduring, radar detections unaffected while silent, summary flag, ground-truth passthrough with a legacy-payload default, and push-payload skipping.tests/test_dual_fraction.py's stub world gained the new attribute/method.Full lib suite: 128 passed, 5 skipped.
Review notes
frac_dark: it is a fraction of the ADS-B aircraft, not a spawn-type roll, so it does not participate in thefrac_*sum.adsb_silentreadssim_now_srather than a back-reference to the world;step()refreshes it for every aircraft, and_spawn_aircraftseeds it.🤖 Generated with Claude Code