.set_network_file_columns(+)

TntpNetworkReaderSettings method

Description

Define the column configuration of the network file that is to be parsed explicitly. The various supported column types are defined using the TntpFileColumnType and providing an index to the column this information is expected (zero base).

Signature

.set_network_file_columns(column_config: Dict[TntpFileColumnType, int])

with

Parameter Type Unit Default Description
column_config Dict[TntpFileColumnType, int] None N/A The column configuration definition

Return type

N/A

Example 1

from planit import *

# create a network converter
planit_instance = Planit()
network_converter = planit_instance.converter_factory.create(ConverterType.NETWORK)

# TNTP network reader        
reader = network_converter.create_reader(NetworkReaderType.TNTP)
reader.settings.set_network_file_columns({
        TntpFileColumnType.UPSTREAM_NODE_ID: 0,
        TntpFileColumnType.DOWNSTREAM_NODE_ID: 1,
        TntpFileColumnType.CAPACITY_PER_LANE: 2,
        TntpFileColumnType.LENGTH: 3,
        TntpFileColumnType.FREE_FLOW_TRAVEL_TIME: 4,
        TntpFileColumnType.B: 5,
        TntpFileColumnType.POWER: 6,
        TntpFileColumnType.MAXIMUM_SPEED: 7,
        TntpFileColumnType.TOLL: 8,
        TntpFileColumnType.LINK_TYPE: 9})

See also

N/A

Source code

Class TntpNetworkReaderSettingsWrapper in converterwrappers.py