pybtls.traffic.traffic_generator.TrafficGenerator#
- class TrafficGenerator(no_lane)[source]#
Bases:
objectThe 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_dirno_laneno_lane_dir_1no_lane_dir_2tagvehicle_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[HeadwayGenHeDS, 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.