Skip to content

Commit

Permalink
Merge pull request #6414 from HSLdevcom/change-default-car-accessegre…
Browse files Browse the repository at this point in the history
…ss-penalty

Remove default accessegress penalty for car modes that use transit
  • Loading branch information
optionsome authored Feb 13, 2025
2 parents 67a7ff0 + 53eeb8a commit 6b9f5a4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,16 @@ private static TimeAndCostPenaltyForEnum<StreetMode> createDefaultCarPenalty() {
var flexDefaultPenalty = TimeAndCostPenalty.of(TimePenalty.of(ofMinutes(10), 1.3f), 1.3);
penaltyBuilder.with(StreetMode.FLEXIBLE, flexDefaultPenalty);

// Add penalty to all car variants with access and/or egress.
var carPenalty = TimeAndCostPenalty.of(TimePenalty.of(ofMinutes(20), 2f), 1.5);
for (var it : StreetMode.values()) {
if (it.includesDriving() && (it.accessAllowed() || it.egressAllowed())) {
// Apply car-penalty to all car modes used in access/egress. Car modes(CAR) used in direct street
// routing and car modes used when you bring the car with you onto transit should be excluded. The
// penalty should also be applied to modes used in access, egress AND direct (CAR_TO_PARK and
// CAR_RENTAL). This is not ideal, since we get an unfair comparison in the itinerary filters. We will
// live with this for now, but might revisit it later.
if (
it.includesDriving() && (it.accessAllowed() || it.egressAllowed()) && it != StreetMode.CAR
) {
penaltyBuilder.with(it, carPenalty);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ type QueryType {
"Input type for executing a travel search for a trip between two locations. Returns trip patterns describing suggested alternatives for the trip."
trip(
"Time and cost penalty on access/egress modes."
accessEgressPenalty: [PenaltyForStreetMode!] = [{streetMode : car, timePenalty : "20m + 2.0 t", costFactor : 1.5}, {streetMode : car_park, timePenalty : "20m + 2.0 t", costFactor : 1.5}, {streetMode : car_pickup, timePenalty : "20m + 2.0 t", costFactor : 1.5}, {streetMode : car_rental, timePenalty : "20m + 2.0 t", costFactor : 1.5}, {streetMode : flexible, timePenalty : "10m + 1.30 t", costFactor : 1.3}],
accessEgressPenalty: [PenaltyForStreetMode!] = [{streetMode : car_park, timePenalty : "20m + 2.0 t", costFactor : 1.5}, {streetMode : car_pickup, timePenalty : "20m + 2.0 t", costFactor : 1.5}, {streetMode : car_rental, timePenalty : "20m + 2.0 t", costFactor : 1.5}, {streetMode : flexible, timePenalty : "10m + 1.30 t", costFactor : 1.3}],
"The alightSlack is the minimum extra time after exiting a public transport vehicle. This is the default value used, if not overridden by the 'alightSlackList'."
alightSlackDefault: Int = 0,
"List of alightSlack for a given set of modes. Defaults: []"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ void testToString() {
"elevator: ElevatorPreferences{boardTime: 2m}, " +
"intersectionTraversalModel: CONSTANT, " +
"accessEgress: AccessEgressPreferences{penalty: TimeAndCostPenaltyForEnum{" +
"CAR: (timePenalty: 20m + 2.0 t, costFactor: 1.50), " +
"CAR_TO_PARK: " +
CAR_TO_PARK_PENALTY +
", " +
Expand Down
1 change: 0 additions & 1 deletion doc/user/RouteRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ performance will be better.

The default values are

- `car` = (timePenalty: 20m + 2.0 t, costFactor: 1.50)
- `car-to-park` = (timePenalty: 20m + 2.0 t, costFactor: 1.50)
- `car-pickup` = (timePenalty: 20m + 2.0 t, costFactor: 1.50)
- `car-rental` = (timePenalty: 20m + 2.0 t, costFactor: 1.50)
Expand Down

0 comments on commit 6b9f5a4

Please sign in to comment.