.set_time_period_duration(+)

TntpDemandsReaderSettings method

Description

Set the duration of the trips, e.g., when set to 1 hour, the trips volume provided is expected to be pcu/hour, if set to 8 hours, the trip volume will be divided by 8 to get to the pcu/hour unit used in PLANit internally.

Signature

.set_time_period_duration(duration: Union[float, int], time_units: TimeUnits)

with

Parameter Type Unit Default Description
duration float or int None 1.0 The duration (without unit)
time_units TimeUnits None HOURS The duration time unit

Return type

N/A

Example 1

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

N/A

Source code

Class TntpDemandsReaderSettingsWrapper in converterwrappers.py