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

Start importing GTFS for São Paulo #891

Merged
merged 1 commit into from
Apr 14, 2022
Merged

Start importing GTFS for São Paulo #891

merged 1 commit into from
Apr 14, 2022

Conversation

dabreegster
Copy link
Collaborator

#372

I really wanted this to be simple, but it turned into some ridiculous yak-shaving to stop the simulation from crashing on the imported routes. I uncovered various bugs with the buses suddenly warping positions, because of the paths between consecutive stops not being built properly. I fixed most (not all) of them. Running the simulation in the city center of SP will crash because of the unfixed one, but Aricanduva and São Miguel Paulista run. No guarantees about the quality of the imported routes; there are likely tons of bugs, but I need to push through this first big change to make smaller progress.

@@ -529,13 +529,15 @@ fn finish_app_setup(
}
}
Mode::SomethingElse => {
let start_time = setup.start_time.unwrap_or(Duration::hours(6));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Now you can do --dev --time=00:05:42

if req.start.lane().road == req.end.lane().road
&& req.start.dist_along() > req.end.dist_along()
{
bail!(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I saw this near a big bus station. Maybe the stops in GTFS were out of order, maybe there was some bug -- for now, just give up on the route

@@ -158,6 +158,9 @@ impl PathV2 {
// At the simulation layer, we may need to block intermediate lanes to exit a driveway,
// so reflect that cost here. The high cost should only be worth it when the v2 path
// requires that up-front turn from certain lanes.
//
// TODO This is only valid if we were leaving from a driveway! This is making some
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This crashes SP center. The pathfinding layer always assumes the start lane can change, which is just super untrue! Need to revisit when I introduced this code and see if I thought about it then.

self.router.head().get_polyline(map).length()
},
);
let end_dist = if self.router.last_step() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

More useful error

@dabreegster dabreegster merged commit d386948 into master Apr 14, 2022
@dabreegster dabreegster deleted the sp_gtfs branch April 14, 2022 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant