TntpNetworkReaderSettings

TntpNetworkReaderSettings instance

The TntpNetworkReaderSettings instance is accessible via the TntpNetworkReader its .settings property. It allows the user to configure the TntpNetworkReader.

Minimum configuration requirements

The user is required to explicitly configure at least the following settings on TntpNetworkReader:

  • set a network file via .set_network_file(+)
  • set node coordinates file via .set_node_coordinate_file(+)

since the TNTP format is not very rigorously defined it is most likely you also explicitly need to provide the column mapping information to correctly parse the data, as well as defining the units in which the information is provided via

  • configure the column configuration via .set_network_file_columns(+)
  • configure units via various methods, e.g., for speed units for example use .set_speed_units(+)

Methods

A TntpNetworkReaderSettings instance exposes the following methods. The Compulsory column indicates it the user is expected to configure this setting explicitly or not.

Name Compulsory Default Description
.set_network_file(+) YES N/A Set the network input file location
.set_node_coordinate_file(+) YES N/A Set the network node locations file location
.set_network_file_columns(+) YES N/A Define the network column configuration
.set_speed_units(+) NO km/h Define the speed units
.set_length_units(+) NO km Define the length units
.set_capacity_period(+) NO [1, h] Define the period and unit of how capacity is defined
.set_free_flow_travel_time_units(+) NO h Define the time unit for the free flow travel time
.set_default_maximum_speed(+) YES N/A Define the default maximum speed to apply

In future versions an appropriate default maximum speed should be available so it is not needed to be defined anymore. Currently, this is not the case yet.

Various getters for the documented setters are available, e.g., .get_capacity_period_duration() etc., they are not yet documented though, have a look in the source code for specifics

Properties

N/A

Example 1 - Minimum required settings

from planit import *

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

# TNTP network reader        
tntp_reader = network_converter.create_reader(NetworkReaderType.TNTP)
tntp_reader.settings.set_network_file(NETWORK_FILE_PATH)
tntp_reader.settings.set_node_coordinate_file(NODE_COORD_FILE_PATH)

#PLANit network writer
planit_writer = network_converter.create_writer(NetworkWriterType.PLANIT)
planit_writer.settings.set_output_directory("<path_to_output_dir>")

# perform conversion
network_converter.convert(tntp_reader, planit_writer)

See also

TntpNetworkReader TNTP network reader class these settings reside on

Source code

Class TntpNetworkReaderSettingsWrapper in converterwrappers.py


.set_capacity_period(+)

TntpNetworkReaderSettings method

.set_default_maximum_speed(+)

TntpNetworkReaderSettings method

.set_free_flow_travel_time_units(+)

TntpNetworkReaderSettings method

.set_length_units(+)

TntpNetworkReaderSettings method

.set_network_file_columns(+)

TntpNetworkReaderSettings method

.set_network_file(+)

TntpNetworkReaderSettings method

.set_node_coordinate_file(+)

TntpNetworkReaderSettings method

.set_speed_units(+)

TntpNetworkReaderSettings method