Skip to content

Commit

Permalink
Merge pull request #483 from djfrancesco/feature_PuT_assignment
Browse files Browse the repository at this point in the history
feature PuT assignment
  • Loading branch information
djfrancesco authored Dec 12, 2023
2 parents a616220 + 8715d29 commit 892b2b1
Show file tree
Hide file tree
Showing 14 changed files with 549 additions and 1 deletion.
1 change: 1 addition & 0 deletions aequilibrae/paths/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from aequilibrae.paths.traffic_assignment import TrafficAssignment
from aequilibrae.paths.vdf import VDF
from aequilibrae.paths.graph import Graph
from aequilibrae.paths.public_transport import HyperpathGenerating

from aequilibrae import global_logger

Expand Down
33 changes: 33 additions & 0 deletions aequilibrae/paths/public_transport.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ include 'hyperpath.pyx'


class HyperpathGenerating:
"""A class for hyperpath generation.
:Arguments:
**edges** (:obj:`pandas.DataFrame`): The edges of the graph.
**tail** (:obj:`str`): The column name for the tail of the edge (optional, default is "tail").
**head** (:obj:`str`): The column name for the head of the edge (optional, default is "head").
**trav_time** (:obj:`str`): The column name for the travel time of the edge (optional, default is "trav_time").
**freq** (:obj:`str`): The column name for the frequency of the edge (optional, default is "freq").
**check_edges** (:obj:`bool`): If True, check the validity of the edges (optional, default is False).
"""


def __init__(self, edges, tail="tail", head="head", trav_time="trav_time", freq="freq", check_edges=False):
# load the edges
if check_edges:
Expand Down Expand Up @@ -154,6 +171,22 @@ class HyperpathGenerating:
check_demand=False,
threads=0
):
"""Assigns demand to the edges of the graph.
:Arguments:
**demand** (:obj:`pandas.DataFrame`): The demand information.
**origin_column** (:obj:`str`): The column name for the origin vertices (optional, default is "orig_vert_idx").
**destination_column** (:obj:`str`): The column name for the destination vertices (optional, default is "dest_vert_idx").
**demand_column** (:obj:`str`): The column name for the demand values (optional, default is "demand").
**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).
"""

# check the input demand paramater
if check_demand:
self._check_demand(demand, origin_column, destination_column, demand_column)
Expand Down
1 change: 1 addition & 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 Down
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.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ Transit assignment
.. toctree::
:maxdepth: 1

transit_assignment/hyperpath_routing.rst
transit_assignment/transit_graph.rst
Loading

0 comments on commit 892b2b1

Please sign in to comment.