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_properties

Get all the vehicle properties in a tuple.

get_axle_spacing

Get the value of the specified axle spacing.

get_axle_spacings

Get the vehicle axle spacings.

get_axle_weight

Get the specified axle weight.

get_axle_weights

Get the vehicle axle weights.

get_axle_width

Get the value of the specified axle width.

get_axle_widths

Get the vehicle axle widths.

get_direction

Get the vehicle direction (1 or 2).

get_gvw

Get the gross vehicle weight of the vehicle.

get_length

Get the vehicle length.

get_local_lane

Get the 1-based local lane index of the vehicle.

get_no_axles

Get the number of axles of the vehicle.

get_time

Get the show-up time of the vehicle.

get_trans

Get the vehicle transverse position on its lane.

get_velocity

Get the vehicle velocity.

set_all_properties

Set all the vehicle properties from a tuple.

set_axle_spacing

Set the specified axle spacing.

set_axle_spacings

Set the vehicle axle spacings.

set_axle_weight

Set the specified axle weight.

set_axle_weights

Set the vehicle axle weights.

set_axle_width

Set the specified axle width.

set_axle_widths

Set the vehicle axle widths.

set_direction

Set the direction of the vehicle.

set_local_from_global_lane

Set the local lane index of the vehicle from its 1-based global index.

set_local_lane

Set the local lane index of the vehicle.

set_time

Set the show-up time of the vehicle.

set_trans

Set the vehicle transverse position.

set_velocity

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.