Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default accessegress penalty for car modes that use transit #6414

Open
wants to merge 1 commit into
base: dev-2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ private static TimeAndCostPenaltyForEnum<StreetMode> createDefaultCarPenalty() {
// Add penalty to all car variants with access and/or egress.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should be updated.

var carPenalty = TimeAndCostPenalty.of(TimePenalty.of(ofMinutes(20), 2f), 1.5);
for (var it : StreetMode.values()) {
if (it.includesDriving() && (it.accessAllowed() || it.egressAllowed())) {
if (
it.includesDriving() && (it.accessAllowed() || it.egressAllowed()) && !it.transferAllowed()
) {
Comment on lines +174 to +176
Copy link
Member

@t2gran t2gran Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (
it.includesDriving() && (it.accessAllowed() || it.egressAllowed()) && !it.transferAllowed()
) {
// Apply car-penalty to all car modes allowed in access/egress only. Exclude car modes(CAR) used
// in direct street routing and car modes used when you bring the car with you onto transit. This is
// a bit limited and will not work if we combine car access/egress modes like CAR_TO_PARK with CAR
// in the same search. This is currently not possible, but if we enable this in the future this logic must be
// looked at again.
if (
it.includesDriving() && (it.accessAllowed() || it.egressAllowed()) && it != 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 @@ -460,7 +460,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
Loading