9.5.4. aequilibrae.PathResults

class aequilibrae.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.sqlite')
proj.network.build_graphs()
# Mode c is car in this project
car_graph = proj.network.graphs['c']

# minimize distance
car_graph.set_graph('distance')

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

# res.milepost, res.path_nodes, res.path, res.skims contain all results

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

# clears all computation results
res.reset()
__init__() → None

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__()

Initialize self.

compute_path(origin, destination)

Computes the path between two nodes in the network

prepare(graph)

Prepares the object with dimensions corresponding to the graph object

reset()

Resets object to prepared and pre-computation state

update_trace(destination)

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

__init__() → None

Initialize self. See help(type(self)) for accurate signature.

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