aequilibrae.paths.HyperpathGenerating#
- class aequilibrae.paths.HyperpathGenerating(edges, tail='tail', head='head', trav_time='trav_time', freq='freq', check_edges=False, skim_cols=None, *, o_vert_ids=array([], dtype=int64), d_vert_ids=array([], dtype=int64), nodes_to_indices)#
A class for hyperpath generation.
- Arguments:
edges (
pandas.DataFrame
): The edges of the graph.tail (
str
): The column name for the tail of the edge (Optional, default is “tail”).head (
str
): The column name for the head of the edge (Optional, default is “head”).trav_time (
str
): The column name for the travel time of the edge (Optional, default is “trav_time”).freq (
str
): The column name for the frequency of the edge (Optional, default is “freq”).check_edges (
bool
): If True, check the validity of the edges (Optional, default is False).
- __init__(edges, tail='tail', head='head', trav_time='trav_time', freq='freq', check_edges=False, skim_cols=None, *, o_vert_ids=array([], dtype=int64), d_vert_ids=array([], dtype=int64), nodes_to_indices)#
Methods
__init__
(edges[, tail, head, trav_time, ...])assign
(origin_column, destination_column, ...)Assigns demand to the edges of the graph.
check_skim_cols
(skim_cols)compute_skim_cols
(skim_cols, edges, trav_time)info
()run
(origin, destination, volume)save_results
(table_name[, keep_zero_flows, ...])Saves the assignment results to results_database.sqlite
- assign(origin_column, destination_column, demand_column, check_demand=False, threads=None)#
Assigns demand to the edges of the graph.
Assumes the
*_column
arguments are provided as numpy arrays that form a COO sprase matrix.- Arguments:
- origin_column (
np.ndarray
): The column for the origin vertices (Optional, default is “orig_vert_idx”).
- destination_column (
np.ndarray
): The column or the destination vertices (Optional, default is “dest_vert_idx”).
demand_column (
np.ndarray
): The column for the demand values (Optional, default is “demand”).- check_demand (
bool
): If True, check the validity of the demand data (Optional, default is False
).
threads (
int
):The number of threads to use for computation (Optional, default is 0, using all- origin_column (
available threads).
- check_skim_cols(skim_cols: Union(list[str], tuple[str], set(str)))#
- compute_skim_cols(skim_cols, edges: DataFrame, trav_time: str)#
- info() dict #
- run(origin, destination, volume)#
- save_results(table_name: str, keep_zero_flows=True, project=None) None #
Saves the assignment results to results_database.sqlite
Method fails if table exists
- Arguments:
table_name (
str
): Name of the table to hold this assignment resultkeep_zero_flows (
bool
): Whether we should keep records for zero flows. Defaults toTrue
- project (
Project
, Optional): Project we want to save the results to. Defaults to the active project
- project (