Interface VehicleOperatingSystem

All Superinterfaces:
AdHocCommunicative, CellCommunicative, Locatable, Navigable, OperatingSystem, Perceptive
All Known Subinterfaces:
ElectricVehicleOperatingSystem
All Known Implementing Classes:
ElectricVehicleUnit, VehicleUnit

public interface VehicleOperatingSystem extends OperatingSystem, Locatable, Navigable, Perceptive, CellCommunicative, AdHocCommunicative
This interface extends the basic OperatingSystem and is implemented by the AbstractSimulationUnit VehicleUnit.
  • Method Details

    • getVehicleData

      @Nullable VehicleData getVehicleData()
      Returns the current vehicle data state.
      Returns:
      the current vehicle data state.
    • changeLane

      void changeLane(int targetLaneIndex, long duration)
      Forces a lane change to the lane with the given index; If successful, the lane will be chosen for the given amount of time.
      Parameters:
      targetLaneIndex - index of target lane
      duration - the duration for the lane change in nanoseconds
    • changeLane

      void changeLane(VehicleLaneChange.VehicleLaneChangeMode vehicleLaneChangeMode, long duration)
      Forces a lane change to the lane according to the specified mode; If successful, the lane will be chosen for the given amount of time.

      Note: use changeLane(), for mode VehicleLaneChangeMode.index.
      Parameters:
      vehicleLaneChangeMode - mode to change lane
      duration - the duration for the lane change in nanoseconds
    • slowDown

      void slowDown(float speed, long interval)
      Slow down the vehicle with the given Id to the given speed until the given time (the vehicle is not guaranteed to have the given speed at the end of the given time). With this command it is possible to simulate e.g., instant brakes, slowing down, etc.
      Parameters:
      speed - new speed
      interval - Time interval for which the slow down should be valid, after that interval the vehicle will accelerate again. Unit: [ns].
    • resetSpeed

      void resetSpeed()
      Resets the speed of the vehicle to car-following rules after the speed has been set with changeSpeedWithInterval(double, long).
    • changeSpeedWithInterval

      void changeSpeedWithInterval(double newSpeed, long interval)
      Allows control over the vehicles speed.
      Parameters:
      newSpeed - is the target speed in [m/s]
      interval - the new speed should be reached in [ns]
    • changeSpeedWithForcedAcceleration

      void changeSpeedWithForcedAcceleration(double newSpeed, double forcedAcceleration)
      Allows control over the vehicle speed and the acceleration.
      Parameters:
      newSpeed - is the target speed in [m/s]
      forcedAcceleration - is the acceleration in m/s², forced acceleration with highest priority
    • changeSpeedWithPleasantAcceleration

      void changeSpeedWithPleasantAcceleration(double newSpeed)
      Allows control over the vehicle speed. The pleasantAcceleration set in DriverProperties will be used.
      Parameters:
      newSpeed - is the target speed in [m/s]
    • stop

      void stop(IRoadPosition stopPosition, VehicleStopMode vehicleStopMode, long durationInNs)
      Sends a stop message to stop the vehicle along the road or by the road side.
      Parameters:
      stopPosition - Position on road where the vehicle is supposed to stop at
      vehicleStopMode - Stop mode
      durationInNs - Duration of the stop, unit: [ns]
    • stopNow

      void stopNow(VehicleStopMode vehicleStopMode, long durationInNs)
      Sends a stop message to stop the vehicle along the road or by the road side. The vehicle is tried to stop as soon as possible.
      Parameters:
      vehicleStopMode - Stop mode
      durationInNs - Duration of the stop, unit: [ns]
    • resume

      void resume()
      Resumes a previously stopped vehicle.
    • getRoadPosition

      IRoadPosition getRoadPosition()
      Returns the road position of the vehicle containing all information about the vehicle's position within the road network, such as previous and upcoming node or the way the vehicle is currently driving on.
      Returns:
      the current road position
    • getInitialVehicleType

      VehicleType getInitialVehicleType()
      Returns the type of the vehicle.
      Returns:
      the type of the vehicle.
    • getVehicleParameters

      VehicleParameters getVehicleParameters()
      Returns vehicle parameters.
      Returns:
      the behavioral parameters of the vehicle (such as maximum speed or lane-change-behavior)
    • requestVehicleParametersUpdate

      VehicleParameters.VehicleParametersChangeRequest requestVehicleParametersUpdate()
      Returns a request object, which can be used to change vehicle parameters. After changing relevant parameters, this request object must be passed to applyVehicleParametersChange(VehicleParameters.VehicleParametersChangeRequest) in order to apply the vehicle parameters.
      Returns:
      an request object, which can be used to change vehicle parameters.
    • applyVehicleParametersChange

      void applyVehicleParametersChange(VehicleParameters.VehicleParametersChangeRequest vehicleParametersRequest)
      Applies vehicle parameter changes which are defined in .
      Parameters:
      vehicleParametersRequest - The request, which has been created using requestVehicleParametersUpdate().
    • activateVehicleSensors

      void activateVehicleSensors(double sensorRange, VehicleSensorActivation.SensorType... sensorTypes)
      Activates the detection of the leading vehicle within in a given distance.
      Parameters:
      sensorRange - The maximum range of the sensor
      sensorTypes - The type of the sensors (e.g. LIDAR)