_Vehicle

Module Contents

Classes

Vehicle

class _Vehicle.Vehicle(vehicleId: str)

Bases: trasmapy._IdentifiedObject.IdentifiedObject, trasmapy.color._Colorable.Colorable

property vehicleClass: trasmapy.users.VehicleClass.VehicleClass
property vehicleType: trasmapy.users._VehicleType.VehicleType
property emissionClass: str
property shapeClass: str
property personCapacity: int

Returns the person capacity of the vehicle.

property personCount: int

Returns the number of people inside the vehicle.

property speed: float

Returns the speed of the vehicle within the last step (m/s). Error value: -2^30

property lateralSpeed: float

Returns the lateral speed of the vehicle within the last step (m/s). Error value: -2^30

property allowedSpeed: float

Returns the maximum allowed speed of the lane the vehicle is in (m/s).

property acceleration: float

Returns the acceleration in the previous time step (m/s^2).

property doRerouting: bool

Returns whether the vehicle is able to do automatic rerouting.

property edgeId: str

Returns the ID of the edge the vehicle was in the previous time step.

property laneId: str

Returns the ID of the lane the vehicle was in the previous time step.

property drivenDistance: float

Returns the distance the vehicle has already driven (m). Error value: -2^30

property CO2Emissions: float

Returns the vehicle’s CO2 emissions during this time step (mg/s). To get the value for one step multiply with the step length. Error value: -2^30

property COEmissions: float

Returns the vehicle’s CO emissions during this time step (mg/s). To get the value for one step multiply with the step length. Error value: -2^30

property HCEmissions: float

Returns the vehicle’s HC emissions during this time step (mg/s). To get the value for one step multiply with the step length. Error value: -2^30

property PMxEmissions: float

Returns the vehicle’s PMx emissions during this time step (mg/s). To get the value for one step multiply with the step length. Error value: -2^30

property NOxEmissions: float

Returns the vehicle’s NOx emissions during this time step (mg/s). To get the value for one step multiply with the step length. Error value: -2^30

property fuelConsumption: float

Returns the vehicle’s NOx emissions during this time step (ml/s). To get the value for one step multiply with the step length. Error value: -2^30

property electricityConsumption: float

Returns the vehicle’s electricity consumption during this time step (Wh/s). To get the value for one step multiply with the step length. Error value: -2^30

property noiseEmission: float

Returns the noise generated by the vehicle (dBA). Error value: -2^30

property timeLoss: float
property color: trasmapy.color._Colorable.Color
property via: list[str]

Returns the list of IDs via edges (edge it needs to pass through in the route) for the vehicle.

static _checkVehicleExistance(method)
setAcceleration(newAccel: float, duration: float) None

Sets the vehicle acceleration (m/s^2) for the given amount of time.

rerouteByTravelTime() None

Computes a new route to the current destination that minimizes travel time. The assumed values for each edge in the network can be customized in various ways. See Simulation/Routing#Travel-time_values_for_routing. Replaces the current route by the found.

rerouteByEffort() None

Computes a new route using the vehicle’s internal and the global edge effort information. Replaces the current route by the found.

isDead() bool
isPending() bool
_getStopState() int
isStoppedAnyReason() bool

Returns whether the vehicle’s is stopped state for any reason (any stopped state)

isStopped() bool

Returns whether the vehicle’s stop state is: stopped

isParking() bool

Returns whether the vehicle’s stop state is: parking

isTriggered() bool

Returns whether the vehicle’s stop state is: triggered

isContainerTriggered() bool

Returns whether the vehicle’s stop state is: containerTriggered

isAtBusStop() bool

Returns whether the vehicle’s stop state is: atBusStop

isAtContainerStop() bool

Returns whether the vehicle’s stop state is: atContainerStop

isAtChargingStation() bool

Returns whether the vehicle’s stop state is: atChargingStation

isAtParkingArea() bool

Returns whether the vehicle’s stop state is: atParkingArea

getStops() list[trasmapy.users._VehicleStop.VehicleStop]
stop(scheduledStop: trasmapy.users.ScheduledStop.ScheduledStop) None

Stops the vehicle at the given location with the given schedule. Re-issuing a stop command with the same location allows changing the duration. Setting the duration to 0 cancels an existing stop. Note that it might not be possible for a vehicle to stop at a given place because of access restrictions.

stopFor(stop: trasmapy.network._Stop.Stop, duration: float, stopParams: list[trasmapy.users.StopType.StopType] = []) None

Stops the vehicle at the given position in the given edge for the given duration (s). See documentation for the stop(…) method.

stopUntil(stop: trasmapy.network._Stop.Stop, until: float, stopParams: list[trasmapy.users.StopType.StopType] = []) None

Stops the vehicle at the given position in the given edge until a given simulation time (s). See documentation for the stop(…) method.

resume() None

Resumes the march of a stopped vehicle. Throws exception if the vehicle isn’t stopped.

moveTo(laneId: str, pos: float, reason: trasmapy.users.MoveReason.MoveReason = MoveReason.AUTOMATIC) None

Move a vehicle to a new position along its current route.

remove(reason: trasmapy.users.RemoveReason.RemoveReason = RemoveReason.VAPORIZED) None
changeTargetEdge(targedEdge: trasmapy.network._Edge.Edge) None