local_truck_generation: Generate local truck trips (tour segments) from pseudo-firms

Description Usage Arguments Details Examples

View source: R/local_truck_generation.R

Description

Generate local truck trips (tour segments) from pseudo-firms

Usage

1
2
3
local_truck_generation(synthetic_firms, generation_probabilities,
  random_seed = 1, max_resampling_attempts = 30,
  max_resampling_threshold = 0.5, save_to = NULL)

Arguments

synthetic_firms

Data frame containing pseudo-firms and their typical attributes

generation_probabilities

Data frame containing trip generation rates expressed as probabilities, for each trip generation category used in the model

random_seed

Integer value of random number seed set at outset of sampling of trips generated by pseudo-firms (defaults to 1)

max_resampling_attempts

Integer value that controls the number of times the generation sampling will repeat if it does not finish with same number of trips calculated in aggregate for the entire study area. If this number is exceeded then the model will error. Alternatively if '1' then resampling will be turned off.

max_resampling_threshold

Floating point number defining how close the simulation must match aggregate number of trips for the entire modeled area (default is 0.5 percent)

save_to

File name for saving the trip records with destinations appended in comma-separated value format (optional)

Details

The trip generation function samples the number of discrete daily trips generated by each pseudo-firm, and appends that number to each synthetic firm. The mode of transport used for each trip is also sampled and added to the trip records.

Examples

1
2
3
4
5
daily_trips <- local_truck_generation(synthetic_firms,
  generation_probabilities)
daily_trips <- local_truck_generation(synthetic_firms,
  generation_probabilities, random_seed = 1, max_resampling_attempts = 30,
  max_resampling_threshold = 0.5, "local-truck-origins.csv")

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