-
Notifications
You must be signed in to change notification settings - Fork 17
1280 trip addition overhaul #1281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1281 +/- ##
==========================================
- Coverage 97.28% 97.17% -0.11%
==========================================
Files 168 168
Lines 14858 14822 -36
==========================================
- Hits 14454 14404 -50
- Misses 404 418 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the improvements. Some small questions remain.
std::vector<Trip> merged_trips; | ||
merged_trips.reserve(m_trips.size() + trip.size()); | ||
std::merge(m_trips.begin(), m_trips.end(), trip.begin(), trip.end(), std::back_inserter(merged_trips), | ||
[](auto& trip1, auto& trip2) { | ||
return std::tie(trip1.trip_time, trip1.person_id) < std::tie(trip2.trip_time, trip2.person_id); | ||
}); | ||
m_trips = std::move(merged_trips); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there no in-place merger? Could avoid a lot of storage duplication from having to have two times the same trip vector.
LocationId origin; ///< Location where the Person starts the Trip. | ||
int origin_model_id; ///< Model id of origin Location. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we should delete this. I think this could be used later on if trip logic is changed.
|
||
/** | ||
* @brief Construct a new Trip. | ||
* @param[in] id ID of the Person that makes the Trip. | ||
* @param[in] time_new Time at which a Person changes the Location this currently cant be set for s specific day just a timepoint in a day. | ||
* @param[in] trip_time Time at which a Person changes the Location this currently cant be set for s specific day just a timepoint in a day. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trip_time
parameter is actually called time
now.
@@ -125,8 +125,12 @@ class ABMMobilityEdge | |||
for (int i = int(persons_to_change.size()) - 1; i >= 0; --i) { | |||
auto& person = model_from.get_persons()[persons_to_change[i]]; | |||
auto target_type = person.get_location_type(); | |||
if (target_type == abm::LocationType::Count) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should this happen? Locations with LocationType::Count
should be prohibited.
Changes and Information
Please briefly list the changes (main added features, changed items, or corrected bugs) made:
If need be, add additional information and what the reviewer should look out for in particular:
Merge Request - Guideline Checklist
Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.
Checks by code author
Checks by code reviewer(s)