pybtls.lib.BTLS.Vehicle#
- class Vehicle(self: pybtls.lib.libbtls._Vehicle, no_axles: int)[source]#
Bases:
_Vehicle
The Vehicle class is inherited from the CVehicle class in the C++ BTLS library. It is used to create a customized vehicle object.
- Parameters:
no_axles (int) – Number of axles.
Methods
Get all the vehicle properties in a tuple.
Get the value of the specified axle spacing.
Get the vehicle axle spacings.
Get the specified axle weight.
Get the vehicle axle weights.
Get the value of the specified axle width.
Get the vehicle axle widths.
Get the vehicle direction (1 or 2).
Get the gross vehicle weight of the vehicle.
Get the vehicle length.
Get the 1-based local lane index of the vehicle.
Get the number of axles of the vehicle.
Get the show-up time of the vehicle.
Get the vehicle transverse position on its lane.
Get the vehicle velocity.
Set all the vehicle properties from a tuple.
Set the specified axle spacing.
Set the vehicle axle spacings.
Set the specified axle weight.
Set the vehicle axle weights.
Set the specified axle width.
Set the vehicle axle widths.
Set the direction of the vehicle.
Set the local lane index of the vehicle from its 1-based global index.
Set the local lane index of the vehicle.
Set the show-up time of the vehicle.
Set the vehicle transverse position.
Set vehicle velocity.
- get_all_properties(self: pybtls.lib.libbtls._Vehicle) tuple #
Get all the vehicle properties in a tuple.
- get_axle_spacing(self: pybtls.lib.libbtls._Vehicle, index: int) float #
Get the value of the specified axle spacing.
- Parameters:
index (int) – The 0-based index of the axle.
- get_axle_spacings(self: pybtls.lib.libbtls._Vehicle) list[float] #
Get the vehicle axle spacings.
- get_axle_weight(self: pybtls.lib.libbtls._Vehicle, index: int) float #
Get the specified axle weight.
- Parameters:
index (int) – The 0-based index of the axle.
- get_axle_weights(self: pybtls.lib.libbtls._Vehicle) list[float] #
Get the vehicle axle weights.
- get_axle_width(self: pybtls.lib.libbtls._Vehicle, index: int) float #
Get the value of the specified axle width.
- Parameters:
index (int) – The 0-based index of the axle.
- get_axle_widths(self: pybtls.lib.libbtls._Vehicle) list[float] #
Get the vehicle axle widths.
- get_direction(self: pybtls.lib.libbtls._Vehicle) int #
Get the vehicle direction (1 or 2).
- get_gvw(self: pybtls.lib.libbtls._Vehicle) float #
Get the gross vehicle weight of the vehicle.
- get_length(self: pybtls.lib.libbtls._Vehicle) float #
Get the vehicle length.
- get_local_lane(self: pybtls.lib.libbtls._Vehicle) int #
Get the 1-based local lane index of the vehicle.
- get_no_axles(self: pybtls.lib.libbtls._Vehicle) int #
Get the number of axles of the vehicle.
- get_time(self: pybtls.lib.libbtls._Vehicle) float #
Get the show-up time of the vehicle.
- get_trans(self: pybtls.lib.libbtls._Vehicle) float #
Get the vehicle transverse position on its lane.
- get_velocity(self: pybtls.lib.libbtls._Vehicle) float #
Get the vehicle velocity.
- set_all_properties(self: pybtls.lib.libbtls._Vehicle, prop_tuple: tuple) None #
Set all the vehicle properties from a tuple.
- set_axle_spacing(self: pybtls.lib.libbtls._Vehicle, index: int, spacing: float) None #
Set the specified axle spacing. The vehicle length is updated automatically.
- Parameters:
index (int) – The 0-based index of the axle.
spacing (float) – The axle spacing.
- set_axle_spacings(self: pybtls.lib.libbtls._Vehicle, spacings: list[float]) None #
Set the vehicle axle spacings. The vehicle length is calculated as the sum of the axle spacings automatically.
- Parameters:
spacings (list[float]) – The vehicle axle spacings. The last spacing should always be zero.
- set_axle_weight(self: pybtls.lib.libbtls._Vehicle, index: int, weight: float) None #
Set the specified axle weight. The gross vehicle weight is updated automatically.
- Parameters:
index (int) – The 0-based index of the axle.
weight (float) – The axle weight.
- set_axle_weights(self: pybtls.lib.libbtls._Vehicle, axle_weights: list[float]) None #
Set the vehicle axle weights. The gross vehicle weight is calculated as the sum of the axle weights automatically.
- Parameters:
weights (list[float]) – The vehicle axle weights.
- set_axle_width(self: pybtls.lib.libbtls._Vehicle, index: int, width: float) None #
Set the specified axle width.
- Parameters:
index (int) – The 0-based index of the axle.
width (float) – The axle width.
- set_axle_widths(self: pybtls.lib.libbtls._Vehicle, widths: list[float]) None #
Set the vehicle axle widths.
- Parameters:
widths (list[float]) – The vehicle axle widths.
- set_direction(self: pybtls.lib.libbtls._Vehicle, direction: int) None #
Set the direction of the vehicle.
- Parameters:
direction (Literal[1,2]) – The direction of the vehicle.
- set_local_from_global_lane(self: pybtls.lib.libbtls._Vehicle, global_lane_index: int, no_lanes: int) None #
Set the local lane index of the vehicle from its 1-based global index. This method needs to be called after the vehicle direction is set.
- Parameters:
global_lane_index (int) – The 1-based global lane index of the vehicle.
no_lanes (int) – The number of lanes in the direction of the vehicle.
- set_local_lane(self: pybtls.lib.libbtls._Vehicle, local_lane_index: int) None #
Set the local lane index of the vehicle.
- Parameters:
local_lane_index (int) – The 1-based local lane index of the vehicle.
- set_time(self: pybtls.lib.libbtls._Vehicle, time: float) None #
Set the show-up time of the vehicle.
- Parameters:
time (float) – The showing time of the vehicle, in seconds.
- set_trans(self: pybtls.lib.libbtls._Vehicle, trans: float) None #
Set the vehicle transverse position.
- Parameters:
trans (float) – The transverse position of the vehicle on its lane, in metres.
- set_velocity(self: pybtls.lib.libbtls._Vehicle, velocity: float) None #
Set vehicle velocity.
- Parameters:
velocity (float) – The velocity of the vehicle, in m/s.