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_lane

Add information for a lane to set its traffic generator.

set_start_time

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:
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.