Skip to content

Include initial walk in bestRoute #62

@mcsoini

Description

@mcsoini

First of all, thank you so much for this efficient implementation, which is also a great match for my backend use case.

Not sure if a feature or a bug, but when the first leg of the bestRoute is a walk, it is not included in the route. Example:

minotor> .route from Bern to Bern Marzili at 08:00
Arriving to Bern Marzili at 08:11 with 0 transfers from Bern.
Found route from Bern to Bern Marzili:
Leg 1:
  From: Bern (Marzilibahn)
  To: Bern Marzili
  Route: FUNICULAR 2350, Departure: 08:10, Arrival: 08:11

Would you consider changing while (round > 0) to while (round >= 0) in the Result class? This gives

minotor> .route from Bern to Bern Marzili at 08:00
Arriving to Bern Marzili at 08:11 with 0 transfers from Bern.
Found route from Bern to Bern Marzili:
Leg 1:
  From: Bern
  To: Bern (Marzilibahn)
  Transfer: REQUIRES_MINIMAL_TIME, Minimum Transfer Time: 10:00
Leg 2:
  From: Bern (Marzilibahn)
  To: Bern Marzili
  Route: FUNICULAR 2350, Departure: 08:10, Arrival: 08:11

which is more in line with expectations, imo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions