Skip to content

Commit

Permalink
address lates comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nkuehnel committed Nov 21, 2023
1 parent 8ae0000 commit 47da27e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public List<InsertionWithDetourData> generateInsertions(DrtRequest drtRequest, V
int stopCount = vEntry.stops.size();
List<InsertionWithDetourData> insertions = new ArrayList<>();

if (drtRequest.getPassengerIds().size() > vEntry.vehicle.getCapacity()) {
if (drtRequest.getPassengerCount() > vEntry.vehicle.getCapacity()) {
//exit early
return Collections.EMPTY_LIST;
}
Expand All @@ -165,7 +165,7 @@ public List<InsertionWithDetourData> generateInsertions(DrtRequest drtRequest, V
Waypoint.Stop nextStop = nextStop(vEntry, i);

// (1) only not fully loaded arcs
boolean allowed = occupancy + drtRequest.getPassengerIds().size() <= vEntry.vehicle.getCapacity();
boolean allowed = occupancy + drtRequest.getPassengerCount() <= vEntry.vehicle.getCapacity();

// (2) check if the request wants to depart after the departure time of the next
// stop. We can early on filter out the current insertion, because we will
Expand Down Expand Up @@ -258,7 +258,7 @@ private void generateDropoffInsertions(DrtRequest request, VehicleEntry vEntry,
// i -> pickup -> i+1 && j -> dropoff -> j+1
// check the capacity constraints if i < j (already validated for `i == j`)
Waypoint.Stop currentStop = currentStop(vEntry, j);
if (currentStop.outgoingOccupancy + request.getPassengerIds().size() > vEntry.vehicle.getCapacity()) {
if (currentStop.outgoingOccupancy + request.getPassengerCount() > vEntry.vehicle.getCapacity()) {
if (request.getToLink() == currentStop.task.getLink()) {
//special case -- we can insert dropoff exactly at node j
addInsertion(insertions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private void handleDepartures(double now) {
// must come before validateAndSubmitRequest (to come before rejection event)
eventsManager.processEvent(new PassengerWaitingEvent(now, mode, request.getId(), group.stream().map(Identifiable::getId).toList()));

validateAndSubmitRequest(List.copyOf(group), request, mobsimTimer.getTimeOfDay());
validateAndSubmitRequest(group, request, mobsimTimer.getTimeOfDay());
}
currentDepartures.clear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ default double getLatestStartTime() {

String getMode();

int getPartySize();
int getPassengerCount();
}

0 comments on commit 47da27e

Please sign in to comment.