Class VehicleData
java.lang.Object
org.eclipse.mosaic.lib.objects.UnitData
org.eclipse.mosaic.lib.objects.vehicle.VehicleData
- All Implemented Interfaces:
Serializable
This class is used as a container for any vehicle data.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A builder for creatingVehicleData
objects without using the monstrous constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns additional vehicle data produced by the traffic or vehicle simulator.getBrake()
double
Returns the distance, the vehicle has already driven.Returns the driving direction of the vehicle (forward/backward).Getter for the vehicle heading in degrees from north clockwise.Returns the identifier of the lane area in which the vehicle is currently driving.Returns the longitudinal acceleration of the vehicle.Returns the projected position of the vehicle in Cartesian coordinates.Returns the position of the vehicle in the road network.Getter for the current vehicle route id.double
getSlope()
Returns the slope of the current vehicle position in degrees.double
getSpeed()
Getter for the speed.Returns information about the consumptions of the vehicle, e.g.Returns information about the emissions ejected by the vehicle, e.g.Returns information about the sensors of the vehicle.Returns information about the signal state of the vehicle, e.g.Getter for the list of vehicles in the field of view of this vehicle.Getter for the stop mode of the vehicle.int
hashCode()
boolean
Getter for the stopped state of a vehicle.toString()
Methods inherited from class org.eclipse.mosaic.lib.objects.UnitData
getName, getPosition, getTime
-
Method Details
-
getProjectedPosition
Returns the projected position of the vehicle in Cartesian coordinates. Supported Traffic simulators: [SUMO]- Returns:
- the projected position of the vehicle (x-y coordinates)
-
getRoadPosition
Returns the position of the vehicle in the road network. -
getRouteId
Getter for the current vehicle route id. Supported Traffic simulators: [PHABMACS, SUMO]- Returns:
- Current vehicle route id. Unitless.
-
getSpeed
public double getSpeed()Getter for the speed. Unit: [m/s].
Supported Traffic simulators: [PHABMACS, SUMO]- Returns:
- The speed.
-
getHeading
Getter for the vehicle heading in degrees from north clockwise. Supported Traffic simulators: [SUMO]- Returns:
- the heading of the vehicle
-
getSlope
public double getSlope()Returns the slope of the current vehicle position in degrees. -
getLongitudinalAcceleration
Returns the longitudinal acceleration of the vehicle. Supported Traffic simulators: [PHABMACS, SUMO]- Returns:
- the longitudinal acceleration of the vehicle
-
getLaneAreaId
Returns the identifier of the lane area in which the vehicle is currently driving. Might benull
. -
getDistanceDriven
public double getDistanceDriven()Returns the distance, the vehicle has already driven. Unit: [m] Supported Traffic simulator: [SUMO]- Returns:
- the distance, the vehicle has already driven. Unit: [m]
-
isStopped
public boolean isStopped()Getter for the stopped state of a vehicle. Supported Traffic simulator: [PHABMACS, SUMO]- Returns:
- Flag, indicating if the vehicle is currently stopped
True
, if the vehicle is currently stopped, otherwisefalse
-
getVehicleStopMode
Getter for the stop mode of the vehicle.- Returns:
- if vehicle is not stopped returns
VehicleStopMode.NOT_STOPPED
else the according stop mode is returned
-
getVehicleEmissions
Returns information about the emissions ejected by the vehicle, e.g. CO2. Supported Traffic simulators: [SUMO]- Returns:
- emissions ejected by the vehicle
-
getVehicleConsumptions
Returns information about the consumptions of the vehicle, e.g. fuel consumption. Supported Traffic simulators: [SUMO]- Returns:
- consumptions of the vehicle
-
getVehicleSignals
Returns information about the signal state of the vehicle, e.g. right/left indicator. Supported simulators: [SUMO]- Returns:
- the state of the signals of the vehicle
-
getVehicleSensors
Returns information about the sensors of the vehicle. Supported simulators: [PHABMACS, SUMO (only front/rear sensor, opt-in)]- Returns:
- the sensor state of the vehicle
-
getVehiclesInSight
Getter for the list of vehicles in the field of view of this vehicle. Supported Traffic simulators: [SUMO (only with VehicleSightDistanceConfiguration, opt-in)]- Returns:
- the list of vehicles in the field of view of this vehicle.
-
getBrake
-
getThrottle
-
getDriveDirection
Returns the driving direction of the vehicle (forward/backward). Supported simulators: [PHABMACS]- Returns:
- the drive direction of the vehicle
-
getAdditionalData
Returns additional vehicle data produced by the traffic or vehicle simulator. Can be of any arbitrary type, and isnull
if the producer has not been implemented in a way to add this additional data. -
hashCode
public int hashCode() -
equals
-
toString
-