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

S&F transit graph creation #420

Conversation

djfrancesco
Copy link
Contributor

@djfrancesco djfrancesco commented Jun 2, 2023

Load these elements from the transit database:

  • stops, with parent station id and coordinates
  • stations (stops with no parent station)
  • filtered trips corresponding to a given time range (e.g. week day from 6h30 to 9h am)
  • pattern segments
  • compute mean headway
  • compute segment travel time
  • transfers with corresponding stops and walking time

We also need to load a list of zones:

  • transport assign zones with names/id, compute their centroid

Now create the graph vertices:

  • stop vertices
  • boarding vertices
  • alighting vertices
  • OD vertices (zone centroids)

And the graph edges:

  • on-board edges (from boarding to alighting vertices)
  • boarding edges (from stop to boarding vertices)
  • alighting edges (from alighting to stop vertices)
  • dwell edges (from alighting to boarding vertices)
  • inner stop transfer edges
  • inner station transfer edges
  • transfers from the GTFS transfer table
  • walking edges between the stops of a station
  • walking edges between stations that are close from each other
  • connector edges (from OD vertices to inner zone stops:stations and vice-versa)

Add model parameters:

  • uniform_dwell_time_in_seconds
  • with_outer_stop_transfers
  • with_outer_station_transfers
  • access_time_factor
  • egress_time_factor
  • wait_time_factor
  • walk_time_factor
  • alighting_penalty_in_seconds
  • on_board_time_factor

Add specific transport mode on-board time factors: funicular, subway, tram, bus, hls_bus, train, boat,...

  • get the transport system for each segment, from the sqlite/gtfs data

djfrancesco and others added 30 commits June 2, 2023 17:04
Co-authored-by: pveigadecamargo <pveigadecamargo@anl.gov>
Jake-Moss and others added 28 commits August 1, 2023 13:22
Usage:
```python
graph = SF_graph_builder(pt_con, prj_con)
graph.create_vertices()
graph.create_edges()
graph.create_additional_db_fields()
graph.save_vertices()
graph.save_edges()
```

Caveats are noted in the comments of the functions.
Allows the whole graph to be read back into aequilibrae
We know use WKB format consistently and only convert out when need. String manipulation and regexs
have also been replaced.

type -> node_type, link_type
head_vert_id -> a_node
tail_vert_id -> b_node
coord -> geometry
vert_id -> node_id
edge_id -> link_id
…aE#438)

* Prevent invalid attribute names on AequilibraE data fields

This previously would have resulted in syntax error when accessing but
its best we don't accept them anyway.

* Fix multiple classes not being presented in the returned df

Bug report: https://groups.google.com/g/aequilibrae/c/y_q9nLNs6-Y/m/yWXNpey9AAAJ

* Style

* Skip if network fails

* Rounding

* fixes test

* Revert "Rounding"

Vatican City really did move huh

This reverts commit d9d0a5d.

---------

Co-authored-by: pveigadecamargo <pveigadecamargo@anl.gov>
Includes files copied from network triggers with slight modifications

Need to remove unnecessary columns from links and nodes tables.

Zones are still saved to project db and also need to be migrated.
With the release of Cython 3.0.0 there are a few changes of note to use. Particularly the performance impact of the
removal of the implicit noexcept.

Now all cdefs allow exceptions by default meaning every cdef must require the gil at the end of the function regardless
of whether it was nogil or not. Adding the noexcept clause reverts to the old behaviour.

There is a compiler directive to result this old behaviour but better be be explicit when the solution is one regex away:
`^(cp?def(?:.|\n).*?)(nogil|):$`

https://cython.readthedocs.io/en/latest/src/userguide/migrating_to_cy30.html#exception-values-and-noexcept
@djfrancesco djfrancesco marked this pull request as ready for review September 6, 2023 14:09
@djfrancesco djfrancesco merged commit 8b93351 into AequilibraE:feature_PuT_assignment Sep 6, 2023
14 of 18 checks passed
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.

None yet

6 participants