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

Feature: Merge consecutive walks at connection start or end at the service level #181

Open
munterfi opened this issue Jan 23, 2025 · 0 comments · May be fixed by #186
Open

Feature: Merge consecutive walks at connection start or end at the service level #181

munterfi opened this issue Jan 23, 2025 · 0 comments · May be fixed by #186
Assignees

Comments

@munterfi
Copy link
Member

munterfi commented Jan 23, 2025

Handle the case where a solution from the RaptorRouter has a walk transfer to a stop at the start or end of the connection, and then at the service level (ch.naviqore.service.gtfs.raptor.routing) another first or last mile walk is added to connect the target or source location.

Merge these two walks directly by using the walk calculator to calculate a walk from the public transit leg directly to the source or target location.

Affected are the following connection and isoline routing query templates: ConnectionGeoToGeo, ConnectionGeoToStop, ConnectionStopToGeo, IsolineGeoSource, e.g.:

@Override
    protected Connection postprocessConnection(GeoCoordinate source, ch.naviqore.raptor.Connection connection) {

        // TODO: Handle case where firstMile is not null and first leg is a transfer --> use walkCalculator
        // TODO: Handle case where lastMile is not null and last leg is a transfer --> use walkCalculator

        return switch (timeType) {
            case ARRIVAL -> {
                Walk lastMile = utils.createLastWalk(source, connection.getToStopId(), connection.getArrivalTime());
                yield utils.composeConnection(connection, lastMile);
            }
            case DEPARTURE -> {
                Walk firstMile = utils.createFirstWalk(source, connection.getFromStopId(),
                        connection.getDepartureTime());
                yield utils.composeConnection(firstMile, connection);
            }
        };
    }

TODOs

  • Write failing test cases at the service level (e.g., in RoutingQueryFacadeIT).
  • Implement an encapsulated solution which is reused in the query templates.
@munterfi munterfi changed the title Feature: Merge consecutive walk transfers at connection start or end at the service level Feature: Merge consecutive walks at connection start or end at the service level Jan 23, 2025
@clukas1 clukas1 self-assigned this Feb 4, 2025
clukas1 added a commit that referenced this issue Feb 4, 2025
clukas1 added a commit that referenced this issue Feb 5, 2025
… doInitialTransferRelaxation (round 0) is false.
clukas1 added a commit that referenced this issue Feb 13, 2025
…hnically not possible (transfer faster than route).
clukas1 added a commit that referenced this issue Feb 13, 2025
clukas1 added a commit that referenced this issue Feb 15, 2025
…allow source and target transfers from raptor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants