Add CounterPosition to move the counter on a Street#389
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a CounterPosition enum to enable configurable counter placement on streets. The counter can now be positioned at ENTRY, MIDDLE, or EXIT points, allowing more flexible traffic flow monitoring.
Changes:
- Introduced
CounterPositionenum with three values: ENTRY, MIDDLE, and EXIT - Updated
enableCounter()method signature to accept aCounterPositionparameter with EXIT as the default - Modified counter increment logic in
addAgent(),enqueue(), anddequeue()methods to respect the counter position - Added comprehensive test coverage for all three counter positions
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/dsf/mobility/Street.hpp | Adds CounterPosition enum and updates enableCounter signature with position parameter |
| src/dsf/mobility/Street.cpp | Implements position-aware counter increment logic across agent lifecycle methods |
| test/mobility/Test_street.cpp | Adds three test subcases validating counter behavior at ENTRY, MIDDLE, and EXIT positions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #389 +/- ##
==========================================
+ Coverage 83.60% 83.66% +0.06%
==========================================
Files 53 53
Lines 5373 5393 +20
Branches 616 618 +2
==========================================
+ Hits 4492 4512 +20
Misses 870 870
Partials 11 11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.