Skip to content

Commit

Permalink
specific unplannedRequests for taxi optimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhoerl committed Nov 11, 2023
1 parent f44764d commit 42fe5ae
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@

import static org.matsim.contrib.taxi.schedule.TaxiTaskBaseType.OCCUPIED_DRIVE;

import java.util.LinkedList;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Queue;
import java.util.TreeSet;

import org.matsim.contrib.drt.passenger.DrtRequest;
import org.matsim.contrib.dvrp.fleet.DvrpVehicle;
import org.matsim.contrib.dvrp.fleet.Fleet;
import org.matsim.contrib.dvrp.optimizer.Request;
import org.matsim.contrib.dvrp.passenger.PassengerRequest;
import org.matsim.contrib.dvrp.schedule.ScheduleTimingUpdater;
import org.matsim.contrib.dvrp.schedule.Task;
import org.matsim.contrib.taxi.run.TaxiConfigGroup;
Expand All @@ -43,7 +45,11 @@ public class DefaultTaxiOptimizer implements TaxiOptimizer {
private final Fleet fleet;
private final TaxiScheduler scheduler;

private final Queue<DrtRequest> unplannedRequests = new LinkedList<>();
private final Collection<DrtRequest> unplannedRequests = new TreeSet<>(
Comparator.comparing(PassengerRequest::getEarliestStartTime) //
.thenComparing(PassengerRequest::getLatestStartTime) //
.thenComparing(Request::getSubmissionTime) //
.thenComparing(Request::getId));

private final UnplannedRequestInserter requestInserter;

Expand Down

0 comments on commit 42fe5ae

Please sign in to comment.