Skip to content

Commit

Permalink
fix: evaluate prebooking pickup and dropoff logic independently (#3105)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhoerl authored Feb 9, 2024
1 parent 599a837 commit a23f78a
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ public PrebookingStopActivity(PassengerHandler passengerHandler, DynAgent driver

@Override
protected boolean isLastStep(double now) {
return updatePickupRequests(now) && processDropoffRequests(now) && now >= endTime.get();
boolean pickupsReady = updatePickupRequests(now);
boolean dropoffsReady = updateDropoffRequests(now);
return pickupsReady && dropoffsReady && now >= endTime.get();
}

@Override
Expand All @@ -83,10 +85,10 @@ private void initDropoffRequests(double now) {
leaveTimes.put(request.getId(), leaveTime);
}

processDropoffRequests(now);
updateDropoffRequests(now);
}

private boolean processDropoffRequests(double now) {
private boolean updateDropoffRequests(double now) {
var iterator = leaveTimes.entrySet().iterator();

while (iterator.hasNext()) {
Expand Down

0 comments on commit a23f78a

Please sign in to comment.