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

feature PuT assignment #483

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading