pybtls.traffic.traffic_generator.TrafficGenerator#
- class TrafficGenerator(no_lane)[source]#
Bases:
object
The TrafficGenerator instance stores the information for creating CTrafficGenerator instances for each lane.
- Parameters:
no_lane (int) – The number of lanes on the bridge.
Methods
Add information for a lane to set its traffic generator.
Set the start time for the traffic generators.
Attributes
no_dir
no_lane
no_lane_dir_1
no_lane_dir_2
tag
vehicle_classifier
- add_lane(vehicle_gen, headway_gen, lfc)[source]#
Add information for a lane to set its traffic generator.
- Parameters:
vehicle_gen (Union[VehicleGenNominal, VehicleGenGrave, VehicleGenGarage]) – The vehicle generator for the lane.
headway_gen (Union[HeadwayGenNHM, HeadwayGenConstant, HeadwayGenCongested, HeadwayGenFreeflow]) – The headway generator for the lane.
lfc (LaneFlowComposition) – The lane flow composition for the lane.
- Return type:
None.
- set_start_time(start_time)[source]#
Set the start time for the traffic generators.
- Parameters:
start_time (Union[float,list[float]]) –
The start time for the traffic generators.
If a float is provided, all traffic generators will have the same start time.
If a list of float is provided, the length of the list should be equal to the number of lanes on the bridge,
and each traffic generator will have the corresponding start time.
- Return type:
None.