temporal_allocation: Carry out temporal allocation for both intercity and local...

Description Usage Arguments Details Examples

View source: R/temporal_allocation.R

Description

Carry out temporal allocation for both intercity and local truck trips

Usage

1
temporal_allocation(daily_trips, temporal_factors, save_to = NULL)

Arguments

daily_trips

Data frame containing daily trip records, typically with origin and destination traffic analysis zones already appended

temporal_factors

Data frame containing proportions or number of trips per hour of the day, in 24-hour format (hours defined from 0 to 23), by truck type

save_to

Filename for saving the trip records with departure hour appended, in comma-separated value format (optional)

Details

This function appends a departure time for each trip in data frame containing trip records. These records can either be for local or inter- regional (FAF) flows. Since we might have different temporal distibutions for each type of trip this function would typically be run separately for each. However, the same set of temporal factors can be applied to each if desired. The departure hour is sampled from the temporal factors provided by the user, which can either be expressed as percentages for each hour, or total observed trips within each hour (from travel survey), or asserted weights for each hour. The factors must be defined for each truck type in the simulation, although the same factors can obviously be recycled if available for only fewer classes (e.g., all combination trucks, rather than single, double, or triple-trailer combinations). The minute is sampled randomly and appended to the departure hour in order to create a departure time. The result is the input data frame with the departure time appended to it.

Examples

1
2
3
4
hourly_faf_trucks <- temporal_allocation(daily_faf_trips,
  long_distance_factors)
hourly_local_trucks <- temporal_allocation(daily_local_trips,
  temporal_spread, "final_internal_trip_records.csv")

pbsag/swimctr documentation built on May 24, 2019, 10:38 p.m.