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 Summary
Modifier and TypeMethodDescriptionvoidactivateVehicleSensors(double sensorRange, VehicleSensorActivation.SensorType... sensorTypes) Activates the detection of the leading vehicle within in a given distance.voidapplyVehicleParametersChange(VehicleParameters.VehicleParametersChangeRequest vehicleParametersRequest) Applies vehicle parameter changes which are defined in .voidchangeLane(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.voidchangeLane(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.voidchangeSpeedWithForcedAcceleration(double newSpeed, double forcedAcceleration) Allows control over the vehicle speed and the acceleration.voidchangeSpeedWithInterval(double newSpeed, long interval) Allows control over the vehicles speed.voidchangeSpeedWithPleasantAcceleration(double newSpeed) Allows control over the vehicle speed.Returns the type of the vehicle.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 vehicle data state.Returns vehicle parameters.Returns a request object, which can be used to change vehicle parameters.voidResets the speed of the vehicle to car-following rules after the speed has been set withchangeSpeedWithInterval(double, long).voidresume()Resumes a previously stopped vehicle.voidslowDown(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).voidstop(IRoadPosition stopPosition, VehicleStopMode vehicleStopMode, long durationInNs) Sends a stop message to stop the vehicle along the road or by the road side.voidstopNow(VehicleStopMode vehicleStopMode, long durationInNs) Sends a stop message to stop the vehicle along the road or by the road side.Methods inherited from interface org.eclipse.mosaic.fed.application.app.api.os.modules.AdHocCommunicative
getAdHocModuleMethods inherited from interface org.eclipse.mosaic.fed.application.app.api.os.modules.CellCommunicative
getCellModuleMethods inherited from interface org.eclipse.mosaic.fed.application.app.api.os.modules.Locatable
getInitialPosition, getPositionMethods inherited from interface org.eclipse.mosaic.fed.application.app.api.os.modules.Navigable
getNavigationModuleMethods inherited from interface org.eclipse.mosaic.fed.application.app.api.os.OperatingSystem
getApplications, getApplicationsIterator, getConfigurationPath, getEventManager, getGroup, getId, getSimulationTime, getSimulationTimeMs, sendInteractionToRti, sendItefLogTuple, sendSumoTraciRequestMethods inherited from interface org.eclipse.mosaic.fed.application.app.api.os.modules.Perceptive
getBasicSensorModule, getLidarSensorModule, getPerceptionModule
-
Method Details
-
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 laneduration- the duration for the lane change in nanoseconds
-
changeLane
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: usechangeLane(), for modeVehicleLaneChangeMode.index.- Parameters:
vehicleLaneChangeMode- mode to change laneduration- 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 speedinterval- 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 withchangeSpeedWithInterval(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
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 atvehicleStopMode- Stop modedurationInNs- Duration of the stop, unit: [ns]
-
stopNow
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 modedurationInNs- 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 toapplyVehicleParametersChange(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 usingrequestVehicleParametersUpdate().
-
activateVehicleSensors
Activates the detection of the leading vehicle within in a given distance.- Parameters:
sensorRange- The maximum range of the sensorsensorTypes- The type of the sensors (e.g. LIDAR)
-