Skip to content

[Issue #370] End downlink actions when the buffer empties - #371

Merged
dhutererprats merged 5 commits into
developfrom
issue-370-dynamic-downlink
Nov 8, 2026
Merged

dhutererprats merged 5 commits into
developfrom
issue-370-dynamic-downlink

Conversation

@dhutererprats

@dhutererprats dhutererprats commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes #370

Summary

Adds an opt-in way for a downlink action to end when the satellite's data buffer becomes empty. This lets a variable-interval environment request another action without waiting for the configured downlink duration to expire.

Enable it with:

act.Downlink(variable_duration_downlink=True)

Existing act.Downlink() configurations keep their current fixed-duration behavior.

Behavior

  • If storage is nonempty when downlink begins, the event checks at the FSW cadence and requests retasking when the buffer reaches the configured empty threshold.
  • If storage is already empty when downlink begins, early termination is held until at least minimum_duration seconds have elapsed. The default is 10 seconds. If the simulator step is longer, the action waits at least one simulator step.
  • empty_storage_threshold_bits defaults to 1 bit to account for small residual values.
  • The configured action duration remains a hard maximum. If it is shorter than the empty-buffer minimum, that maximum takes precedence.
  • Selecting another action removes the downlink event. An episode reset creates a fresh simulator and clears the action’s saved event state.

Example:

act.Downlink(
    duration=180.0,
    variable_duration_downlink=True,
    empty_storage_threshold_bits=0.5,
    minimum_duration=10.0,
)

Changes

  • Extend Downlink with opt-in variable-duration settings and an empty-buffer terminal event.
  • Use Basilisk’s callable event API and a shared action cleanup hook.
  • Add focused unit and Basilisk integration coverage.
  • Document the feature in the development release notes.

Validation

  • Full test suite: 1,147 passed, 2 skipped.

@dhutererprats
dhutererprats marked this pull request as ready for review November 4, 2026 01:55
Comment thread src/bsk_rl/act/discrete_actions.py Resolved
Comment thread src/bsk_rl/act/discrete_actions.py Resolved
Comment thread src/bsk_rl/act/discrete_actions.py Resolved
Comment thread src/bsk_rl/act/discrete_actions.py Resolved
@dhutererprats dhutererprats self-assigned this Nov 5, 2026

@LorenzzoQM LorenzzoQM left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@dhutererprats
dhutererprats merged commit e2c6656 into develop Nov 8, 2026
8 checks passed
@dhutererprats
dhutererprats deleted the issue-370-dynamic-downlink branch November 8, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Condition downlink action end on buffer level

2 participants