.settings
TntpNetworkReader property
The TntpNetworkReader
class instance can be created via the NetworkConverter
.
It provides the functionality to parse networks in the TNTP format, and possibly persist it in the same or another
format using a NetworkWriter. Once created the user can configure its settings.
For information on the TNTP data format, please consult the Data formats/Input/tntp section
All configuration of this reader is performed via its .settings
property, providing access to
the TntpNetworkReaderSettings
.
The user is required to explicitly configure at least the following settings on TntpNetworkReader:
.settings.set_network_file(+)
.settings.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
.settings.set_network_file_columns(+)
.settings.set_speed_units(+)
N/A
This class exposes the following properties:
Property | Availability | Description |
---|---|---|
.settings |
Always | Access to TntpNetworkReaderSettings to configure the reader |
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)
TntpNetworkReaderSettings
for configuration of the TNTP network reader
ConverterFactory
for the converter factory to create other types of converters
NetworkReaderType
for the supported network reader types
NetworkWriterType
for the supported network writer types
Class TntpNetworkReaderWrapper
in converterwrappers.py
TntpNetworkReader property