Skip to content

Fix spawn time and road counting for Agents - #509

Merged
Grufoony merged 2 commits into
mainfrom
fix-timeandcount
Sep 15, 2026
Merged

Grufoony merged 2 commits into
mainfrom
fix-timeandcount

Conversation

@Grufoony

Copy link
Copy Markdown
Owner

No description provided.

@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.86%. Comparing base (b9e0887) to head (0c1939c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #509      +/-   ##
==========================================
+ Coverage   83.78%   83.86%   +0.08%     
==========================================
  Files          54       54              
  Lines        8671     8727      +56     
  Branches     1029     1035       +6     
==========================================
+ Hits         7265     7319      +54     
- Misses       1387     1389       +2     
  Partials       19       19              
Flag Coverage Δ
unittests 83.86% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI 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.

🔵 Needs a closer look

Pending removals can still include pending-list wait time in travel metrics.

Pull request overview

Fixes agent movement timing, spawn-time handling, and travel metric accounting.

Changes:

  • Corrects movement and free-time handling.
  • Restamps spawn time on network insertion.
  • Expands regression coverage for queues, metrics, and spawn time.
File summaries
File Description
test/mobility/Test_dynamics.cpp Adds and updates dynamics regression tests.
test/mobility/Test_agent.cpp Tests spawn-time mutation.
src/dsf/mobility/FirstOrderDynamics.cpp Corrects movement completion and spawn-time handling.
src/dsf/mobility/Agent.hpp Declares the spawn-time setter.
src/dsf/mobility/Agent.cpp Implements the spawn-time setter.
Review details

Suppressed comments (1)

src/dsf/mobility/FirstOrderDynamics.cpp:1229

  • This restamp is bypassed by the early-removal path above: a random agent can remain in m_agents while its source is full and later be killed when no outgoing transition exists. m_removeAgent<false> records time_step() - spawnTime(), so that agent's pending-list wait is still reported as travel time, contrary to the contract documented here. Handle pending removals consistently before recording their metrics.
      // The agent enters the simulation only now: re-stamp its spawn time so that the
      // time it spent queued in m_agents, waiting for a free slot, is not counted as
      // travel time.
      pAgent->setSpawnTime(this->time_step());
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Grufoony
Grufoony merged commit cb3b014 into main Sep 15, 2026
32 checks passed
@Grufoony
Grufoony deleted the fix-timeandcount branch September 15, 2026 15:40
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.

2 participants