.settings
TntpDemandsReader property
Description
The .settings
property allows access to the settings of the TntpDemandsReader
.
Return type
TntpDemandsReaderSettings
implementation
Example 1
from planit import *
planit_instance = Planit()
# TNTP net reader - prep
tntp_net_reader = planit_instance.converter_factory.create(ConverterType.NETWORK).create_reader(NetworkReaderType.TNTP)
tntp_net_reader.settings.set_network_file(NETWORK_FILE_PATH)
tntp_net_reader.settings.set_node_coordinate_file(NODE_COORD_FILE_PATH)
tntp_net_reader.settings.set_network_file_columns(create_tntp_network_file_cols())
# ... other settings
# TNTP zon reader - prep (pass in net_reader)
tntp_zon_reader = planit_instance.converter_factory.create(ConverterType.ZONING).create_reader(ZoningReaderType.TNTP, tntp_net_reader)
tntp_zon_reader.settings.set_network_file_location(NETWORK_FILE_PATH)
# other settings
converter = planit_instance.converter_factory.create(ConverterType.DEMANDS)
# TNTP demands reader (pass in zon_reader)
tntp_dem_reader: TntpDemandsReaderWrapper = converter.create_reader(DemandsReaderType.TNTP, tntp_zon_reader)
tntp_dem_reader.settings.set_demand_file_location(DEMAND_FILE_PATH)
#PLANit demands writer
planit_writer = converter.create_writer(DemandsWriterType.PLANIT)
planit_writer.settings.set_output_directory("<path_to_output_dir>")
# perform conversion
converter.convert(tntp_reader, planit_writer)
See also
TntpDemandsReaderSettings
the settings available
Source code
Class TntpDemandsReaderSettingsWrapper
in converterwrappers.py