Skip to content

Commit

Permalink
Merge branch 'feature_PuT_assignment' into integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Moss committed Dec 14, 2023
2 parents 8f81c86 + 892b2b1 commit e6b56d3
Show file tree
Hide file tree
Showing 30 changed files with 1,186 additions and 128 deletions.
26 changes: 24 additions & 2 deletions aequilibrae/paths/public_transport.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,24 @@ class HyperpathGenerating:
assignment_config: dict,
check_edges: bool =False,
check_demand: bool =False,
threads: int = -1
threads: int = 0
):
"""A class for hyperpath generation.
:Arguments:
**graph** (:obj:`TransitGraph`): TransitGraph object
**matrix** (:obj:`AequilibraEMatrix`): AequilbraE Matrix object for the demand
**assignment_conffig** (:obj:`dict[str, str]`): Dictionary containing the `Time field` and `Frequency field` columns names.
**check_edges** (:obj:`bool`): If True, check the validity of the edges (optional, default is False).
**check_demand** (:obj:`bool`): If True, check the validity of the demand data (optional, default is False).
**threads** (:obj:`int`): The number of threads to use for computation (optional, default is 0, using all available threads).
"""

edges = graph.graph
trav_time = assignment_config["Time field"]
freq = assignment_config["Frequency field"]
Expand Down Expand Up @@ -167,7 +183,13 @@ class HyperpathGenerating:
if edges[col].min() < 0.0:
raise ValueError(f"column '{col}' should be nonnegative")

def execute(self, threads=None):
def execute(self, threads=0):
"""Assigns demand to the edges of the graph.
:Arguments:
**threads** (:obj:`int`):The number of threads to use for computation (optional, default is 0, using all available threads).
"""

# check the input demand paramater
if not threads:
threads = self.threads
Expand Down
1 change: 1 addition & 0 deletions aequilibrae/transit/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from .transit import Transit
from .transit_graph_builder import TransitGraphBuilder
3 changes: 1 addition & 2 deletions aequilibrae/transit/transit.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ def create_transit_database(self):
def create_graph(self, **kwargs) -> TransitGraphBuilder:
period_id = kwargs.get("period_id", self.periods.default_period.period_id)
graph = TransitGraphBuilder(self.pt_con, period_id, **kwargs)
graph.create_vertices()
graph.create_edges()
graph.create_graph()
self.graphs[period_id] = graph
return graph

Expand Down
273 changes: 150 additions & 123 deletions aequilibrae/transit/transit_graph_builder.py

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ Paths
VDF
TrafficClass
TrafficAssignment
HyperpathGenerating

Transit
-------
Expand All @@ -115,3 +116,5 @@ Transit
:toctree: generated/

Transit
SF_graph_builder

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/hyperpath_bell_s_network.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/transit_graph_connectors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/transit_graph_routes_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/transit_graph_routes_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/transit_graph_transfer_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/transit_graph_transfer_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/transit_graph_transfer_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/transit_graph_zones.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/source/modeling_with_aequilibrae.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ a start guide to a complete view into AequilibraE's data structure.
modeling_with_aequilibrae/project_database
modeling_with_aequilibrae/parameter_file
modeling_with_aequilibrae/public_transport

modeling_with_aequilibrae/transit_assignment
11 changes: 11 additions & 0 deletions docs/source/modeling_with_aequilibrae/transit_assignment.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _transit_assignment:

Transit assignment
==================


.. toctree::
:maxdepth: 1

transit_assignment/hyperpath_routing.rst
transit_assignment/transit_graph.rst
Loading

0 comments on commit e6b56d3

Please sign in to comment.