aequilibrae.paths.NetworkSkimming#

class aequilibrae.paths.NetworkSkimming(graph, origins=None, project=None)[source]#
__init__(graph, origins=None, project=None)[source]#

Methods

__init__(graph[, origins, project])

doWork()

execute()

Runs the skimming process as specified in the graph

save_to_project(name[, format, project])

Saves skim results to the project folder and creates record in the database

set_cores(cores)

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

Attributes

signal

doWork()[source]#
execute()[source]#

Runs the skimming process as specified in the graph

save_to_project(name: str, format='omx', project=None) None[source]#

Saves skim results to the project folder and creates record in the database

Arguments:

name (str): Name of the matrix. Same value for matrix record name and file (plus extension)

format (str, Optional): File format (‘aem’ or ‘omx’). Default is ‘omx’

project (Project, Optional): Project we want to save the results to. Defaults to the active project

set_cores(cores: int) None[source]#

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

Arguments:

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

signal = <aequilibrae.utils.python_signal.PythonSignal object>#

>>> from aequilibrae.paths.network_skimming import NetworkSkimming
>>> project = create_example(project_path)
>>> network = project.network
>>> network.build_graphs()
>>> graph = network.graphs['c']
>>> graph.set_graph(cost_field="distance")
>>> graph.set_skimming("distance")
>>> skm = NetworkSkimming(graph)
>>> skm.execute()

# The skim report (if any error generated) is available here >>> skm.report []

# To access the skim matrix directly from its temporary file >>> matrix = skm.results.skims

# Or you can save the results to disk >>> skm.save_to_project(os.path.join(project_path, ‘matrices/skimming_result.omx’))

# Or specify the AequilibraE’s matrix file format >>> skm.save_to_project(os.path.join(project_path, ‘matrices/skimming_result.aem’), ‘aem’)

>>> project.close()