aequilibrae.paths.results package

Submodules

aequilibrae.paths.results.assignment_results module

class aequilibrae.paths.results.assignment_results.AssignmentResults

Bases: object

Assignment result holder for a single TrafficClass with multiple user classes

__init__()
prepare(graph: aequilibrae.paths.graph.Graph, matrix: aequilibrae.matrix.aequilibrae_matrix.AequilibraeMatrix) None

Prepares the object with dimensions corresponding to the assignment matrix and graph objects

Args:

graph (Graph): Needs to have been set with number of centroids and list of skims (if any)

matrix (AequilibraeMatrix): Matrix properly set for computation with

matrix.computational_view(list)

reset() None

Resets object to prepared and pre-computation state

total_flows() None

Totals all link flows for this class into a single link load

Results are placed into total_link_loads class member

set_cores(cores: int) None

Sets number of cores (threads) to be used in computation

Value of zero sets number of threads to all available in the system, while negative values indicate the number of threads to be left out of the computational effort.

Resulting number of cores will be adjusted to a minimum of zero or the maximum available in the system if the inputs result in values outside those limits

Args:

cores (int): Number of cores to be used in computation

get_load_results() aequilibrae.matrix.aequilibrae_data.AequilibraeData

Translates the assignment results from the graph format into the network format

Returns:

dataset (AequilibraeData): AequilibraE data with the traffic class assignment results

save_to_disk(file_name=None, output='loads') None

Function to write to disk all outputs computed during assignment

Args:

file_name (str): Name of the file, with extension. Valid extensions are: [‘aed’, ‘csv’, ‘sqlite’] output (str, optional): Type of output (‘loads’, ‘path_file’). Defaults to ‘loads’

aequilibrae.paths.results.path_results module

class aequilibrae.paths.results.path_results.PathResults

Bases: object

Path computation result holder

from aequilibrae.project import Project
from aequilibrae.paths.results import PathResults

proj = Project()
proj.load('path/to/project/folder')
proj.network.build_graphs()
# Mode c is car in this project
car_graph = proj.network.graphs['c']

# minimize distance
car_graph.set_graph('distance')

# If you want to compute skims
# It does increase path computation time substantially
car_graph.set_skimming(['distance', 'travel_time'])

res = PathResults()
res.prepare(car_graph)
res.compute_path(17, 13199)

# res.milepost contains the milepost corresponding to each node along the path
# res.path_nodes contains the sequence of nodes that form the path
# res.path  contains the sequence of links that form the path
# res.path_link_directions contains the link directions corresponding to the above links
# res.skims contain all skims requested when preparing the graph

# Update all the outputs mentioned above for destination 1265. Same origin: 17
res.update_trace(1265)

# clears all computation results
res.reset()
__init__() None
compute_path(origin: int, destination: int) None

Computes the path between two nodes in the network

Args:

origin (int): Origin for the path

destination (int): Destination for the path

prepare(graph: aequilibrae.paths.graph.Graph) None

Prepares the object with dimensions corresponding to the graph object

Args:

graph (Graph): Needs to have been set with number of centroids and list of skims (if any)

reset() None

Resets object to prepared and pre-computation state

update_trace(destination: int) None

Updates the path’s nodes, links, skims and mileposts

It does not re-compute the path tree, so it saves most of the computation time

Args:

destination (int): ID of the node we are computing the path too

aequilibrae.paths.results.skim_results module

class aequilibrae.paths.results.skim_results.SkimResults

Bases: object

Network skimming result holder

from aequilibrae.project import Project
from aequilibrae.paths.results import SkimResults

proj = Project()
proj.load('path/to/project/folder')
proj.network.build_graphs()
# Mode c is car in this project
car_graph = proj.network.graphs['c']

# minimize travel time
car_graph.set_graph('free_flow_travel_time')

# Skims travel time and distance
car_graph.set_skimming(['free_flow_travel_time', 'distance'])

res = SkimResults()
res.prepare(car_graph)
res.compute_skims()

res.skims.export('path/to/matrix.aem')
__init__()
prepare(graph: aequilibrae.paths.graph.Graph)

Prepares the object with dimensions corresponding to the graph objects

Args:

graph (Graph): Needs to have been set with number of centroids and list of skims (if any)

set_cores(cores: int) None

Sets number of cores (threads) to be used in computation

Value of zero sets number of threads to all available in the system, while negative values indicate the number of threads to be left out of the computational effort.

Resulting number of cores will be adjusted to a minimum of zero or the maximum available in the system if the inputs result in values outside those limits

Args:

cores (int): Number of cores to be used in computation

Module contents