pybtls.lib.libbtls.Vehicle#

class Vehicle(self: pybtls.lib.libbtls.Vehicle, no_axles: SupportsInt)#

Bases: pybind11_object

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_axle_spacing

get_axle_spacing(self: pybtls.lib.libbtls.Vehicle, index: typing.SupportsInt) -> float

get_axle_spacings

get_axle_spacings(self: pybtls.lib.libbtls.Vehicle) -> list[float]

get_axle_weight

get_axle_weight(self: pybtls.lib.libbtls.Vehicle, index: typing.SupportsInt) -> float

get_axle_weights

get_axle_weights(self: pybtls.lib.libbtls.Vehicle) -> list[float]

get_axle_width

get_axle_width(self: pybtls.lib.libbtls.Vehicle, index: typing.SupportsInt) -> float

get_axle_widths

get_axle_widths(self: pybtls.lib.libbtls.Vehicle) -> list[float]

get_direction

get_direction(self: pybtls.lib.libbtls.Vehicle) -> int

get_gvw

get_gvw(self: pybtls.lib.libbtls.Vehicle) -> float

get_length

get_length(self: pybtls.lib.libbtls.Vehicle) -> float

get_local_lane

get_local_lane(self: pybtls.lib.libbtls.Vehicle) -> int

get_no_axles

get_no_axles(self: pybtls.lib.libbtls.Vehicle) -> int

get_time

get_time(self: pybtls.lib.libbtls.Vehicle) -> float

get_trans

get_trans(self: pybtls.lib.libbtls.Vehicle) -> float

get_velocity

get_velocity(self: pybtls.lib.libbtls.Vehicle) -> float

set_axle_spacing

set_axle_spacing(self: pybtls.lib.libbtls.Vehicle, index: typing.SupportsInt, spacing: typing.SupportsFloat) -> None

set_axle_spacings

set_axle_spacings(self: pybtls.lib.libbtls.Vehicle, spacings: collections.abc.Sequence[typing.SupportsFloat]) -> None

set_axle_weight

set_axle_weight(self: pybtls.lib.libbtls.Vehicle, index: typing.SupportsInt, weight: typing.SupportsFloat) -> None

set_axle_weights

set_axle_weights(self: pybtls.lib.libbtls.Vehicle, axle_weights: collections.abc.Sequence[typing.SupportsFloat]) -> None

set_axle_width

set_axle_width(self: pybtls.lib.libbtls.Vehicle, index: typing.SupportsInt, width: typing.SupportsFloat) -> None

set_axle_widths

set_axle_widths(self: pybtls.lib.libbtls.Vehicle, widths: collections.abc.Sequence[typing.SupportsFloat]) -> None

set_direction

set_direction(self: pybtls.lib.libbtls.Vehicle, direction: typing.SupportsInt) -> None

set_local_from_global_lane

set_local_from_global_lane(self: pybtls.lib.libbtls.Vehicle, global_lane_index: typing.SupportsInt, no_lanes: typing.SupportsInt) -> None

set_local_lane

set_local_lane(self: pybtls.lib.libbtls.Vehicle, local_lane_index: typing.SupportsInt) -> None

set_time

set_time(self: pybtls.lib.libbtls.Vehicle, time: typing.SupportsFloat) -> None

set_trans

set_trans(self: pybtls.lib.libbtls.Vehicle, trans: typing.SupportsFloat) -> None

set_velocity

set_velocity(self: pybtls.lib.libbtls.Vehicle, velocity: typing.SupportsFloat) -> None

get_axle_spacing(self: pybtls.lib.libbtls.Vehicle, index: SupportsInt) 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: SupportsInt) 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: SupportsInt) 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_axle_spacing(self: pybtls.lib.libbtls.Vehicle, index: SupportsInt, spacing: SupportsFloat) 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: collections.abc.Sequence[SupportsFloat]) 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: SupportsInt, weight: SupportsFloat) 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: collections.abc.Sequence[SupportsFloat]) 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: SupportsInt, width: SupportsFloat) 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: collections.abc.Sequence[SupportsFloat]) None#

Set the vehicle axle widths.

Parameters:

widths (list[float]) – The vehicle axle widths.

set_direction(self: pybtls.lib.libbtls.Vehicle, direction: SupportsInt) 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: SupportsInt, no_lanes: SupportsInt) 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: SupportsInt) 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: SupportsFloat) 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: SupportsFloat) 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: SupportsFloat) None#

Set vehicle velocity.

Parameters:

velocity (float) – The velocity of the vehicle, in m/s.