Skip to content

Commit

Permalink
prebooking stop: check for expected pickups to prevent pickup and aba…
Browse files Browse the repository at this point in the history
…ndonment in the same second
  • Loading branch information
nkuehnel committed Sep 3, 2024
1 parent 6bd4b36 commit 358f5bc
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,10 @@ protected void simStep(double now) {
@Override
public void notifyPassengersAreReadyForDeparture(List<MobsimPassengerAgent> passengers, double now) {
var request = getRequestForPassengers(passengers.stream().map(Identifiable::getId).toList());
queuePickup(request, now);
expectedPickups.remove(request.getId());
if(expectedPickups.containsKey(request.getId())) {
queuePickup(request, now);
expectedPickups.remove(request.getId());
}
}

private AcceptedDrtRequest getRequestForPassengers(List<Id<Person>> passengerIds) {
Expand Down

0 comments on commit 358f5bc

Please sign in to comment.