Class VehicleData

java.lang.Object
org.eclipse.mosaic.lib.objects.UnitData
org.eclipse.mosaic.lib.objects.vehicle.VehicleData
All Implemented Interfaces:
Serializable

@Immutable public class VehicleData extends UnitData
This class is used as a container for any vehicle data.
See Also:
  • Method Details

    • getProjectedPosition

      public CartesianPoint 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

      public IRoadPosition getRoadPosition()
      Returns the position of the vehicle in the road network.
    • getRouteId

      public String 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

      public Double 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

      public Double getLongitudinalAcceleration()
      Returns the longitudinal acceleration of the vehicle. Supported Traffic simulators: [PHABMACS, SUMO]
      Returns:
      the longitudinal acceleration of the vehicle
    • getLaneAreaId

      @Nullable public String getLaneAreaId()
      Returns the identifier of the lane area in which the vehicle is currently driving. Might be null.
    • 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, otherwise false
    • getVehicleStopMode

      public VehicleStopMode 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

      public VehicleEmissions getVehicleEmissions()
      Returns information about the emissions ejected by the vehicle, e.g. CO2. Supported Traffic simulators: [SUMO]
      Returns:
      emissions ejected by the vehicle
    • getVehicleConsumptions

      public VehicleConsumptions getVehicleConsumptions()
      Returns information about the consumptions of the vehicle, e.g. fuel consumption. Supported Traffic simulators: [SUMO]
      Returns:
      consumptions of the vehicle
    • getVehicleSignals

      public VehicleSignals 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

      public VehicleSensors 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

      public List<SurroundingVehicle> 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

      public Double getBrake()
    • getThrottle

      public Double getThrottle()
    • getDriveDirection

      public DriveDirection getDriveDirection()
      Returns the driving direction of the vehicle (forward/backward). Supported simulators: [PHABMACS]
      Returns:
      the drive direction of the vehicle
    • getAdditionalData

      public Object getAdditionalData()
      Returns additional vehicle data produced by the traffic or vehicle simulator. Can be of any arbitrary type, and is null if the producer has not been implemented in a way to add this additional data.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class UnitData
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class UnitData
    • toString

      public String toString()
      Overrides:
      toString in class UnitData