Skip to content
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

Draft: DRT consolidate prebookings and group bookings #2991

Merged

Conversation

nkuehnel
Copy link
Member

No description provided.

@nkuehnel
Copy link
Member Author

This PR aims to consolidate prebookings and group bookings and removes the additional group passenger engine by merging the functionality in the default passenger engine.

The recently added sharing metrics now also work with the same idea of group bookings.
A small test for prebooking with groups is included.

Please let me know what you think.

@sebhoerl
Copy link
Contributor

Very nice! I just had a very brief look, will check more closely later on. One first comment: would it maybe make sense to have something like a record Booking(Id<Person> personId, Leg leg)? Would probably be cleaner than working with Tuple and getFirst / getSecond everywhere?

Copy link
Member

@michalmac michalmac left a comment

Choose a reason for hiding this comment

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

Nice. LGTM

Comment on lines 35 to 38
List<Id<Person>> personIds = new ArrayList<>();
for (String person : personIdsAttribute) {
personIds.add(Id.create(person, Person.class));
}
Copy link
Member

Choose a reason for hiding this comment

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

Why not to use stream as you did in PrebookingManager L163?

Copy link
Member Author

Choose a reason for hiding this comment

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

👌

Comment on lines +23 to +25
import com.google.inject.Key;
import com.google.inject.Singleton;
import com.google.inject.name.Names;
Copy link
Member

Choose a reason for hiding this comment

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

General note (not limited to this PR): This PR contains lots of line changes due to different formatting standards, especially imports reordering/wildcarding. There are, for instance, no other changes in this file.

I hope this will get reduced after we switch to a formatting standard.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I see. Guess it's from my auto-formatting in IntelliJ...

@nkuehnel
Copy link
Member Author

Very nice! I just had a very brief look, will check more closely later on. One first comment: would it maybe make sense to have something like a record Booking(Id<Person> personId, Leg leg)? Would probably be cleaner than working with Tuple and getFirst / getSecond everywhere?

Replaced the tuples with "PersonLeg" records. Booking doesn't really fit here I guess as it's really just combinations of agents and a specific leg that are not yet grouped together as a booking

@sebhoerl
Copy link
Contributor

HI @nkuehnel, just added one comment, otherwise this looks nice! Thanks a lot!

…BookingConsolidation

# Conflicts:
#	contribs/drt/src/test/java/org/matsim/contrib/drt/sharingmetrics/SharingFactorTest.java
#	contribs/dvrp/src/test/java/org/matsim/contrib/dvrp/passenger/PassengerGroupTest.java
@nkuehnel
Copy link
Member Author

@sebhoerl done, thanks for your input

@nkuehnel nkuehnel enabled auto-merge December 19, 2023 16:11
@nkuehnel nkuehnel merged commit dbb186e into matsim-org:master Dec 20, 2023
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants