Multiple parameters can be used to tune the generator according to your needs. We describe next these parameters.
A first set of primary parameters determine the global behaviour of the generator. These parameters can also be set by a corresponding optional argument when calling the function berlinmod_generate
.
P_SCALE_FACTOR: float
: Main parameter that determines the size of the data generated. Default value: 0.005. Corresponding optional argument: scaleFactor
. By default, the scale factor determine the number of vehicles and the number of days they are observed as follows:
noVehicles int = round((2000 * sqrt(P_SCALE_FACTOR))::numeric, 0)::int; noDays int = round((sqrt(P_SCALE_FACTOR) * 28)::numeric, 0)::int;
For example, for a scale factor of 1.0, the number of vehicles and the number of days will be, respectively, 2000 and 28. Alternatively, you can manually set the number of vehicles or the number of days using the optional arguments noVehicles
and noDays
, which are both integers.
P_START_DAY: date
: The day the observation starts. Default value: Monday 2020-01-06. Corresponding optional argument: startDay
.
P_PATH_MODE: text
: Method for selecting a path between source and target nodes. Possible values are 'Fastest Path'
(default) and 'Shortest Path'
. Corresponding optional argument: pathMode
.
P_NODE_CHOICE: text
: Method for selecting home and work nodes. Possible values are 'Network Based'
for chosing the nodes with a uniform distribution among all nodes (default) and 'Region Based'
to use the population and number of enterprises statistics in the Regions
tables. Corresponding optional argument: nodeChoice
.
P_DISTURB_DATA: boolean
: Determine whether imprecision is added to the data generated. Possible values are false (no imprecision, default) and true (disturbed data). Corresponding optional argument: disturbData
.
P_MESSAGES: text
: Quantity of messages shown describing the generation process. Possible values are 'minimal'
, 'mediummmm'
, 'verbose'
, and 'debug'
. Corresponding optional argument: messages
.
P_TRIP_GENERATION: text
: Determine the language used to generate the trips. Possible values are 'C'
(default) and 'SQL'
. Corresponding optional argument: tripGeneration
. This parameter determines whether the SQL function createTrip
in the file berlinmod_datagenerator.sql
or the C function create_trip
in the distribution of MobilityDB will be used for generating trips. Although the C function is faster than the corresponding SQL function, the SQL function can be easily modified to further customize the data generation.
For example, possible calls of the berlinmod_generate
function setting values for the parameters are as follows.
-- Use all default values SELECT berlinmod_generate(); -- Set the scale factor and use all other default values SELECT berlinmod_generate(scaleFactor := 2.0); -- Set the number of vehicles and number of days SELECT berlinmod_generate(noVehicles := 10, noDays := 10);
Another set of parameters determining the global behaviour of the generator are given next.
P_RANDOM_SEED: float
: Seed for the random generator used to ensure deterministic results. Default value: 0.5.
P_NEIGHBOURHOOD_RADIUS: float
: Radius in meters defining a node neigbourhood. Default value: 3000.0.
P_SAMPLE_SIZE: int
: Size for sample relations. Default value: 100.
P_VEHICLE_TYPES: text[]
: Set of vehicle types. Default value: {"passenger", "bus", "truck"}
.
P_VEHICLE_MODELS: text[]
: Set of vehicle models. Default value:
{"Mercedes-Benz", "Volkswagen", "Maybach", "Porsche", "Opel", "BMW", "Audi", "Acabion", "Borgward", "Wartburg", "Sachsenring", "Multicar"}
P_PGROUTING_BATCH_SIZE: int
: Number of paths sent in a batch to pgRouting. Default value: 1e5
.
Another set of paramaters determine how the trips are created out of the paths.
P_EPSILON_SPEED: float
: Minimum speed in Km/h that is considered as a stop and thus only an accelaration event can be applied. Default value: 1.0.
P_EPSILON: float
: Minimum distance in the units of the coordinate system that is considered as zero. Default value: 0.0001.
P_EVENT_C: float
: The probability of a stop or a deceleration event is proportional to P_EVENT_C / maxspeed
. Default value: 1.0
P_EVENT_P: float
: The probability for an event to be a stop. The complement 1.0 - P_EVENT_P
is the probability for an event to be a deceleration. Default value: 0.1
P_EVENT_LENGTH: float
: Sampling distance in meters at which an acceleration, deceleration, or stop event may be generated. Default value: 5.0.
P_EVENT_ACC: float
: Constant speed in Km/h that is added to the current speed in an acceleration event. Default value: 12.0.
P_DEST_STOPPROB: float
: Probabilities for forced stops at crossings depending on the road type. It is defined by a transition matrix where lines and columns are ordered by side road (S), main road (M), freeway (F). The OSM highway types must be mapped to one of these categories in the function berlinmod_roadCategory
. Default value:
{{0.33, 0.66, 1.00}, {0.33, 0.50, 0.66}, {0.10, 0.33, 0.05}}
P_DEST_EXPMU: float
: Mean waiting time in seconds using an exponential distribution.
Increasing/decreasing this parameter allows us to slow down or speed up the trips. Could be think of as a measure of network congestion. Given a specific path, fine-tuning this parameter enable us to obtain an average travel time for this path that is the same as the expected travel time computed by a routing service such as, e.g., Google Maps. Default value: 1.0.
P_GPS_TOTALMAXERR: float
and P_GPS_STEPMAXERR: float
: Parameters for simulating measuring errors. They are only required when the parameter P_DISTURB_DATA
is true. They are, respectively, the maximum total deviation from the real position and maximum deviation per step, both in meters. Default values: 100.0 and 1.0.