Skip to content

[Communication] PR8: Modify Simulation and SimManager#220

Open
Joseph0120 wants to merge 2 commits intojoseph/communication_delay_PR7from
joseph/communication_delay_PR8
Open

[Communication] PR8: Modify Simulation and SimManager#220
Joseph0120 wants to merge 2 commits intojoseph/communication_delay_PR7from
joseph/communication_delay_PR8

Conversation

@Joseph0120
Copy link
Copy Markdown
Collaborator

Files Added:
4_swarms_1_ucav.pbtxt

Files Modified:
SimManager.cs

Description:
In SimManager, now it makes sure that it clears pending message in mailbox every time.
Created new simple simulation case 4_swarms_1_ucav.pbtxt and set it to default.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

Warning

Rate limit exceeded

@Joseph0120 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 24 minutes and 22 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 24 minutes and 22 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a1206bfc-5482-4279-b4b5-31addaf30983

📥 Commits

Reviewing files that changed from the base of the PR and between 24b5957 and dbe07cf.

📒 Files selected for processing (2)
  • Assets/Scripts/Managers/SimManager.cs
  • Assets/StreamingAssets/Configs/Simulations/4_swarms_1_ucav.pbtxt
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch joseph/communication_delay_PR8

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@stacklane-pr-stack-visualizer
Copy link
Copy Markdown

stacklane-pr-stack-visualizer bot commented Apr 1, 2026

🧱 Stack PR · Part of stack (9 PRs total)

Stack Structure:

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the default simulation configuration to a new swarm-based scenario and implements a mailbox cleanup process in the EndSimulation method. Feedback indicates that clearing the mailbox only at the end of a simulation may be insufficient due to Unity's delayed destruction phase and manual resets, which could allow "zombie" messages to persist into subsequent runs. It is suggested to also clear the mailbox at the start of the simulation to guarantee a clean state.

Comment on lines +101 to +103
if (Mailbox.Instance != null) {
Mailbox.Instance.ClearPendingMessages();
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Clearing the mailbox in EndSimulation is a good step towards ensuring a clean state between runs. However, there are two scenarios where this might be insufficient:

  1. Manual Resets: If ResetAndStartSimulation is called directly (e.g., from a UI button or external script), EndSimulation is bypassed, and the mailbox won't be cleared.
  2. Destruction Phase Messages: Since Destroy() in Unity is delayed until the end of the frame, any messages sent by agents during their OnDestroy or OnDisable methods will be added to the mailbox after this clear call. These "zombie" messages will then persist into the next simulation run, which is particularly problematic for simulations involving communication delays.

Consider moving or also adding the ClearPendingMessages() call to the beginning of StartSimulation() to ensure the mailbox is always empty right before new agents are initialized. This would provide a more robust guarantee of a clean state.

@Joseph0120 Joseph0120 force-pushed the joseph/communication_delay_PR8 branch from 0fe4232 to dbe07cf Compare April 1, 2026 06:10
@Joseph0120 Joseph0120 changed the title Joseph/communication delay pr8 [Communication] PR8: Modify Simulation and SimManager Apr 1, 2026
@Joseph0120 Joseph0120 requested a review from tryuan99 April 1, 2026 06:16
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.

1 participant