ChannelEffects

DeepSpaceTelemetry.ChannelEffectsModule
ChannelEffects

Downlink channel models: stochastic packet loss (NoLoss, BernoulliLoss, two-state GilbertElliottLoss with its analytic stationary rate), scheduled disruption events (blackout, linear recovery ramp, elevated loss), and the composite LinkModel (visibility × disruption) gating both pipeline loops.

source
DeepSpaceTelemetry.ChannelEffects.LossModelType
LossModel

Abstract supertype for stochastic downlink packet-loss models. Concrete models implement sample_loss!, which is drawn once per batch transfer attempt on the receiver side. All models carry their own seeded Xoshiro RNG so loss realizations are reproducible independently of the physics stream.

source
DeepSpaceTelemetry.ChannelEffects.BernoulliLossType
BernoulliLoss(p, rng)

Memoryless i.i.d. packet loss: each batch transfer attempt fails independently with probability p ∈ [0, 1]. The RNG type is a struct parameter so the per-attempt draw dispatches statically.

source
DeepSpaceTelemetry.ChannelEffects.GilbertElliottLossType
GilbertElliottLoss(p_good_to_bad, p_bad_to_good, p_loss_good, p_loss_bad, in_bad_state, rng)

Two-state Markov (Gilbert–Elliott) bursty-channel model — the canonical model for correlated packet loss. The channel alternates between a GOOD state with loss probability p_loss_good and a BAD state with loss probability p_loss_bad; state transitions occur once per transfer attempt with probabilities p_good_to_bad / p_bad_to_good. All four parameters must lie in [0, 1]. The RNG type is a struct parameter so the per-attempt draws dispatch statically.

source
DeepSpaceTelemetry.ChannelEffects.sample_loss!Function
sample_loss!(model::LossModel; multiplier::Float64=1.0) -> Bool

Draws one loss realization for a single batch transfer attempt. Returns true if the transfer is lost. multiplier scales the instantaneous loss probability (clamped to [0, 1]) and is used to elevate loss rates during disruption events (see disruption_loss_multiplier). Mutates internal channel state for stateful models (Gilbert–Elliott).

source
DeepSpaceTelemetry.ChannelEffects.stationary_loss_rateFunction
stationary_loss_rate(model::LossModel) -> Float64

Analytic long-run loss probability of the model (used for physics-style validation of the sampled stream). For Gilbert–Elliott this is π_bad·p_loss_bad + π_good·p_loss_good with the stationary state occupancies π_bad = p_good_to_bad / (p_good_to_bad + p_bad_to_good).

Examples

julia> ChannelEffects.stationary_loss_rate(ChannelEffects.BernoulliLoss(0.1, Xoshiro(1)))
0.1

julia> ge = ChannelEffects.GilbertElliottLoss(0.03, 0.25, 0.01, 0.5, false, Xoshiro(1));

julia> round(ChannelEffects.stationary_loss_rate(ge); digits = 4)
0.0625
source
DeepSpaceTelemetry.ChannelEffects.DisruptionEventType
DisruptionEvent

A scheduled link-degrading event (a solar flare, a spacecraft safe-mode entry, a ground-station outage, …). Between start_time and blackout_end the link capacity is multiplied by 1 - severity (severity = 1 is a full blackout); between blackout_end and recovery_end capacity ramps linearly back to nominal. Throughout the whole event (blackout + recovery) the stochastic loss probability is scaled by loss_multiplier. label is an optional free-text display name shown on the dashboard while the event is active.

source
DeepSpaceTelemetry.ChannelEffects.disruption_factorFunction
disruption_factor(tl::DisruptionTimeline, t::DateTime) -> Float64

Multiplicative link-capacity factor in [0, 1] at simulation time t: 1.0 outside all events, 1 - severity during a blackout, and a linear ramp from 1 - severity back to 1.0 during the recovery phase.

source
DeepSpaceTelemetry.ChannelEffects.disruption_loss_multiplierFunction
disruption_loss_multiplier(tl::DisruptionTimeline, t::DateTime) -> Float64

Multiplier (≥ 1) applied to the stochastic loss probability at time t. Active from event start through the end of the recovery ramp.

Examples

julia> cfg = Dict{String,Any}(
           "disruption" => Dict{String,Any}(
               "events" => [Dict{String,Any}(
                   "start_day" => 2.0,
                   "duration_hours" => 12.0,
                   "recovery_hours" => 6.0,
                   "severity" => 1.0,
                   "loss_multiplier" => 4.0,
               )],
           ),
       );

julia> tl = ChannelEffects.build_disruption_timeline(cfg, DateTime(2035, 1, 1));

julia> ChannelEffects.disruption_loss_multiplier(tl, DateTime(2035, 1, 3, 6))
4.0

julia> ChannelEffects.disruption_loss_multiplier(tl, DateTime(2035, 1, 4))
1.0
source
DeepSpaceTelemetry.ChannelEffects.active_disruption_labelFunction
active_disruption_label(tl::DisruptionTimeline, t::DateTime) -> String

The label of the earliest-starting disruption event active at time t that carries a non-empty label, or "" when no active event is labeled. Used by the dashboard status line to name the ongoing event.

source
DeepSpaceTelemetry.ChannelEffects.LinkModelType
LinkModel(visibility::TelemetryCore.VisibilityModel, disruptions::DisruptionTimeline)

The complete downlink channel: daily DSN visibility windows composed with the disruption timeline. LinkModel(vis) builds a disruption-free link.

source
DeepSpaceTelemetry.ChannelEffects.build_loss_modelFunction
build_loss_model(cfg::AbstractDict, seed::Integer) -> LossModel

Constructs the stochastic loss model declared in the [packet_loss] config section, with its own RNG seeded from seed. Returns NoLoss when the section is absent or enabled = false. Errors on an unknown model string or probabilities outside [0, 1] (validated upstream by TelemetryCore.validate_config, re-checked here defensively).

source
DeepSpaceTelemetry.ChannelEffects.generation_gapsFunction
generation_gaps(cfg::AbstractDict, start_sim::DateTime) -> Vector{Tuple{DateTime,DateTime}}

The scheduled generation gaps — [[disruption.events]] with affects = "generation" — as (start, stop) intervals of duration_hours from start_day, sorted by start. The emitter produces no data inside them (Emitter.skip_generation_gaps!).

source