aequilibrae.paths.TransitAssignment#
- class aequilibrae.paths.TransitAssignment(*args, project=None, **kwargs)[source]#
-
Methods
__init__
(*args[, project])add_class
(transport_class)Adds a Transport class to the assignment
Returns all algorithms available for use
execute
([log_specification])Processes assignment
info
()Returns information for the transit assignment procedure
report
()Returns the assignment convergence report
results
()Prepares the assignment results as a Pandas DataFrame
save_results
(table_name[, keep_zero_flows, ...])Saves the assignment results to results_database.sqlite
set_algorithm
(algorithm)Chooses the assignment algorithm.
set_classes
(classes)Sets Transport classes to be assigned
set_cores
(cores)Allows one to set the number of cores to be used AFTER transit classes have been added
set_frequency_field
(frequency_field)Sets the graph field that contains the frequency -> e.g. 'freq'.
set_time_field
(time_field)Sets the graph field that contains free flow travel time -> e.g. 'trav_time'.
Attributes
- add_class(transport_class: TransportClassBase) None #
Adds a Transport class to the assignment
- Arguments:
transport_class (
TransportClassBase
): Transport class
- algorithms_available() list #
Returns all algorithms available for use
- Returns:
list
: List of string values to be used with set_algorithm
- execute(log_specification=True) None #
Processes assignment
- info() dict [source]#
Returns information for the transit assignment procedure
Dictionary contains keys ‘Algorithm’, ‘Classes’, ‘Computer name’, ‘Procedure ID’.
The classes key is also a dictionary with all the user classes per transit class and their respective matrix totals
- Returns:
info (
dict
): Dictionary with summary information
- report() DataFrame #
Returns the assignment convergence report
- Returns:
DataFrame (
pd.DataFrame
): Convergence report
- results() DataFrame [source]#
Prepares the assignment results as a Pandas DataFrame
- Returns:
DataFrame (
pd.DataFrame
): Pandas DataFrame with all the assignment results indexed on link_id
- save_results(table_name: str, keep_zero_flows=True, project=None) None [source]#
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
- set_algorithm(algorithm: str)[source]#
Chooses the assignment algorithm. Currently only ‘optimal-strategies’ is available.
‘os’ is also accepted as an alternative to ‘optimal-strategies’
- Arguments:
algorithm (
str
): Algorithm to be used
- set_classes(classes: List[TransportClassBase]) None #
Sets Transport classes to be assigned
- Arguments:
classes (
List[TransportClassBase]
): List of TransportClass’s for assignment
- set_cores(cores: int) None [source]#
Allows one to set the number of cores to be used AFTER transit classes have been added
Inherited from
AssignmentResultsBase
- Arguments:
cores (
int
): Number of CPU cores to use
- set_frequency_field(frequency_field: str) None [source]#
Sets the graph field that contains the frequency -> e.g. ‘freq’
- Arguments:
frequency_field (
str
): Field name
- set_time_field(time_field: str) None [source]#
Sets the graph field that contains free flow travel time -> e.g. ‘trav_time’
- Arguments:
time_field (
str
): Field name
- all_algorithms = ['optimal-strategies', 'os']#