Skip to content

Commit

Permalink
Merge branch 'master' into documentation-mode-choice
Browse files Browse the repository at this point in the history
  • Loading branch information
simei94 authored May 27, 2024
2 parents 16dc1f8 + 4796104 commit be0a92d
Show file tree
Hide file tree
Showing 52 changed files with 382 additions and 169 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ class BicycleScoreEventsCreator implements
}

@Override public void handleEvent( VehicleLeavesTrafficEvent event ){
vehicle2driver.handleEvent( event );
if ( this.bicycleConfig.isMotorizedInteraction() ){
// dec count by one:
String mode = this.modeFromVehicle.get( event.getVehicleId() );
Expand All @@ -155,6 +154,8 @@ class BicycleScoreEventsCreator implements
} else {
log.warn( "no driver found for vehicleId=" + event.getVehicleId() + "; not clear why this could happen" );
}
// Needs to be called last, because it will remove driver information
vehicle2driver.handleEvent( event );
// ---
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting;
import org.matsim.core.population.PopulationUtils;
import org.matsim.core.population.io.PopulationReader;
import org.matsim.core.population.routes.PopulationComparison;
import org.matsim.core.router.TripStructureUtils;
import org.matsim.core.scenario.ScenarioUtils;
import org.matsim.core.utils.collections.CollectionUtils;
Expand Down Expand Up @@ -204,7 +205,8 @@ void testLane() {
Scenario scenarioCurrent = ScenarioUtils.createScenario(ConfigUtils.createConfig());
new PopulationReader(scenarioReference).readFile(utils.getInputDirectory() + "output_plans.xml.gz");
new PopulationReader(scenarioCurrent).readFile(utils.getOutputDirectory() + "output_plans.xml.gz");
assertTrue(PopulationUtils.equalPopulation(scenarioReference.getPopulation(), scenarioCurrent.getPopulation()), "Populations are different");

assertEquals(PopulationComparison.Result.equal, PopulationComparison.compare(scenarioReference.getPopulation(), scenarioCurrent.getPopulation()), "Populations are different");
}

@Test
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.matsim.contrib.commercialTrafficApplications.jointDemand.JointDemandConfigGroup;
import org.matsim.contrib.commercialTrafficApplications.jointDemand.JointDemandModule;
import org.matsim.contrib.common.zones.systems.grid.square.SquareGridZoneSystemParams;
import org.matsim.contrib.drt.optimizer.DrtOptimizationConstraintsSet;
import org.matsim.contrib.drt.optimizer.insertion.extensive.ExtensiveInsertionSearchParams;
import org.matsim.contrib.drt.run.DrtConfigGroup;
import org.matsim.contrib.drt.run.DrtConfigs;
Expand Down Expand Up @@ -141,9 +142,10 @@ private static void loadConfigGroups(Config config) {
MultiModeDrtConfigGroup multiModeDrtConfigGroup = ConfigUtils.addOrGetModule(config, MultiModeDrtConfigGroup.class);

DrtConfigGroup drtCfg = new DrtConfigGroup();
drtCfg.getDrtOptimizationConstraintsParam().maxWaitTime = 2 * 3600;
drtCfg.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = 5;
drtCfg.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = 15 * 60;
DrtOptimizationConstraintsSet defaultConstraintsSet = drtCfg.addOrGetDrtOptimizationConstraintsParams().addOrGetDefaultDrtOptimizationConstraintsSet();
defaultConstraintsSet.maxWaitTime = 2 * 3600;
defaultConstraintsSet.maxTravelTimeAlpha = 5;
defaultConstraintsSet.maxTravelTimeBeta = 15 * 60;
drtCfg.stopDuration = 60;
drtCfg.vehiclesFile = "jointDemand_vehicles.xml";
multiModeDrtConfigGroup.addParameterSet(drtCfg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@
import org.matsim.contrib.drt.extension.edrt.schedule.EDrtStayTaskEndTimeCalculator;
import org.matsim.contrib.drt.extension.edrt.schedule.EDrtTaskFactoryImpl;
import org.matsim.contrib.drt.extension.edrt.scheduler.EmptyVehicleChargingScheduler;
import org.matsim.contrib.drt.optimizer.DefaultDrtOptimizer;
import org.matsim.contrib.drt.optimizer.DrtModeOptimizerQSimModule;
import org.matsim.contrib.drt.optimizer.DrtOptimizer;
import org.matsim.contrib.drt.optimizer.DrtRequestInsertionRetryParams;
import org.matsim.contrib.drt.optimizer.DrtRequestInsertionRetryQueue;
import org.matsim.contrib.drt.optimizer.QSimScopeForkJoinPoolHolder;
import org.matsim.contrib.drt.optimizer.VehicleEntry;
import org.matsim.contrib.drt.optimizer.*;
import org.matsim.contrib.drt.optimizer.depot.DepotFinder;
import org.matsim.contrib.drt.optimizer.insertion.CostCalculationStrategy;
import org.matsim.contrib.drt.optimizer.insertion.DefaultInsertionCostCalculator;
Expand Down Expand Up @@ -147,7 +141,10 @@ public EmptyVehicleChargingScheduler get() {
bindModal(VehicleEntry.EntryFactory.class).toProvider(
EDrtVehicleDataEntryFactory.EDrtVehicleDataEntryFactoryProvider.class).asEagerSingleton();

bindModal(CostCalculationStrategy.class).to(drtCfg.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated ?
DrtOptimizationConstraintsSet defaultConstraintsSet = drtCfg.addOrGetDrtOptimizationConstraintsParams().addOrGetDefaultDrtOptimizationConstraintsSet();
bindModal(CostCalculationStrategy.class)
.to(defaultConstraintsSet.rejectRequestIfMaxWaitOrTravelTimeViolated
?
CostCalculationStrategy.RejectSoftConstraintViolations.class :
CostCalculationStrategy.DiscourageSoftConstraintViolations.class).asEagerSingleton();

Expand Down Expand Up @@ -179,7 +176,8 @@ public EmptyVehicleRelocator get() {
getter.getModal(StopTimeCalculator.class), scheduleWaitBeforeDrive)))
.asEagerSingleton();

bindModal(DefaultOfferAcceptor.class).toProvider(modalProvider(getter -> new DefaultOfferAcceptor(drtCfg.getDrtOptimizationConstraintsParam().maxAllowedPickupDelay)));
bindModal(DefaultOfferAcceptor.class).toProvider(modalProvider(getter -> new DefaultOfferAcceptor(
defaultConstraintsSet.maxAllowedPickupDelay)));
bindModal(DrtOfferAcceptor.class).to(modalKey(DefaultOfferAcceptor.class));

bindModal(ScheduleTimingUpdater.class).toProvider(modalProvider(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.matsim.contrib.drt.extension.operations.DrtWithOperationsConfigGroup;
import org.matsim.contrib.drt.extension.operations.operationFacilities.OperationFacilitiesParams;
import org.matsim.contrib.drt.extension.operations.shifts.config.ShiftsParams;
import org.matsim.contrib.drt.optimizer.DrtOptimizationConstraintsSet;
import org.matsim.contrib.drt.optimizer.insertion.extensive.ExtensiveInsertionSearchParams;
import org.matsim.contrib.drt.optimizer.rebalancing.RebalancingParams;
import org.matsim.contrib.drt.optimizer.rebalancing.mincostflow.MinCostFlowRebalancingStrategyParams;
Expand Down Expand Up @@ -53,16 +54,17 @@ void test() {

DrtConfigGroup drtConfigGroup = drtWithShiftsConfigGroup;
drtConfigGroup.mode = TransportMode.drt;
drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = 1.5;
drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = 10. * 60.;
drtConfigGroup.stopDuration = 30.;
drtConfigGroup.getDrtOptimizationConstraintsParam().maxWaitTime = 600.;
drtConfigGroup.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated = true;
DrtOptimizationConstraintsSet defaultConstraintsSet = drtConfigGroup.addOrGetDrtOptimizationConstraintsParams().addOrGetDefaultDrtOptimizationConstraintsSet();
defaultConstraintsSet.maxTravelTimeAlpha = 1.5;
defaultConstraintsSet.maxTravelTimeBeta = 10. * 60.;
defaultConstraintsSet.maxWaitTime = 600.;
defaultConstraintsSet.rejectRequestIfMaxWaitOrTravelTimeViolated = true;
defaultConstraintsSet.maxWalkDistance = 1000.;
drtConfigGroup.useModeFilteredSubnetwork = false;
drtConfigGroup.vehiclesFile = fleetFile;
drtConfigGroup.operationalScheme = DrtConfigGroup.OperationalScheme.door2door;
drtConfigGroup.plotDetailedCustomerStats = true;
drtConfigGroup.getDrtOptimizationConstraintsParam().maxWalkDistance = 1000.;
drtConfigGroup.idleVehiclesReturnToDepots = false;

drtConfigGroup.addParameterSet(new ExtensiveInsertionSearchParams());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import org.matsim.contrib.drt.extension.operations.EDrtOperationsControlerCreator;
import org.matsim.contrib.drt.extension.operations.operationFacilities.OperationFacilitiesParams;
import org.matsim.contrib.drt.extension.operations.shifts.config.ShiftsParams;
import org.matsim.contrib.drt.optimizer.DrtOptimizationConstraintsSet;
import org.matsim.contrib.drt.optimizer.insertion.extensive.ExtensiveInsertionSearchParams;
import org.matsim.contrib.drt.optimizer.rebalancing.RebalancingParams;
import org.matsim.contrib.drt.optimizer.rebalancing.mincostflow.MinCostFlowRebalancingStrategyParams;
import org.matsim.contrib.drt.run.DrtConfigGroup;
import org.matsim.contrib.drt.run.DrtOptimizationConstraintsParams;
import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup;
import org.matsim.contrib.dvrp.run.DvrpConfigGroup;
import org.matsim.contrib.ev.EvConfigGroup;
Expand Down Expand Up @@ -57,17 +57,17 @@ void test() {

DrtConfigGroup drtConfigGroup = drtWithShiftsConfigGroup;
drtConfigGroup.mode = TransportMode.drt;
DrtOptimizationConstraintsParams constraintsParam = drtConfigGroup.getDrtOptimizationConstraintsParam();
constraintsParam.maxTravelTimeAlpha = 1.5;
constraintsParam.maxTravelTimeBeta = 10. * 60.;
DrtOptimizationConstraintsSet constraintsSet = drtConfigGroup.addOrGetDrtOptimizationConstraintsParams().addOrGetDefaultDrtOptimizationConstraintsSet();
constraintsSet.maxTravelTimeAlpha = 1.5;
constraintsSet.maxTravelTimeBeta = 10. * 60.;
drtConfigGroup.stopDuration = 30.;
constraintsParam.maxWaitTime = 600.;
constraintsParam.rejectRequestIfMaxWaitOrTravelTimeViolated = true;
constraintsSet.maxWaitTime = 600.;
constraintsSet.rejectRequestIfMaxWaitOrTravelTimeViolated = true;
drtConfigGroup.useModeFilteredSubnetwork = false;
drtConfigGroup.vehiclesFile = fleetFile;
drtConfigGroup.operationalScheme = DrtConfigGroup.OperationalScheme.door2door;
drtConfigGroup.plotDetailedCustomerStats = true;
constraintsParam.maxWalkDistance = 1000.;
constraintsSet.maxWalkDistance = 1000.;
drtConfigGroup.idleVehiclesReturnToDepots = false;

drtConfigGroup.addParameterSet(new ExtensiveInsertionSearchParams());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import org.matsim.contrib.drt.extension.operations.DrtOperationsParams;
import org.matsim.contrib.drt.extension.operations.operationFacilities.OperationFacilitiesParams;
import org.matsim.contrib.drt.extension.operations.shifts.config.ShiftsParams;
import org.matsim.contrib.drt.optimizer.DrtOptimizationConstraintsSet;
import org.matsim.contrib.drt.optimizer.insertion.extensive.ExtensiveInsertionSearchParams;
import org.matsim.contrib.drt.optimizer.rebalancing.RebalancingParams;
import org.matsim.contrib.drt.optimizer.rebalancing.mincostflow.MinCostFlowRebalancingStrategyParams;
import org.matsim.contrib.drt.run.DrtConfigGroup;
import org.matsim.contrib.drt.run.DrtOptimizationConstraintsParams;
import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup;
import org.matsim.contrib.dvrp.run.DvrpConfigGroup;
import org.matsim.contrib.zone.skims.DvrpTravelTimeMatrixParams;
Expand Down Expand Up @@ -46,17 +46,17 @@ void test() {

DrtConfigGroup drtConfigGroup = drtWithShiftsConfigGroup;
drtConfigGroup.mode = TransportMode.drt;
DrtOptimizationConstraintsParams constraintsParam = drtConfigGroup.getDrtOptimizationConstraintsParam();
constraintsParam.maxTravelTimeAlpha = 1.5;
constraintsParam.maxTravelTimeBeta = 10. * 60.;
DrtOptimizationConstraintsSet defaultConstraintsSet = drtConfigGroup.addOrGetDrtOptimizationConstraintsParams().addOrGetDefaultDrtOptimizationConstraintsSet();
drtConfigGroup.stopDuration = 30.;
constraintsParam.maxWaitTime = 600.;
constraintsParam.rejectRequestIfMaxWaitOrTravelTimeViolated = true;
defaultConstraintsSet.maxTravelTimeAlpha = 1.5;
defaultConstraintsSet.maxTravelTimeBeta = 10. * 60.;
defaultConstraintsSet.maxWaitTime = 600.;
defaultConstraintsSet.rejectRequestIfMaxWaitOrTravelTimeViolated = true;
defaultConstraintsSet.maxWalkDistance = 1000.;
drtConfigGroup.useModeFilteredSubnetwork = false;
drtConfigGroup.vehiclesFile = fleetFile;
drtConfigGroup.operationalScheme = DrtConfigGroup.OperationalScheme.door2door;
drtConfigGroup.plotDetailedCustomerStats = true;
constraintsParam.maxWalkDistance = 1000.;
drtConfigGroup.idleVehiclesReturnToDepots = false;

drtConfigGroup.addParameterSet(new ExtensiveInsertionSearchParams());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import org.matsim.contrib.drt.extension.operations.DrtWithOperationsConfigGroup;
import org.matsim.contrib.drt.extension.operations.operationFacilities.OperationFacilitiesParams;
import org.matsim.contrib.drt.extension.operations.shifts.config.ShiftsParams;
import org.matsim.contrib.drt.optimizer.DrtOptimizationConstraintsSet;
import org.matsim.contrib.drt.optimizer.insertion.extensive.ExtensiveInsertionSearchParams;
import org.matsim.contrib.drt.optimizer.rebalancing.RebalancingParams;
import org.matsim.contrib.drt.optimizer.rebalancing.mincostflow.MinCostFlowRebalancingStrategyParams;
import org.matsim.contrib.drt.run.DrtConfigGroup;
import org.matsim.contrib.drt.run.DrtOptimizationConstraintsParams;
import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup;
import org.matsim.contrib.dvrp.run.DvrpConfigGroup;
import org.matsim.contrib.zone.skims.DvrpTravelTimeMatrixParams;
Expand Down Expand Up @@ -45,39 +45,38 @@ void test() {

DrtWithOperationsConfigGroup drtWithShiftsConfigGroup = (DrtWithOperationsConfigGroup) multiModeDrtConfigGroup.createParameterSet("drt");

DrtConfigGroup drtConfigGroup = drtWithShiftsConfigGroup;
drtConfigGroup.mode = TransportMode.drt;
DrtOptimizationConstraintsParams constraintsParam = drtConfigGroup.getDrtOptimizationConstraintsParam();
constraintsParam.maxTravelTimeAlpha = 1.5;
constraintsParam.maxTravelTimeBeta = 10. * 60.;
drtConfigGroup.stopDuration = 30.;
constraintsParam.maxWaitTime = 600.;
constraintsParam.rejectRequestIfMaxWaitOrTravelTimeViolated = true;
drtConfigGroup.useModeFilteredSubnetwork = false;
drtConfigGroup.vehiclesFile = fleetFile;
drtConfigGroup.operationalScheme = DrtConfigGroup.OperationalScheme.door2door;
drtConfigGroup.plotDetailedCustomerStats = true;
constraintsParam.maxWalkDistance = 1000.;
drtConfigGroup.idleVehiclesReturnToDepots = false;

drtConfigGroup.addParameterSet(new ExtensiveInsertionSearchParams());

ConfigGroup rebalancing = drtConfigGroup.createParameterSet("rebalancing");
drtConfigGroup.addParameterSet(rebalancing);
drtWithShiftsConfigGroup.mode = TransportMode.drt;
DrtOptimizationConstraintsSet defaultConstraintsSet = drtWithShiftsConfigGroup.addOrGetDrtOptimizationConstraintsParams().addOrGetDefaultDrtOptimizationConstraintsSet();
drtWithShiftsConfigGroup.stopDuration = 30.;
defaultConstraintsSet.maxTravelTimeAlpha = 1.5;
defaultConstraintsSet.maxTravelTimeBeta = 10. * 60.;
defaultConstraintsSet.maxWaitTime = 600.;
defaultConstraintsSet.rejectRequestIfMaxWaitOrTravelTimeViolated = true;
defaultConstraintsSet.maxWalkDistance = 1000.;
drtWithShiftsConfigGroup.useModeFilteredSubnetwork = false;
drtWithShiftsConfigGroup.vehiclesFile = fleetFile;
drtWithShiftsConfigGroup.operationalScheme = DrtConfigGroup.OperationalScheme.door2door;
drtWithShiftsConfigGroup.plotDetailedCustomerStats = true;
drtWithShiftsConfigGroup.idleVehiclesReturnToDepots = false;

drtWithShiftsConfigGroup.addParameterSet(new ExtensiveInsertionSearchParams());

ConfigGroup rebalancing = drtWithShiftsConfigGroup.createParameterSet("rebalancing");
drtWithShiftsConfigGroup.addParameterSet(rebalancing);
((RebalancingParams) rebalancing).interval = 600;

MinCostFlowRebalancingStrategyParams strategyParams = new MinCostFlowRebalancingStrategyParams();
strategyParams.targetAlpha = 0.3;
strategyParams.targetBeta = 0.3;

drtConfigGroup.getRebalancingParams().get().addParameterSet(strategyParams);
drtWithShiftsConfigGroup.getRebalancingParams().get().addParameterSet(strategyParams);

DrtZoneSystemParams drtZoneSystemParams = new DrtZoneSystemParams();
SquareGridZoneSystemParams zoneParams = (SquareGridZoneSystemParams) drtZoneSystemParams.createParameterSet(SquareGridZoneSystemParams.SET_NAME);
zoneParams.cellSize = 500.;
drtZoneSystemParams.addParameterSet(zoneParams);
drtZoneSystemParams.targetLinkSelection = DrtZoneSystemParams.TargetLinkSelection.mostCentral;
drtConfigGroup.addParameterSet(drtZoneSystemParams);
drtWithShiftsConfigGroup.addParameterSet(drtZoneSystemParams);

multiModeDrtConfigGroup.addParameterSet(drtWithShiftsConfigGroup);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.matsim.contrib.common.timeprofile.TimeProfileCharts;
import org.matsim.contrib.common.util.ChartSaveUtils;
import org.matsim.contrib.drt.analysis.DrtEventSequenceCollector.EventSequence;
import org.matsim.contrib.drt.optimizer.DrtOptimizationConstraintsSet;
import org.matsim.contrib.drt.passenger.events.DrtRequestSubmittedEvent;
import org.matsim.contrib.drt.run.DrtConfigGroup;
import org.matsim.contrib.drt.schedule.DrtStayTask;
Expand Down Expand Up @@ -400,7 +401,7 @@ private void writeAndPlotWaitTimeEstimateComparison(Collection<EventSequence> pe

if (createChart) {
final JFreeChart chart2 = DensityScatterPlots.createPlot("Wait times", "Actual wait time [s]", "Initially planned wait time [s]",
times, Pair.of(0., drtCfg.getDrtOptimizationConstraintsParam().maxWaitTime));
times, Pair.of(0., drtCfg.addOrGetDrtOptimizationConstraintsParams().addOrGetDefaultDrtOptimizationConstraintsSet().maxWaitTime));
// xAxis.setLowerBound(0);
// yAxis.setLowerBound(0);
ChartUtils.writeChartAsPNG(new FileOutputStream(plotFileName), chart2, 1500, 1500);
Expand Down Expand Up @@ -663,12 +664,15 @@ private static void analyseDetours(Network network, List<DrtLeg> legs, Map<Id<Re
distances);
ChartSaveUtils.saveAsPNG(chart, fileName + "_distancePlot", 1500, 1500);

DrtOptimizationConstraintsSet defaultConstraintsSet = drtCfg.addOrGetDrtOptimizationConstraintsParams().addOrGetDefaultDrtOptimizationConstraintsSet();
final JFreeChart chart2 = DensityScatterPlots.createPlot("Travel Times", "travel time [s]", "unshared ride time [s]", travelTimes,
Pair.of(drtCfg.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha, drtCfg.getDrtOptimizationConstraintsParam().maxTravelTimeBeta));
Pair.of(defaultConstraintsSet.maxTravelTimeAlpha,
defaultConstraintsSet.maxTravelTimeBeta));
ChartSaveUtils.saveAsPNG(chart2, fileName + "_travelTimePlot", 1500, 1500);

final JFreeChart chart3 = DensityScatterPlots.createPlot("Ride Times", "ride time [s]", "unshared ride time [s]", rideTimes,
Pair.of(drtCfg.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha, drtCfg.getDrtOptimizationConstraintsParam().maxTravelTimeBeta));
Pair.of(defaultConstraintsSet.maxTravelTimeAlpha,
defaultConstraintsSet.maxTravelTimeBeta));
ChartSaveUtils.saveAsPNG(chart3, fileName + "_rideTimePlot", 1500, 1500);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.matsim.contrib.drt.estimator.impl;

import org.matsim.contrib.drt.estimator.DrtEstimator;
import org.matsim.contrib.drt.optimizer.DrtOptimizationConstraintsSet;
import org.matsim.contrib.drt.routing.DrtRoute;
import org.matsim.contrib.drt.run.DrtConfigGroup;
import org.matsim.contrib.drt.run.DrtOptimizationConstraintsParams;
import org.matsim.core.utils.misc.OptionalTime;

/**
Expand All @@ -20,7 +20,7 @@ public PessimisticDrtEstimator(DrtConfigGroup drtConfig) {
public Estimate estimate(DrtRoute route, OptionalTime departureTime) {
// If not estimates are present, use travel time alpha as detour
// beta is not used, because estimates are supposed to be minimums and not worst cases
DrtOptimizationConstraintsParams constraints = drtConfig.getDrtOptimizationConstraintsParam();
DrtOptimizationConstraintsSet constraints = drtConfig.addOrGetDrtOptimizationConstraintsParams().addOrGetDefaultDrtOptimizationConstraintsSet();
double travelTime = Math.min(route.getDirectRideTime() + constraints.maxAbsoluteDetour,
route.getDirectRideTime() * constraints.maxTravelTimeAlpha);

Expand Down
Loading

0 comments on commit be0a92d

Please sign in to comment.