paralleldomain.data_lab.generators.traffic¶
- class TrafficGeneratorParameters(*, proto=None, position_request=None, spawn_probability=None, vehicle_spawn_data=None, vehicle_distribution=None, start_separation_time_map=None, target_separation_time_map=None)¶
Generator to place multiple vehicles into the world. Requires previous use of
EgoAgentGeneratorParameters
in the scenario.- Parameters:
position_request (
Optional
[PositionRequest
]) –position_request
spawn_probability (
Optional
[float
]) –spawn_probability
vehicle_spawn_data (
Optional
[VehicleSpawnData
]) –vehicle_spawn_data
vehicle_distribution (
Optional
[Dict
[str
,VehicleCategoryWeight
]]) –vehicle_distribution
start_separation_time_map (
Optional
[Dict
[str
,ContinousUniformDistribution
]]) –start_separation_time_map
target_separation_time_map (
Optional
[Dict
[str
,ContinousUniformDistribution
]]) –target_separation_time_map
proto (Optional[pd_unified_generator_pb2.TrafficGeneratorParameters]) –
- position_request¶
Specifies the location around which traffic agents should be spawned. Only works with
LocationRelativePositionRequest
. Must be provided.
- spawn_probability¶
Specifies the density of traffic that is spawned by controlling the proportion of valid spawn points in which vehicles are spawned. Valid values are floats in the range 0.0 to 1.0. 0.0 indicates no traffic spawned. 1.0 indicates maximum possible density. Default: 0.8
- vehicle_spawn_data¶
Parameters that govern the vehicle’s spawn characteristics and movement behavior. If not provided, will use defaults specified in
VehicleSpawnData
.
- vehicle_distribution¶
Specifies the likelihood of various vehicle categories spawning. If not provided, will use the values below.
Default values:
"MIDSIZE" : 0.181 "COMPACT" : 0.177 "BUS" : 0.019 "TRUCK" : 0.038 "SUV" : 0.197 "VAN" : 0.066 "BICYCLE" : 0.061 "MOTORCYCLE" : 0.068 "CARAVAN" :/RV 0.009 "FULLSIZE" : 0.184
- start_separation_time_map¶
Controls the minimum separation distance between valid spawn points for vehicles by multiplying the start_separation_time_map by each vehicle’s initial velocity. If not provided, defaults to the values below.
Default values:
{"bicycle", {0.7f, 1.7f}} {"heavy", {2.5f, 3.5f}} {"heavy_nondriven", {2.5f, 3.5f}} {"light", {0.7f, 1.7f}} {"light_nondriven", {0.7f, 1.7f}} {"medium", {1.5f, 2.5f}} {"medium_nondriven", {1.5f, 2.5f}} {"motorcycle", {0.7f, 1.7f}}
- target_separation_time_map¶
Specifies the separation time between vehicles which should be targeted through the scenario. If not provided, will use the values provided in
start_separation_time_map
.