Skip to content

Commit

Permalink
merge latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nkuehnel committed May 10, 2024
1 parent 3dd48c2 commit 52fdd8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
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.fare.DrtFareParams;
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,11 +20,12 @@ 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
double travelTime = Math.min(route.getDirectRideTime() + drtConfig.getDrtOptimizationConstraintsParam().maxAbsoluteDetour,
route.getDirectRideTime() * drtConfig.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha);
DrtOptimizationConstraintsParams constraints = drtConfig.getDrtOptimizationConstraintsParam();
double travelTime = Math.min(route.getDirectRideTime() + constraints.maxAbsoluteDetour,
route.getDirectRideTime() * constraints.maxTravelTimeAlpha);

// for distance, also use the max travel time alpha
return new Estimate(route.getDistance() * drtConfig.maxTravelTimeAlpha, travelTime, drtConfig.maxWaitTime, 0);
return new Estimate(route.getDistance() * constraints.maxTravelTimeAlpha, travelTime, constraints.maxWaitTime, 0);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void install() {
.asEagerSingleton();
case stopbased, serviceAreaBased -> {
bindModal( AccessEgressFacilityFinder.class ).toProvider( modalProvider(
getter -> new ClosestAccessEgressFacilityFinder( drtCfg.maxWalkDistance,
getter -> new ClosestAccessEgressFacilityFinder( drtCfg.getDrtOptimizationConstraintsParam().maxWalkDistance,
getter.get( Network.class ),
QuadTrees.createQuadTree( getter.getModal( DrtStopNetwork.class ).getDrtStops().values() ) ) ) )
.asEagerSingleton();
Expand Down

0 comments on commit 52fdd8c

Please sign in to comment.