TntpDemandsReaderSettings

TntpDemandsReaderSettings instance

The TntpDemandsReaderSettings instance is accessible via the TntpDemandsReader its .settings property. It allows the user to configure the TntpDemandsReader.

Minimum configuration requirements

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

  • set trip demands file location via .set_demand_file_location(+)

Methods

A TntpDemandsReaderSettings 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_demand_file_location(+) YES N/A Set the demand input file location
.set_start_time_since_midnight(+) NO 8:00 AM Set the start time relative to midnight
.set_time_period_duration(+) NO 1 hour Set the duration of demand period in relevant unit

Various getters for the documented setters are available, e.g., .set_demand_file_location() 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 *

planit_instance = Planit()

# prep a TNTP zoning reader
# tntp_zon_reader = ...

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)
tntp_dem_reader.settings.set_start_time_since_midnight(8.0, TimeUnits.HOURS)
tntp_dem_reader.settings.set_time_period_duration(1.0, TimeUnits.HOURS)

# create a demands writer, then convert

See also

TntpDemandsReader TNTP demands reader class these settings reside on

Source code

Class TntpDemandsReaderSettingsWrapper in converterwrappers.py


.set_demand_file_location(+)

TntpDemandsReaderSettings method

.set_start_time_since_midnight(+)

TntpDemandsReaderSettings method

.set_time_period_duration(+)

TntpDemandsReaderSettings method