Skip to content

[MINOR] Fix issue with failure penalty in multiagent env#276

Merged
Mark2000 merged 1 commit into
developfrom
bugfix/fix-failure-penalty
Jun 12, 2025
Merged

[MINOR] Fix issue with failure penalty in multiagent env#276
Mark2000 merged 1 commit into
developfrom
bugfix/fix-failure-penalty

Conversation

@Mark2000

Copy link
Copy Markdown
Contributor

Description

Fix an issue with failure penalties in the PettingZoo environment when the rewarder does not return a reward for a satellite.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How should this pull request be reviewed?

  • By commit
  • All changes at once

How Has This Been Tested?

Added test to cover this case.

Future Work

None.

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation and release notes
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Copilot AI review requested due to automatic review settings June 12, 2025 00:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request addresses a bug where failure penalties were not correctly applied in the PettingZoo multiagent environment when the rewarder omitted a reward for a satellite. Key changes include the addition of a new unit test to cover this edge case, modifications in the _get_reward method to correctly apply penalties, and an update to the release notes documenting the fix.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/unittest/test_gym_env.py Added a test case (test_get_reward_missing_sat) for the failure penalty logic.
src/bsk_rl/gym.py Adjusted the _get_reward logic and added a debug print statement.
docs/source/release_notes.rst Updated release notes to include the bug fix.

Comment thread src/bsk_rl/gym.py Outdated
@Mark2000
Mark2000 force-pushed the bugfix/fix-failure-penalty branch from 042df5b to ae943b1 Compare June 12, 2025 00:42
@Mark2000
Mark2000 force-pushed the bugfix/fix-failure-penalty branch from ae943b1 to 954f1bb Compare June 12, 2025 00:43

@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.

@Mark2000
Mark2000 merged commit 9f9adcf into develop Jun 12, 2025
5 checks passed
@Mark2000
Mark2000 deleted the bugfix/fix-failure-penalty branch June 12, 2025 19:02
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.

3 participants