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, optional): The column name for the tail of the edge. Default is “tail”.head (
str, optional): The column name for the head of the edge. Default is “head”.trav_time (
str, optional): The column name for the travel time of the edge. Default is “trav_time”.freq (
str, optional): The column name for the frequency of the edge. Default is “freq”.check_edges (
bool, optional): IfTrue, check the validity of the edges. Default isFalse.
- __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, optional): The column for the origin vertices. Default is “orig_vert_idx”.destination_column (
np.ndarray, optional): The column or the destination vertices. Default is “dest_vert_idx”.demand_column (
np.ndarray, optional): The column for the demand values. Default is “demand”.check_demand (
bool, optional): IfTrue, check the validity of the demand data. Default isFalse.threads (
int, optional): The number of threads to use for computation. Default is0(using all 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 result.keep_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